Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Multiple X sessions?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
KevinLarson
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 126
Location: Chaimpaign, IL

PostPosted: Mon Feb 05, 2007 6:08 pm    Post subject: Multiple X sessions? Reply with quote

What I would like to do is have a way that I can watch videos on my tv without having to close my current X session. If I used one monitor, this would be easy because you can set up X to run a tv and a monitor, but I run twinview, and 2 monitors and a tv is not an option. My first thought was to switch between one monitor and the tv, but it looks like I would need to restart x each time. My second idea was to start up another X session which uses the tv as the display (if possible I would like to have it the tv and one of the two monitors, but couldn't even get that to work) I made a script that does this (starttv if you care) by using a second xorg.conf file. It works fine by itself (when X isnt already open) but when I try to run it without closing my current X session, I get this message
Code:

Fatal server error:
Server is already active for display 0
        If this server is no longer running, remove /tmp/.X0-lock
        and start again.



I'm using the 2.6.20-rc5 kernel
A geforce 6800gt with the 1.0.9746 drivers

Also, I am in no way commited to doing it this way. All I want is to be able to use my tv without having to close my X session and without sacrificing my second monitor.
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Mon Feb 05, 2007 6:36 pm    Post subject: Reply with quote

startx -- :1
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Mon Feb 05, 2007 7:36 pm    Post subject: Reply with quote

as nixnut said, (well he thought very hard): start on DISPLAY=:1 because, the first one (DISPLAY=:0 ) is already taken with your Xsession.

If you don't want to worry about which display is taken and which is not, then you can use xlaunch (link in my sig), it will find the first available DISPLAY and use it to start whatever you want, you can also chose to use a given xorg config file (explained here
_________________
The End of the Internet!


Last edited by truc on Thu Feb 08, 2007 9:52 am; edited 2 times in total
Back to top
View user's profile Send private message
KevinLarson
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 126
Location: Chaimpaign, IL

PostPosted: Mon Feb 05, 2007 10:58 pm    Post subject: Reply with quote

Wow, that script is nice, but I can't figure out how to do what I want with it. I want to be able to play video on my tv (I would be fine with just mplayer-bin, xine, and vlc so I could make special cases for all of them) But when I make a specific case for mplayer-bin wouldn't it only play mplayer-bin on the tv? What I was trying is below:


Code:
   # Now we launch the program on an other DISPLAY
case "${FULL_PROG_NAME##*/}" in
    # It's in a case, since you could want to launch other stuffs for a specific program
    # e.g.: you're a XGL user, and want to start googleearth on an other DISPLAY, then
    # you could want to start it with a minimal window manager:
    # googleearth)    xinit "${FULL_PROG_NAME}" $* -- :$DISPLAY_TO_USE $Xserverargs &
    #                 DISPLAY:$DISPLAY_TO_USE minimal_WM &

    xlaunch)
        echo "The program can't call itself. Exiting!"
        # Well, actually it can, but it will exit later, so exiting now..
        exit 2;;

    mplayer-bin)
        Xserverargs="-config xorg.conf1 $Xserverargs"
        echo "Starting ${FULL_PROG_NAME} on DISPLAY $DISPLAY_TO_USE"
        xinit "${FULL_PROG_NAME}" $* -- $Xserver :$DISPLAY_TO_USE $Xserverargs &>/dev/null &

    *)
        echo "Starting ${FULL_PROG_NAME} on DISPLAY $DISPLAY_TO_USE"
        xinit "${FULL_PROG_NAME}" $* -- $Xserver :$DISPLAY_TO_USE $Xserverargs &>/dev/null &
        ;;
esac


Running
xlaunch mplayer-bin <video file>
results in this error
Code:
/home/scripts/xlaunch: line 380: syntax error near unexpected token `)'
/home/scripts/xlaunch: line 380: `    *)  '
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Mon Feb 05, 2007 11:18 pm    Post subject: Reply with quote

Code:
    mplayer-bin)
        Xserverargs="-config xorg.conf1 $Xserverargs"
        echo "Starting ${FULL_PROG_NAME} on DISPLAY $DISPLAY_TO_USE"
        xinit "${FULL_PROG_NAME}" $* -- $Xserver :$DISPLAY_TO_USE $Xserverargs &>/dev/null &

