Getting a true dual head system working (1)

Okay, I've been at it for about four hours now. I thought, time to report my doings and see if I can get this to work tomorrow.

First, what I'm trying to do. I've got a setup in which I want to have two users working on a single machine. That means two monitors, two keyboards, two mice and one computer. I actually have done this before, in a very distant past (somewhere in 2000-2001 I think) and I remember spending a lot of time on it. Alas, I didn't write anything down at the time, so I'm starting all anew here.

The distro I'm running is Mandriva Linux 2005LE. I actually don't think the distro should be a real problem here. I'm not setting this up using two video cards, but with one dual head Matrox G450 (the link is to the Matrox Millenium G450, which I do not have, but I can't seem to find a link to the normal G450). Next to this I'm using two LCDisplays (nice 17" ones, never be cheap about LCD), a PS/2 keyboard and mouse and a USB keyboard and mouse. The mice are all Logitech optical thingies and work seperately great. The PS/2 keyboard is an oldy, but works quite well, as far as I know. The USB keyboard is a brand new Logitech thingy, which I'm using to type this text. So nothing fancy, really.

Well, all information while looking for "x.org true dual head" or anything that looks like that, I can't really find anything useful. The most useful stuff was on Miguel Freitas' page Multiple local XFree users under Linux, which details the problems I'm having quite nicely. The thing is, I can only find solutions in which I need to patch the kernel, which I don't think is an actual solution but more a hack. Also, most of these pages describe XFree86, while I'm using X.org Xserver.

I used to think that both heads couldn't work independent, but that's really not the case. The default setup Mandriva gives me is a dual head setup with two desktops, on each monitor another. They are configured completely independent of each other and I can switch from one to the other by moving my mouse pointer off the screen towards the other screen. Like Xinerama would fix it. But that's just not what I want.

Although it's quite easy to talk to the heads indepently, the seem to be connect in one way or another. I'll print the full xorg.conf file on the bottom of this post. That's the way I've at least got a working setup, in which I can type this text, but it's not dual head. The two heads just show exactly the same information. Definitly not what I want.

Another problem seems to be the input devices. Although multiple mice works fine, multiple keyboards is still a drag. Even with a new kernel (Mandriva packs the 2.6.11, which is quite recent at the time of this writing, with the latest stable being 2.6.11.10), there seem to be several devices that handle the keyboards and they all seem to work differently. The fact is made even more obscure with there only being two keyboard drivers with X.org, being "keyboard" and "kbd" (at least, I cannot find any other drivers that look like they could do keyboard-stuff). When I put a Device option into the InputDevice for my keyboard part of my xorg.conf, pointing towards /dev/input/event0 (the device reported in /proc/bus/input/devices for the PS/2 keyboard), all seems to load well. But when I enter text in the KDM login screen, I'm getting multiple, different characters in a randomish fashion. When I leave the driver out (the default setup), pressing a button on either keyboard will get registered and handled. Again, not what I want.

Something I learned from the sites I read is that I'll probably need to be running two X-servers, which sounds logical. If I can create several layouts I can simply start X with a "-layout layoutname" option. That way I can start those servers. I could add those lines to /etc/rc.local to have them start at startup (let's not forget to remove /etc/init.d/dm from startup, the default Mandriva script for starting up the display manager).

All in all, I'm not making any progress tonight and I'm too tired now to look further. Tomorrow, if time permits, I'll look further. If I can't find anything decent then, I'll go recompile a kernel with the ruby-kernel-patch from Linux Console Project. Maybe that will work.

Below my latest xorg.conf:

(For some unknown reason, the <pre>-tag seems to escape each ", transforming those to ". Sorry about that. If you know how to fix this, while still keeping the layout intact, let me know.)

Section "Files"
    # Multiple FontPath entries are allowed (they are concatenated together)
    # By default, Mandrake 6.0 and later now use a font server independent of
    # the X server to render fonts.
    FontPath "unix/:-1"
EndSection

Section "ServerFlags" #DontZap # disable <Crtl><Alt><BS> (server abort) AllowMouseOpenFail # allows the server to start up even if the mouse does not work #DontZoom # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching) EndSection

