You are not logged in.

#1 2014-01-11 00:33:51

kayrune
Member
Registered: 2007-12-15
Posts: 43

Running 2 X servers/sessions at the same

I'm trying to run 2 X sessions/servers at the same time on intel haswell gfx. I have 2 ouput HDMI1 and HDMI2, one for my desktop the other for my PJ.
My goal is to have a destop enviroment on HDMI1 and XBMC fullscreen wihtout a window manager on HDMI2. This seems to be possible at least on nvidia hardware, but I'm on intel.

Anyone have hints as to how this works.

When I start X it will show the same on both HDMI1/2, my efforts with xorg.conf is as follows, but current status is it will turn off hdmi1 and display X on hdmi2, what am I missing ?

Section "ServerLayout"
    Identifier   "Desktop"
    Screen       0 "Primary" Absolute 0 0
   Screen       1 "prosjektor" Absolute 0 0
EndSection

Section "Monitor"
    Identifier             "HDMI1"
EndSection

Section "Monitor"
    Identifier             "HDMI2"
EndSection


Section "Device"
    Identifier             "HDMI1"
    Driver                 "intel" #Choose the driver used for this monitor
    BusID "PCI:0:2:0"
    Screen 0
#    Option "monitor-HDMI1" "Monitor0"
EndSection

Section "Device"
    Identifier             "HDMI2"
    Driver                 "intel" #Choose the driver used for this monitor
    BusID "PCI:0:2:0"
    Screen 1
EndSection

Section "Screen"
    Identifier             "Primary"  #Collapse Monitor and Device section to Screen section
    Device                 "HDMI1"
    Monitor                "HDMI1"
EndSection


Section "Screen"
    Identifier             "prosjektor"  #Collapse Monitor and Device section to Screen section
    Device                 "HDMI2"
    Monitor                "HDMI2"
EndSection

Please help.

Offline

#2 2014-01-11 02:25:01

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: Running 2 X servers/sessions at the same

So, actually you want one X server with two separate screens.

I don't know wether your GPU supports this...

I'm only guessing but did you try another position method in the ServerLayout e.g. something like:

Screen       1 "prosjektor" RightOf "Primary"

Unlikely to be the problem but I would use unique names for the Screens/Monitors.


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

#3 2014-01-11 02:40:44

kayrune
Member
Registered: 2007-12-15
Posts: 43

Re: Running 2 X servers/sessions at the same

Thank you for your suggestions.

I'm not exactly sure what the technical correct setup is, what I do know is I want to run my desktop and xbmc seperate from each other on different hdmi ports, so I can use whatever window manager I want on my desktop and run xbmc without a window manager. I assume this would indicate 2 X servers, but not quite sure.

The RightOf is not what I'm looking for, this would indicate that they are "connected" as in one and not possible to run xbmc fullscreen without a window manager.

I also started out with unique names for screens and monitors, it made no difference.

Offline

#4 2014-01-11 02:42:31

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Running 2 X servers/sessions at the same

Have you tried using 2 xorg.conf files? Start one X from one tty and the second one from another tty.

Offline

#5 2014-01-11 03:38:16

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: Running 2 X servers/sessions at the same

Yeah, I understood you.
Well, there might be different ways to achieve this.

The RightOf is not what I'm looking for, this would indicate that they are "connected" as in one and not possible to run xbmc fullscreen without a window manager.

Yes, they would be "connected" but from X only regarding the mouse/keyboard. The i3 windowmanager for example is not able to handle different screens so it would only startup on one of them leaving the other X screen blank. (At least I remember reading, from the i3 dev, that if one would want to use different screens with i3 one would have to explicitly start two i3 instances.) So you could start whatever you want there. awesome seems to be one that is able to handle different screens though I don't know how to configure/setup. As for DE's I can't tell but I don't think they handle this well either. (Meaning chances are that they would leave the other screen blank, you would have to test...)