you forgot the ;;
I don't know how you start X on the tv, but if using xorg.conf1 is enough, then this should work now, otherwise, just post your script "starttv"" so that I can see:)

BTW, when you'll get this working you can still add vlc and others like that:
Code:
mplayer-bin|vlc|others)

_________________
The End of the Internet!
Back to top
View user's profile Send private message
KevinLarson
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 126
Location: Chaimpaign, IL

PostPosted: Tue Feb 06, 2007 12:17 am    Post subject: Reply with quote

Thanks!
Back to top
View user's profile Send private message
KevinLarson
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 126
Location: Chaimpaign, IL

PostPosted: Wed Feb 07, 2007 1:15 am    Post subject: Reply with quote

It suddenly stopped working. Added xine, vlc, more, then it stopped working. I deleted the stuff and then recreated just the mplayer-bin one, but it still wouldn't work.
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Wed Feb 07, 2007 7:29 am    Post subject: Reply with quote

we would need more info :/

do you have any error?
You could put some "echo" here and there to see where it fails.
it it is the 'xinit' line which fail, you can remove &> /dev/null at the end of the line
Code:
xinit "${FULL_PROG_NAME}" $* -- $Xserver :$DISPLAY_TO_USE $Xserverargs &>/dev/null &

=>
Code:
xinit "${FULL_PROG_NAME}" $* -- $Xserver :$DISPLAY_TO_USE $Xserverargs &


Hope that helps :?

PS: you could also download the script again, just in case you modify the script where it should be
_________________
The End of the Internet!
Back to top
View user's profile Send private message
KevinLarson
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 126
Location: Chaimpaign, IL

PostPosted: Wed Feb 07, 2007 10:52 pm    Post subject: Reply with quote

Sorry, I forgot to put the output (durr).
Code:
kevin@localhost /mnt/mstorage/Movies/Death To Smoochy [Eng][XviD][2002] $ xlaunch mplayer-bin Death\ To\ Smoochy\ \[Eng\]\[XviD\]\[2002\].avi -fs
Starting /usr/bin/mplayer-bin on DISPLAY 1
xrdb:  "XTerm*boldMode" on line 19 overrides entry on line 3


Ok, meanwhile the nvidia logo displays on my tv then I see the pointer (the standard x, not my e17 one) for a half second to a second, then it turns off and I'm back to the x session I ran xlaunch from.
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Wed Feb 07, 2007 11:08 pm    Post subject: Reply with quote

you probably have several of these files:
Code:
Xresources="$HOME/.Xresources $HOME/.Xdefaults $xinitdir/Xresources $xinitdir/Xdefault"

and an error/conflict between them.

try to fix them.

If you need specific ressource for your TV, (or nothing at all) remember you can redefine the Xresources variable in the loop where you added the mplayer case.
(as you probably don't need xterm on your TV, then 'empty-ing' this variable in the loop can be a good idea.)
_________________
The End of the Internet!
Back to top
View user's profile Send private message
KevinLarson
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 126
Location: Chaimpaign, IL

PostPosted: Thu Feb 08, 2007 1:42 am    Post subject: Reply with quote

I'm not sure how to fix them. I'm not familiar with x resources, so I don't know what I do/don't need for my tv. If it isn't related to watching media, I really don't need it for my tv. I would imagine I could empty the variable, but I'm not to sure how I would do that.

Xresources=null or 0?
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Thu Feb 08, 2007 9:53 am    Post subject: Reply with quote

in the case loop :
Code:
Xresources=""

should be enough
_________________
The End of the Internet!
Back to top
View user's profile Send private message
KevinLarson
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 126
Location: Chaimpaign, IL

PostPosted: Thu Feb 08, 2007 6:48 pm    Post subject: Reply with quote

I tried:

Code:
    mplayer-bin)
        Xserverargs="-config xorg.conf1 $Xserverargs"
        Xresources=""
        echo "Starting ${FULL_PROG_NAME} on DISPLAY $DISPLAY_TO_USE"
        xinit "${FULL_PROG_NAME}" $* -- $Xserver :$DISPLAY_TO_USE $Xserverargs &>/dev/null &
        ;;