Section "Module" Load "dbe" # Double-Buffering Extension Load "v4l" # Video for Linux Load "extmod" Load "type1" Load "freetype" Load "glx" # 3D layer Load "dri" # direct rendering Load "/usr/X11R6/lib/modules/extensions/libglx.a" EndSection

Section "InputDevice" Identifier "Keyboard0" Driver "keyboard" #Option "Device" "/dev/input/event3" Option "XkbModel" "logiinkseusb" Option "XkbLayout" "en_US" Option "XkbOptions" "compose:rwin" EndSection

Section "InputDevice" Identifier "Keyboard1" Driver "keyboard" #Option "Device" "/dev/input/event0" Option "XkbModel" "pc105" Option "XkbLayout" "en_US" Option "XkbOptions" "compose:rwin" EndSection

Section "InputDevice" Identifier "Mouse0" Driver "mouse" Option "Protocol" "ExplorerPS/2" Option "Device" "/dev/mouse" Option "ZAxisMapping" "6 7" EndSection

Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "IMPS/2" Option "Device" "/dev/input/mouse1" Option "ZAxisMapping" "6 7" EndSection

Section "Monitor" Identifier "monitor1" VendorName "Plug'n Play" ModelName "Belinea 101710" HorizSync 31-83 VertRefresh 56-75

# Monitor preferred modeline (60.0 Hz vsync, 64.0 kHz hsync, ratio 5/4)
ModeLine "1280x1024" 108 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync

# TV fullscreen mode or DVD fullscreen output.
# 768x576 @ 79 Hz, 50 kHz hsync
ModeLine "768x576"     50.00  768  832  846 1000   576  590  595  630

# 768x576 @ 100 Hz, 61.6 kHz hsync
ModeLine "768x576"     63.07  768  800  960 1024   576  578  590  616

EndSection

Section "Monitor" Identifier "monitor2" VendorName "Plug'n Play" HorizSync 31-80 VertRefresh 56-75

# TV fullscreen mode or DVD fullscreen output.
# 768x576 @ 79 Hz, 50 kHz hsync
ModeLine "768x576"     50.00  768  832  846 1000   576  590  595  630

# 768x576 @ 100 Hz, 61.6 kHz hsync
ModeLine "768x576"     63.07  768  800  960 1024   576  578  590  616

EndSection

Section "Device" Identifier "device1" VendorName "Matrox" BoardName "Matrox Millennium G450 DualHead" Driver "mga" VideoRam 8192 Screen 0 BusID "PCI:1:0:0" Option "DPMS" EndSection

Section "Device" Identifier "device2" VendorName "Matrox" BoardName "Matrox Millennium G450 DualHead" Driver "mga" Screen 1 BusID "PCI:1:0:0" Option "DPMS" EndSection

Section "Screen" Identifier "screen1" Device "device1" Monitor "monitor1" DefaultColorDepth 24

Subsection "Display"
    Depth 8
    Virtual 1280 1024
EndSubsection

Subsection "Display"
    Depth 15
    Virtual 1280 1024
EndSubsection

Subsection "Display"
    Depth 16
    Virtual 1280 1024
EndSubsection

Subsection "Display"
    Depth 24
    Virtual 1280 1024
EndSubsection

EndSection

Section "Screen" Identifier "screen2" Device "device2" Monitor "monitor2" DefaultColorDepth 24

Subsection "Display"
    Depth 8
    Virtual 1280 1024
EndSubsection

Subsection "Display"
    Depth 15
    Virtual 1280 1024
EndSubsection

Subsection "Display"
    Depth 16
    Virtual 1280 1024
EndSubsection

Subsection "Display"
    Depth 24
    Virtual 1280 1024
EndSubsection

EndSection

Section "ServerLayout" Identifier "layout1" InputDevice "Keyboard1" "CoreKeyboard" InputDevice "Mouse1" "CorePointer" Screen "screen1" EndSection

Section "ServerLayout" Identifier "layout2" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" Screen "screen2" EndSection

Comments

Comments powered by Disqus