So, when using different screens I believe they are "connected" anyways. There's no way you could switch to control the two separate screens otherwise. (Exept for multi-seat/zaphod mode but I don't think that's what you want.) How do you plan to control/switch them ?

The problem that I thought of is that you position both screens absolute 0 0. So if that position is really absolute then they would lay above each other.

@karol,all: Would be nice to see if it's possible. big_smile Then you could switch by the tty's. The only problem could be that it turn's on only one screen at a time then.

Last edited by rebootl (2014-01-11 13:59:13)


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

#6 2014-01-11 04:25:13

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Running 2 X servers/sessions at the same

I can't test it, but it may be possible: https://wiki.archlinux.org/index.php/Mu … te_screens but I'm not sure if this is possible with the Intel card.

Offline

#7 2014-01-11 15:04:01

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: Running 2 X servers/sessions at the same

Yeah, what I meant was to see whether it's possible to use your suggestion of two separate configs and two servers (on two monitors, with one card). I'm only picking this up again cause the link you gave actually refers to two (X) screens, which is not the same. Two separate screens are established in one config as the one the OP has posted in his first post.

As it's described in your wikilink: With two servers you would identify them as usual with :0, :1 whereas with two screens you get :0.0 and :0.1. The mouse can move between two screens but cannot between two servers.

Furthermore it's even possible two get two completely independent sessions using one config file. This would then be multi-seat. See: https://wiki.archlinux.org/index.php/Xorg_multiseat. (Basically it's using two Serverlayout sections, identifying with the -layout switch.) A useful application of this, in the present case, could be to use the default keyboard/mouse for the windowmanager and a separate mouse for the XBMC. Therefor my question of how the OP wishes to control (I don't know much about XBMC, it's control, possibly even by remote control wink?)

Yes, the question remains what is possible with the intel card.

Edit: To the OP: I suspect that your posted config is not so far away from what you actually want. Therefor I would encourage you to continue trying (e.g. with RightOf). If you really can't get it to work this might indicate that your card doesn't support it. But even then it doesn't mean that it's impossible to reach your desired config. Things may become a bit clumsy but if you can manage to get a normal dual screen (randr) you could use Xnest to span a separate X(nest) server on each monitor.

Last edited by rebootl (2014-01-11 17:09:38)


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

#8 2014-01-11 17:27:03

kayrune
Member
Registered: 2007-12-15
Posts: 43

Re: Running 2 X servers/sessions at the same

Hi all, thanks for following up on this.

I actually tried adjusting serverlayout as you mentioned, but it didn't change anything. I've also tried the RightOf but it didn't help me.

"ServerLayout"
    Identifier   "Desktop"
    Screen       0 "Primary" Absolute 0 0
   Screen       1 "prosjektor" Absolute 1920 0
EndSection

This way along with the other settings in OP result in monitor turning off and pj showing desktop, If I make 2 serverlayout configs I'm back to the same output on both monitor and pj.

When I was testing it was a clean X with only twm. Right now I've installed gnome, I've experienced with gnome and xfce they both detect and setup the "RightOf" option by default on intel hardware. There is a option to chose mirror or turn off also.

As I understand now it would seem impossible if not unfeasible to run 2 different X sessions. The idea is to run 2 screens (in xorg terms) where the DE only would use screen 0, and xbmc run fullscreen on screen 1. So DE on 0.0 and xbmc on 0.1 (controlled via remote)

This is done here http://forum.xbmc.org/showthread.php?ti … pid1586849 with nvidia hardware. I've tried to adopt this xorg.conf to my intel hardware but results have been unsuccessful. The only thing I don't know how to translate to intel is

Option         "nvidiaXineramaInfoOrder" "DFP-0"
Option         "metamodes" "DFP-0: nvidia-auto-select +0+0"

I will try turning off display 2 in gnome now and test more with xorg to try to get 2 screens, but I fear turning it off works on driver lvl with intel, and not just "turning off" gnome on display 2.

EDIT. Karol, running 2 X sessions from different VT works fine, but when you change it takes control of both HDMI1 and HDMI2. My research now indicate it's not possible to do this with a single card, if you have 2 gfx card it wold work.

