Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mplayer: ... vo: couldn't open the X11 display (:0.0)!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
alexaltair
n00b
n00b


Joined: 12 Jun 2003
Posts: 24

PostPosted: Mon Aug 18, 2003 6:53 pm    Post subject: mplayer: ... vo: couldn't open the X11 display (:0.0)! Reply with quote

I did emerge mplayer and now when I try to play video file it fails with message:
====
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

vo: couldn't open the X11 display (:0.0)!
Error opening/initializing the selected video_out (-vo) device.
====

Please help.
Back to top
View user's profile Send private message
hensan
l33t
l33t


Joined: 26 Jun 2003
Posts: 868
Location: Sweden

PostPosted: Mon Aug 18, 2003 7:04 pm    Post subject: Reply with quote

Did you try running mplayer as root while being logged into X as regular user?

As default only the user who logged into X can open new windows. To allow other users (like root) to open windows you must run 'xhost + localhost'.

The easiest sollution is of course to just run mplayer as the user that logged into X.
Back to top
View user's profile Send private message
grant.mcdorman
Apprentice
Apprentice


Joined: 29 Jan 2003
Posts: 295
Location: Toronto, ON, Canada

PostPosted: Mon Aug 18, 2003 7:06 pm    Post subject: Re: mplayer: ... vo: couldn't open the X11 display (:0.0)! Reply with quote

alexaltair wrote:
I did emerge mplayer and now when I try to play video file it fails with message:
====
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

vo: couldn't open the X11 display (:0.0)!
Error opening/initializing the selected video_out (-vo) device.
====

Please help.
This sounds like an authorization error.

Are you running mplayer using the same user you signed on to X (or, if you're using startx, the same user that started it)?

If not, that's why. If you have to run as a different user, the secure way of fixing it is to do something like (running as the user in X, and _user_using_mplayer_ is the user that wants to run mplayer):
Code:
xauth extract $DISPLAY - | su _user_using_mplayer_ -c 'xauth merge -'
The less secure way is
Code:
xhost +localhost
and the no-security way is
Code:
xhost -
Look at xauth and xhost man pages for more details.
Back to top
View user's profile Send private message
alexaltair
n00b
n00b


Joined: 12 Jun 2003
Posts: 24

PostPosted: Mon Aug 18, 2003 10:24 pm    Post subject: Reply with quote

Yes, I was running MPlayer as 'root'. BTW not only MPlayer reports such error. I was installing Enemy Territory and it failed to gain access to X.

I did "xhost +localhost" and everything works now. Thanks for help.
Back to top
View user's profile Send private message
grant.mcdorman
Apprentice
Apprentice


Joined: 29 Jan 2003
Posts: 295
Location: Toronto, ON, Canada

PostPosted: Mon Aug 18, 2003 11:59 pm    Post subject: Reply with quote

alexaltair wrote:
Yes, I was running MPlayer as 'root'. BTW not only MPlayer reports such error. I was installing Enemy Territory and it failed to gain access to X.

I did "xhost +localhost" and everything works now. Thanks for help.
For applications running as root, the following bash fragment will give them access to the display (since root can read your private files):
Code:
 if [ -if /var/run/console.lock]; then
   # this weirdness is so ~username gets expanded properly
   XAUTHORITY="`eval echo ~\`cat /var/run/console.lock\`/.Xauthority`"
   export XAUTHORITY
fi


An alterative is to set up sudo; it preserves your display access permissions (i.e. sudo mplayer will run mplayer as root, but allow access to the display, if you've set up the sudo configuration correctly; to do so, do visudo as root).

Another alternative is, if - as the user logged into X - you do:
Code:
XAUTHORITY=~/.Xauthority;export XAUTHORITY
then PAM will properly copy your authentication when you su to root.

However, why do you need to run mplayer (or other X apps) as root? That shouldn't be necessary.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum