2

I have a video card with 2 video outputs. I want to run 2 instances of xinit and draw 2 different displays. I want one display to be output to one video out and the other to go to the other video out. I'm running CentOS 6.4. I have my xorg file set up for both video outputs correctly, if I run startX I see them both configured correctly, one of them is screen 0 and the other is screen 1. However, if I run xinit -- :0.0 to output for one display, this works and displays on the primary monitor. Then I run xinit -- :1.1 for the other display. This triggers the second monitor to display correctly, but the first display then goes completely blank. Both xinit processes are still running.

xorg.conf is set up so that each monitor is on separate screens rather than one screen that goes across both. These are screen0 and screen1. Here's the xorg (I left out the keyboard/mouse sections):

Section "ServerLayout"
  Identifier      "Layout0"
  Screen        0 "Screen0" 0 0
  Screen        1 "Screen1" 0 0
  InputDevice     "Keyboard0" "CoreKeyboard"
  InputDevice     "Mouse0" "CoreMouse"
  Option          "Xinerama" "0"
EndSection

Section "Monitor"
  Identifier      "Monitor0"
  VendorName      "Unknown"
  ModelName       "Unknown"
  HorizSync       31.5 - 98.7
  VertRefresh     50.0 - 85.0
  Option         "DPMS"
  ModeLine       "1440x900" 106.5 1440 1520 1672 1904 900 903 909 932 -hsync +vsync
EndSection

Section "Monitor"
  Identifier      "Monitor1"
  VendorName      "Unknown"
  ModelName       "Unknown"
  HorizSync       31.5 - 98.7
  VertRefresh     50.0 - 85.0
  Option         "DPMS"
  ModeLine       "1440x900" 106.5 1440 1520 1672 1904 900 903 909 932 -hsync +vsync
EndSection

Section "Device"
  Identifier      "Device0"
  Driver          "nvidia"
  VendorName      "NVIDIA Corporation"
  BoardName       "GeForce GTX 480"
  Screen          0
  Option          "UseEDID" "false"
  Option          "UseEDIDFreqs" "false"
EndSection

Section "Device"
  Identifier      "Device1"
  Driver          "nvidia"
  VendorName      "NVIDIA Corporation"
  BoardName       "GeForce GTX 480"
  Screen          1
  Option          "UseEDID" "false"
  Option          "UseEDIDFreqs" "false"
EndSection

Section "Screen"
  Identifier      "Screen0"
  Device          "Device0"
  Monitor         "Monitor0"
  DefaultDepth    24
  Option          "Stero" "0"
  Option          "metamodes" "1440x900"
  Option          "SLI" "Off"
  Option          "MultiGPU" "Off"
  Option          "BasicMosaic" "off"
  Option          "ModeValidation" "AllowNonEdidModes"
  Subsection
    Depth         24
    Modes         "1440x900"
  EndSubsection
EndSection

Section "Screen"
  Identifier      "Screen1"
  Device          "Device1"
  Monitor         "Monitor1"
  DefaultDepth    24
  Option          "Stero" "0"
  Option          "metamodes" "1440x900"
  Option          "SLI" "Off"
  Option          "MultiGPU" "Off"
  Option          "BasicMosaic" "off"
  Option          "ModeValidation" "AllowNonEdidModes"
  Subsection
    Depth         24
    Modes         "1440x900"
  EndSubsection
EndSection

EDIT: More info. Turns out they both run but one of them is on vt07 and the other is on vt08. If I use CTRL+ALT+F7 (or F8) I can swap which monitor displays and which one is blank, but one of them is always blank. I tried to add to the commands to specify the virtual terminal: xinit -- :0.0 vt07 and xinit -- :1.1 vt07. But when I do this, the 2nd one will not start, giving an error that it cannot find any screens. Starting to wonder if this is a constraint of xinit, possibly due to both video outputs coming from a single video card.

How do I run both xinit routines at the same time?

Dtor
  • 131
  • 3
  • 1
    For all intents and purposes you have two separate displays, so try `:1.0` instead of `:0.1`. Better yet, edit `/etc/X11/xinit/xserverrc`. – lcd047 Jun 06 '15 at 17:19
  • Do I need to do :0.0 and :1.1? I'm under the impression the number after the dot specifies the screen that's defined in the xorg.conf, which I have '0' defined to go to one video output and '1' to the 2nd video output. Is that correct? – Dtor Jun 06 '15 at 17:21
  • 2
    `:0.0` is screen 0 of server 0, `:1.0` is screen 0 of server 1. They aren't related. – lcd047 Jun 06 '15 at 17:24
  • Um. You shouldn't be able to run two xinit commands without setting up [multiseat](https://wiki.archlinux.org/index.php/Xorg_multiseat#Serverlayout). Which would be unusual, so you should outline your xorg.conf for us? Most people run a single seat using a desktop (GNOME etc) that configures multi-head through xrandr. Nice thing about using xrandr is it can work without having to code up any xorg.conf. – sourcejedi Jun 06 '15 at 18:42
  • startx says it's a frontend to xinit, so if startx is doing exactly what you want, trace how it invokes xinit/X/window managers/whatever. `strace -e trace=process` and look for exec, possibly adding `-s 99` or so if the strings you need get abbreviated. startx does claim to be more friendly, but I can't see what it would do differently here (or at all, to be honest). – sourcejedi Jun 06 '15 at 18:42
  • `xinit -- :1.0` didn't quite work, that still opened on the primary video output. I started running both `xinit -- :0.0` and `xinit -- :1.1` which almost works. The first command opens up on the primary video out and the 2nd opens on the 2nd video out, which is what I wanted. Both processes stay active. Problem I have now is that when the 2nd xinit starts, the monitor from the first xinit goes blank and no longer displays anything. Why does the first xinit stop displaying? – Dtor Jun 06 '15 at 19:08
  • @sourcejedi it looks like `startx` is running `xinit :0` which opens both screens with a single `xinit`, whereas I'm trying to open `xinit` twice with a single screen each. – Dtor Jun 06 '15 at 19:16
  • Found out some additional information. When I run both `xinit` at the same time, I can switch between which monitor is working by doing CTRL+ALT+F7 and F8, but never get both working at the same time. Going to see if I can somehow put both on F7... – Dtor Jun 06 '15 at 20:40
  • 1
    That matches my expectations so far :). I think you're saying you want to configure multi-seat as per my link above. I think the assumption will be you have separate input devices as well, i.e. there won't be a built-in way to switch the input from one device (keyboard) between the 2 different "seats". – sourcejedi Jun 06 '15 at 21:31
  • @sourcejedi yep, I've been looking at the multi-seat guide you linked but not quite getting something still. I only need inputs on 1 seat, so no problem there. The 2nd seat isn't working though. In the device sections, I'm specifying `Screen 0` or `Screen 1`. I get `no screens found` for seat1, it doesn't seem to like only having `Screen 1` in the Device. I noticed your link doesn't have that screen line, how does it specify which video out to use? – Dtor Jun 06 '15 at 21:44
  • 1
    Ah, I guess it's not really possible :(. http://unix.stackexchange.com/questions/138290/multiseat-x-setup-with-a-single-dual-head-graphics-card / https://help.ubuntu.com/community/MultiseatOneCard – sourcejedi Jun 06 '15 at 22:33
  • Looks like the setup in the guide might be using the Monitor sections and EDID info. Is there a way to do it without EDID? In case I'm using the same monitor on both ports or if the monitor is disconnected when it starts? – Dtor Jun 06 '15 at 22:33
  • @sourcejedi ugh. Oh well. At least I can start working on a different solution. If you want to put your info into an answer, I'll mark it correct later. Thanks for all the help! – Dtor Jun 06 '15 at 22:42

0 Answers0