EDIT2. Gnome/intel does not use the display 0.0 and 0.1 schema by default so I guess it handles multiple monitors in a different way.

Last edited by kayrune (2014-01-11 17:41:10)

Offline

#9 2014-01-11 18:18:58

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: Running 2 X servers/sessions at the same

kayrune wrote:

I will try turning off display 2 in gnome now and test more with xorg to try to get 2 screens, but I fear turning it off works on driver lvl with intel, and not just "turning off" gnome on display 2.
... [snip] ...
EDIT2. Gnome/intel does not use the display 0.0 and 0.1 schema by default so I guess it handles multiple monitors in a different way.

Ok, I would guess that Gnome/xfce uses Randr then, look here: https://wiki.archlinux.org/index.php/multihead#RandR


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

#10 2014-01-11 19:29:38

kayrune
Member
Registered: 2007-12-15
Posts: 43

Re: Running 2 X servers/sessions at the same

I've come a little further. My problem is it seems everyone is trying to do the opposite of what I'm trying, to get 2 outputs to act as 1 desktop.

I've found that to be able to use 2 different screens on once device it seems you need the  "zaphodheads" option. So I've updated my xorg with this option and that did bring me one step further. First off it works extremely poor, the screen only updates on input ! So unless I move my mouse or type on the keyboard the scree does not update. Second I havn't even gotten it to work correct, It now shows gnome on HDMI1 but HDMI2 is currently displaying the output of VT1.

Offline

#11 2014-01-11 19:55:16

kayrune
Member
Registered: 2007-12-15
Posts: 43

Re: Running 2 X servers/sessions at the same

LOL It's actually working, partly.  I see the output of VT1 on HDMI2 but I can also open programs on top of it running "DISPLAY=:0.1 xterm"  worked just fine, it popped up in the corner without a window manager. Still I have the issue though that the screen only updates on mouse and keyboard input. I tried to start xbmc on 0.1 and X and it started loading but then X just stopped responding. Either there is a bug og the intel drivers do not fully support this yet. It looks like I've come to an end.

For giggles, here is the current xorg.conf

Section "Device"
        Identifier      "Intel-hdmi1"
        Driver          "intel"
	BusID    	"PCI:0:2:0"
        Option      "AccelMethod"  "SNA"
        Option          "monitor-HDMI1" "mHDMI1"
	Option     	"ZaphodHeads" "HDMI1"
	Screen		0
EndSection

Section "Device"
        Identifier      "Intel-hdmi2"
        Driver          "intel"
	BusID    	"PCI:0:2:0"
        Option          "monitor-HDMI2" "mHDMI2"
	Option     	"ZaphodHeads" "HDMI2"
        Screen 		1
EndSection


Section "Monitor"
        Identifier      "mVGA1"
#       Option "disable"
	Option "Ignore" "True"
EndSection

Section "Monitor"
        Identifier      "mDP1"
#       Option "disable"
	Option "Ignore" "True"
EndSection

Section "Monitor"
        Identifier      "mDP2"
#       Option "disable"
	Option "Ignore" "True"
EndSection

Section "Monitor"
        Identifier      "mHDMI1"
        Option "PreferredMode" "1920x1080"
EndSection

Section "Monitor"
        Identifier      "mHDMI2"
        Option "PreferredMode" "1920x1080"
EndSection

Section "Screen"
        Identifier      "Screen0"
        Monitor         "mHDMI1"
        Device          "Intel-hdmi1"
EndSection

Section "Screen"
        Identifier      "Screen1"
        Monitor         "mHDMI2"
        Device          "Intel-hdmi2"
EndSection

Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          "Screen0" 0 0
	Screen		"Screen1" RightOf "Screen0"
EndSection

Offline

#12 2014-01-11 21:11:09

kayrune
Member
Registered: 2007-12-15
Posts: 43

Re: Running 2 X servers/sessions at the same

