Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am going to run a sort of "game", where I will have to use visual aids, which I would like to project on a wall or something from my PC S-VIDEO out.
It would be great, for example, if I could run MPlayer (or any other video player, for that matter) such as the control GUI shows up on my primary (LCD) monitor and the video window shows up on the secondary (S-VIDEO) exit, so that the people will not see me shuffling through the files and things like that.
I was wondering if this is possible with Linux (I use Ubuntu) using more than one X Server.
The steps I broke the problem into are:
1) - Is it possible to run 2 X Servers so that they are completely unrelated (not just clones one of the other like you usually see in windows) and with different settings / resolutions?
2) - If point 1 is possible, can I configure MPlayer to have the GUI in one server and the video output in the other?
3) - If point 2 is not possible, can I et least launch an application FROM server 1 (by double clicking or command line, I don't care) so that it starts up ON server 2?
I was thinking of the third point as a sort of fall back, beacuse I am almost sure it can be done (though in my newbieness I don't remember HOW), and I think it would suffice for me to CTRL-C the player I launched from the main monitor to quit the output to the second monitor.
4) - alternatively, can I have TWO mice connected to my PC, in order to operate the first desktop with mouse 1 (and launch the applications ON the second sesktop, like in point 3 above) and use mouse 2 on the second desktop simply to pause / start / close the video player?
Thank you very much. I'm sorry for posting so much question, but since they are all related to the same problem I thought it was better to have them all together instead than scattered in many posts.
Plus, I'll eagerly wait for hints and suggestions to solve my problem, which I hope to have explained fully, in alternative ways.
The third method looks to be the best at a quick glance but don't take my word for it
Let me know how you get on I may consider doing something similar myself. It would be REALLY nice if you ran mythTV (in conjuction with a tv card ofcourse) on the second display, so you'd have a full blown PC and a full blown PVR on one box working independently.
Last edited by generic_genus; 01-10-2006 at 08:53 AM.
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282
Rep:
Certain points sound promising, others less so. Specifically, you can *definitely* have more than one pointing device (and graphics card, monitor etc) which you tie together in the "Section" part of an XF86Config/xorg.conf. If you can carry out all the other steps, attaching mouse 1 to display 1 and mouse 2 to display 2 should be simple.
I'm not sure if you can run two X servers at once on the same box; my feeling is that you can't, but you may be able to connect two different display to the same server (while keeping them distinct). I did a quick Google and found some promising hints but nothing concrete.
The main stumbling block though, and the point you'll probably want to address first, is whether you'll be able to redirect the output of a media player to a different display. Of course, this depends on some extent on the architecture of how multiple distinct screens would work under X, but if it's not directly supported in the application you'd basically have to patch the source code. If there's an option in the graphics output that looks something like localhost:0, you can probably change this to localhost:1 if you have a second display running on the same X server, which would be great. If it's possible to have two X servers running, you could probably still connect to the other screen though there might be more jiggery-pokery involved. (Hmm, on second thoughts a separate display will be a separate display no matter where it's hosted).
So if there's specific display support in your media player, then I think there's a high chance of this work. IIRC I don't recall seeing this in MPlayer or VLC's options. However, I'd be very surprised if there isn't *some* player that allows you to do this - and once you've got the means to redirect output, we can consider setting up somewhere to direct this output to.
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282
Rep:
In order to look into the screens part of the job, it'd be useful to know what version of X you're running (especially whether it's XFree86 or X.org). Of course, if one supports this idea and the other doesn't it's not too much trouble to switch.
In order to look into the screens part of the job, it'd be useful to know what version of X you're running (especially whether it's XFree86 or X.org). Of course, if one supports this idea and the other doesn't it's not too much trouble to switch.
I'm using the latest Ubuntu, so I'm quite sure it's X.org (I think it's 6.8, but I'll have to check to be sure)
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282
Rep:
To add (unfortunately) another stumbling block, it seems that you must have one mouse, one keyboard and one graphics card-monitor combo per display. Presumably the last part isn't a problem, and with USB mice the mouse part shouldn't be an issue. However, attaching two keyboards to a computer at once might prove more tricky - there are of course USB and Bluetooth keyboards, but they're not that widespread. It seems you'll have to have one (unless there's some simpler way I've missed) for your "public" display, even if you don't intend to use it.
Certain points sound promising, others less so. Specifically, you can *definitely* have more than one pointing device (and graphics card, monitor etc) which you tie together in the "Section" part of an XF86Config/xorg.conf. If you can carry out all the other steps, attaching mouse 1 to display 1 and mouse 2 to display 2 should be simple.
This would still be a step forward.
Is I told, it would not be the optimum, because, for the nature of the game, I'd like to keep the two servers as separated as possible, so that the players don't see which files I'm going to play and things like that.
Quote:
Originally Posted by Dtsazza
I'm not sure if you can run two X servers at once on the same box; my feeling is that you can't, but you may be able to connect two different display to the same server (while keeping them distinct). I did a quick Google and found some promising hints but nothing concrete.
I was quite sure you could do that. After all, a VNC server actually opens up a modified X server where the output is sent through the net to the client (or at least that's what I've been told once).
Quote:
Originally Posted by Dtsazza
The main stumbling block though, and the point you'll probably want to address first, is whether you'll be able to redirect the output of a media player to a different display. Of course, this depends on some extent on the architecture of how multiple distinct screens would work under X, but if it's not directly supported in the application you'd basically have to patch the source code. If there's an option in the graphics output that looks something like localhost:0, you can probably change this to localhost:1 if you have a second display running on the same X server, which would be great. If it's possible to have two X servers running, you could probably still connect to the other screen though there might be more jiggery-pokery involved. (Hmm, on second thoughts a separate display will be a separate display no matter where it's hosted).
Yes, this would be in facts the best option, and I'm looking around for more information about XINE, MPlayer and other media players. Still, as you correctly state, the capability of "splitting" GUI and output must be a feature of the application, but if I'm not able to run the 2 servers at once on my box it won't be of any help, so I think the primary point is still to answer to this question.
Quote:
Originally Posted by Dtsazza
So if there's specific display support in your media player, then I think there's a high chance of this work. IIRC I don't recall seeing this in MPlayer or VLC's options. However, I'd be very surprised if there isn't *some* player that allows you to do this - and once you've got the means to redirect output, we can consider setting up somewhere to direct this output to.
I'm sure there's a way of directing an application's graphic output to a remote server (I read something once, but I don't remember, I think it had to do with an environment variable called DISPLAY or something like that... bad memory...).
Problem is:
1) I don'r remember HOW
2) "remote" in this case means another server ON the same machine (since that's the only one I got)
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282
Rep:
Quote:
Originally Posted by Tarrasque
Quote:
Originally Posted by Dtsazza
I'm not sure if you can run two X servers at once on the same box
I was quite sure you could do that.
Yes, it turns out that it's quite possible. I must have been getting mixed up with something else, probably all the terminology around screens and displays and servers etc...
man xinit gives some promising examples - for example, you can run xinit "as normal" to set up your main display, then pass it the arguments "-- /path/to/X/Server :1" to start another X server on display 1. As written there it'd probably fail as it'd try to use the default device (monitor-gfx card pairing) which would be in use. I think you'd have write a second XF86Config/xorg.conf for the "public" display, and pass it into the server via a "-config ~/my_second_xorg.conf" parameter (at least for X.org).
So if you have the resources to run both displays, you can set up two config files, and by swapping them on the go you can test that each display works individually. Then it's just a case of getting both servers running at once - as long as they're using distinct resources this shouldn't be a problem (but I somehow have misgivings about starting an X server from within X - it should be OK but we might need a shell script to spawn both servers at the same time).
It seems that finding the right media player is the only part left!
man xinit gives some promising examples - for example, you can run xinit "as normal" to set up your main display, then pass it the arguments "-- /path/to/X/Server :1" to start another X server on display 1. As written there it'd probably fail as it'd try to use the default device (monitor-gfx card pairing) which would be in use. I think you'd have write a second XF86Config/xorg.conf for the "public" display, and pass it into the server via a "-config ~/my_second_xorg.conf" parameter (at least for X.org).
I'm pretty sure you can just use one xorg.conf but give it multiple server layouts and then run X using a different layout.
Well this looks interested, i should try again and see if i can get a second card to work this way. I was attempting to use xinerama with a radeon card and a mach64 in the same server layout, but you can't do that with a radeon, altough this would work . Was thinking about doing that a while ago, but if i can steal ideas from this thread it'd be great .
This can be done, it only requires some fiddling with your xorg.conf. You did not say what hardware you are using, so I am not sure you display card can do the same.
I am using X.org 6.8.2, an old (cheap) nvidia GeForce MX 4000 and nvidia drivers. My setup is as follow:
Screen 0.0: My lcd display that I mainly use
Screen 0.1: TV output for movies, pictures etc
Both use the same mouse and keyboard (I just love my Logitech cordless desktop!), and I can use both simultaneosly. They also have completely different setup regarding to resolution and refresh rates etc, but DPMS (power save) settings are the same for both. I can NOT drag a window from one screen to the other, but the mouse moves between them. I can open programs in both windows. I even get 3D hardware acceleration (GLX) on the TV screen!
I am not using an GUI for my movies, so I can't help you on that one, but using command line the command
Code:
DISPLAY=:0.1 mplayer -fs my_movie.avi
starts the movie in fullscreen mode in my TV.
I have the normal input device sections, monitor sections for both the TV and my LCD, and two device sections for the display card. The important line is BusID, and it is also good to specify which screen is which. Then I of course need to specify the screen resolutions and color depths for each screen, and in the ServerLayout I specify both screens and their positioning.
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282
Rep:
Ah, of course, I did think there was some way to specify multiple displays in a config file then have the server select one at runtime, but couldn't find the syntax for the "-screen" option.
Thanks, Razze, that's more or less it. You could try using the above command, Tarrasque, but changing 'mplayer' into 'gmplayer', though that might end up putting the GUI on the second screen as well. Another option may be to specify options to the output driver you use (with "-vo ..." or in preferences"), which hopefully will only affect playback.
I'm not sure if you can run two X servers at once on the same box; my feeling is that you can't, but you may be able to connect two different display to the same server (while keeping them distinct). I did a quick Google and found some promising hints but nothing concrete.
Yes you can. Lookup the usage of the command "startx" there should be a flag for display number.
IIRC it's something like:
$ startx -- :1 vt8
That should run X in virtual terminal 8. You can switch back and fourth between ther first and second X by pressing CTL ALT F7 and CTL ALT F8.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.