And got the same behavior.
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Thu Feb 08, 2007 6:59 pm    Post subject: Reply with quote

then add an "echo something" in the mplayer-bin case just to be sure it really is executing these commands.
_________________
The End of the Internet!
Back to top
View user's profile Send private message
KevinLarson
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 126
Location: Chaimpaign, IL

PostPosted: Fri Feb 09, 2007 2:21 am    Post subject: Reply with quote

This code:

Code:
    mplayer-bin)
        Xserverargs="-config xorg.conf1 $Xserverargs"
        Xresources=""
        echo "Starting ${FULL_PROG_NAME} on DISPLAY $DISPLAY_TO_USE"
        xinit "${FULL_PROG_NAME}" $* -- $Xserver :$DISPLAY_TO_USE $Xserverargs $
        echo "Worked"
        ;;


kevin@localhost ~ $ xlaunch mplayer-bin Death\ To\ Smoochy\ \[Eng\]\[XviD\]\[2002\].avi -fs
Starting /usr/bin/mplayer-bin on DISPLAY 1
Worked
kevin@localhost ~ $
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Fri Feb 09, 2007 7:14 am    Post subject: Reply with quote

and you still have the xrdb problem? I'm afraid I have no other idea, :/ sorry
_________________
The End of the Internet!
Back to top
View user's profile Send private message
KevinLarson
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 126
Location: Chaimpaign, IL

PostPosted: Fri Feb 09, 2007 7:27 am    Post subject: Reply with quote

No, I dont have the xrdb problem. It just displays the nvidia logo then exits... No errors displayed or anything. Is there some sort of log I could look at?
Back to top
View user's profile Send private message
KevinLarson
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 126
Location: Chaimpaign, IL

PostPosted: Fri Feb 09, 2007 7:30 am    Post subject: Reply with quote

Also: heres my var/log for my xorg.1
Code:
kevin@localhost ~ $ cat /var/log/Xorg.1.log | grep WW
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(WW) The directory "/usr/share/fonts/OTF" does not exist.
(WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
(WW) NVIDIA(0): Bad V_BIOS checksum
(WW) Option "Protocol" requires an string value
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Fri Feb 09, 2007 8:31 am    Post subject: Reply with quote

xorg.1.log is the only log we have, (if it's running on the DISPLAY :1

instead of looking for warning (WW) you should look for error (EE)

also, one thing you can try, is to run something else ( eg without the -fs option, or even something completly different, like xlaunch firefox or something ( don't dorget to add the name in the mlayer-bin|case) )

I will try tonight to run something like xlaunch mplayer movie.mpg -fs just in case the problem was with xlaunch/mplayer, I'll let you know.
_________________
The End of the Internet!
Back to top
View user's profile Send private message
KevinLarson
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2005
Posts: 126
Location: Chaimpaign, IL

PostPosted: Sat Feb 10, 2007 3:34 am    Post subject: Reply with quote

I just found something when I tried looked at the /var/log/Xorg. The last line is FreeFontPath: FPE "/usr/share/fonts/misc/" refcount is 2, should be 1; fixing. Is there any chance this could be what is causing it to fail?
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Sat Feb 10, 2007 8:27 am    Post subject: Reply with quote

well, the problem is probably with xlaunch, I can start a movie, but I cannot start a mo\ vie, (nor a "mo vie" ), I'll look into this ASAP

EDIT: Now I remember, I used $* instead of "$@" because of the XPLAYER feature/option, but you don't need it, so, ni the case loop, change this
Code:
xinit "${FULL_PROG_NAME}" $* -- $Xserver :$DISPLAY_TO_USE $Xserverargs &>/dev/null &

to this:
xinit "${FULL_PROG_NAME}" "$@" -- $Xserver :$DISPLAY_TO_USE $Xserverargs &>/dev/null &

and it should work (better)

problem fixed in new version of xlaunch :)
_________________
The End of the Internet!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments 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