Ok, I think I'm putting in the final nail in the coffin now. I guess this doesn't work on intel hw.

I uninstalled gnome and tried the trusted old twm for fun, and it actually worked pretty good, it was working as intended I had a browser on HDMI1 and XBMC fullscreen on HDMI2, but it seems the reason it was working was that all was done in software, all 8 cores on the CPU was using 80-90%.

So I tried XFCE and it also worked fairly good did not have the issue of only updating screen on input, but display setting did not want to run, xbmc did not want to run.

So I headed over to ubuntu and tested this xorg.conf and in normal unity I experience the same as with gnome om arch, display only updates on input.
So I try xubuntu and again looking promising, XFCE actually seems to have some built inn support for 2 screens. However again display settings fails to open and xbmc will not run.

I think its safe to say this is not going to work, don't know if it's hardware or software related though.

EDIT
I think it's also safe to say that the issue where the screen doesn't update unless there is keyboard or mouse input is related to window managers using composition. Because I ran compton from XFCE and instantly the issue was back.

Last edited by kayrune (2014-01-11 21:20:45)

Offline

#13 2014-01-11 21:24:23

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: Running 2 X servers/sessions at the same

Hey, thanks for sharing above config.

I just tested the alternative way of using Xnest for this and it seems it could work pretty well.
Just give me a second and I'll post a little example workflow below.

However there might still be issues to overcome...
I quickly tried separate screens too and got about the same or even weirder results... So yeah I think it's.. dunno.. too old.

Edit: Example using Xnest

As for the issues:
- I tested only using i3 (which is "only" a windowmanager like e.g. twm, DE's might make it more complicated, you would need to find out how to start them appropriately)
- rendering, as you mentioned in your last post, I don't know how XBMC does this, how well this would work...
- automate, you would want to automate this somehow/ adapt/integrate into your boot process or for example by some scripting

As for the rendering you could use Xephyr instead of Xnest, basically the same but evtl. better support for new graphic features.
Packages are xorg-server-xnest or xorg-server-xephyr.

Configure your X server using Randr as described under above link.
For my laptop and an external monitor this results in /etc/X11/xorg-dual.conf:

Section "Monitor"
	Identifier	"LVDS1"
	Option		"Primary" "true"
Endsection

Section "Monitor"
	Identifier	"VGA1"
	Option		"RightOf" "LVDS1"
Endsection

Start an X server using the above config:

X -config xorg-dual.conf :1 vt05 &

# you would want to elaborate this command as it's not recommended to start X directly
# (I don't know why, I find it works a lot simpler/better than using xinit or then startx or whatever, at least for testing)

# you should have an X server on both your monitors now (though you might cannot see anything)
# now start two Xnest instances
Xnest :2 -display :1 -geometry 1366x768+0+0 &
Xnest :3 -display :1 -geometry 1920x1080+1366+0 &

# now you can start your windowmanager on display :2 for example
DISPLAY=:2 i3 &

# and whatever you wish on display :3
DISPLAY=:3 xterm &

It seems you have to switch to vt05 to activate both monitors.
The mouse can move between them but the X displays are completely independent.

Edit2:
To below post: To do a very quick test just fire up Xnest or Xephyr and try to run XBMC inside them.

Xnest :1 &
DISPLAY=:1 xbmc & # respectively the appropriate command for xbmc

Cheers

Edit: Seems not to work... Xephyr doesn't provide the needed acceleration for xbmc.
It's not only the intel hardware, more and more I get to the conclusion that X in general is too old for such fun.

Last edited by rebootl (2014-01-11 23:53:49)


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

#14 2014-01-11 21:43:50

kayrune
Member
Registered: 2007-12-15
Posts: 43

Re: Running 2 X servers/sessions at the same

I think the biggest issue is the way xbmc works at a hw level. It needs to connect "directly" with sound and graphics cards I think, low latency is key. I don't see how it would work with Xnest. But thanks for your efforts!

Offline

Board footer

Powered by FluxBB