Sunday, February 15, 2009

Multiseat for Dual headed(Multiple headed) grapic (VGA) version-0.2

Here I have modified Multiseat setup for Dual-Headed graphic cards which will be now supports more seats!. Please refer earlier post for more information on how to setup

/usr/bin/duautomseat:


#!/bin/bash
# Copyright (C) 2008 Nayanajit Mahendra Laxaman mail: nmlaxaman@gmail.com

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

LOG=/tmp/duauto.log
export DISPLAY=:0
export XAUTHORITY="/var/lib/gdm/:0.Xauth"
echo $DISPLAY >> $LOG
echo $XAUTHORITY >> $LOG

PARAMS=$@
echo $PARAMS >> $LOG

keyboards=($(ls -l /dev/input/by-path/ | grep -event- | grep kbd | awk -F '../' {'print $2'}))
mouses=($(ls -l /dev/input/by-path/ | grep -event- | grep mouse | awk -F '../' {'print $2'}))

#PARAMS="dpms -switchCmd echo -2button -nozap -br $PARAMS"
PARAMS="dpms -nozap -br $PARAMS"
SESSION=$(echo $1 | sed s/':'/''/)
SESSION_1=$(expr $SESSION - 1)
SCREEN="1024x768@0+$(expr 1024 \* $SESSION_1)+0"
command="/usr/bin/Xephyr -ac :$SESSION -screen $SCREEN -keybd evdev,,device=/dev/input/${keyboards[$SESSION_1]},xkbrules=xorg,xkbmodel=evdev,xkblayout=us,CoreKeyboard -mouse evdev,,device=/dev/input/${mouses[$SESSION_1]},Emulate3Buttons=true,CorePointer $PARAMS"
echo $command >> $LOG
echo '<<>>' >> $LOG
#exec $command


Append following to /etc/gdm/Init/Default

export DISPLAY=:0
export XAUTHORITY="/var/lib/gdm/:0.Xauth"
WIDTH=1024
COUNT=$(xwininfo -root -children -display :0 | grep 'Xephyr on' | wc -l)
XEID=$(xwininfo -root -children -display :0 | grep "Xephyr on :$COUNT" --max-count=1 | awk '{print $1}')
SHIFT=$(expr $WIDTH \* $(expr $COUNT - 1))
[[ $XEID != '' ]] && wmctrl -i -r $XEID -e 0,$SHIFT,0,-1,-1

/etc/gdm/gdm.conf:


#
[servers]
0=Xephyr0
1=Xephyr1
2=Xephyr2
3=Xephyr3
.
.
.
N=XephyrN

[server-Xephyr0]
name=Xephyr0
command=/usr/bin/X -br -dpms -s 0
handled=false
flexible=false

[server-Xephyr1]
name=Xephyr1
command=/usr/bin/duautomseat
handled=true
flexible=false

[server-Xephyr2]
name=Xephyr2
command=/usr/bin/duautomseat
handled=true
flexible=false

[server-Xephyr3]
name=Xephyr3
command=/usr/bin/duautomseat
handled=true
flexible=false

.
.
.

[server-XephyrN]
name=XephyrN
command=/usr/bin/duautomseat
handled=true
flexible=false


[greeter]
#Greeter=/usr/bin/loginduautomseat
GraphicalThemes=circles/:debian-moreblue/:happygnome/:happygnome-list
GraphicalThemeRand=true
GraphicalTheme=circles

10 comments:

  1. FYI.Just before I test it, I dont see any script on xorg.conf, or xorg.conf will work without any visible changes?

    ReplyDelete
  2. Hi Laxman, I have tested but it has failed miserably, X crashed with no errors, and nothing strange in Xorg logs.
    duato.log has below

    :0
    /var/lib/gdm/:0.Xauth
    :1 -auth /var/lib/gdm/:1.Xauth -nolisten tcp vt8
    /usr/bin/Xephyr -ac :1 -screen 1024x768@0+0+0 -keybd evdev,,device=/dev/input/event0,xkbrules=xorg,xkbmodel=evdev,xkblayout=us,CoreKeyboard -mouse evdev,,devi
    ce=/dev/input/event2,Emulate3Buttons=true,CorePointer dpms -nozap -br :1 -auth /var/lib/gdm/:1.Xauth -nolisten tcp vt8
    <<>>
    :0
    /var/lib/gdm/:0.Xauth
    :1 -auth /var/lib/gdm/:1.Xauth -nolisten tcp vt8
    /usr/bin/Xephyr -ac :1 -screen 1024x768@0+0+0 -keybd evdev,,device=/dev/input/event0,xkbrules=xorg,xkbmodel=evdev,xkblayout=us,CoreKeyboard -mouse evdev,,devi
    ce=/dev/input/event2,Emulate3Buttons=true,CorePointer dpms -nozap -br :1 -auth /var/lib/gdm/:1.Xauth -nolisten tcp vt8
    <<>>
    :0
    /var/lib/gdm/:0.Xauth
    :1 -auth /var/lib/gdm/:1.Xauth -nolisten tcp vt8
    /usr/bin/Xephyr -ac :1 -screen 1024x768@0+0+0 -keybd evdev,,device=/dev/input/event0,xkbrules=xorg,xkbmodel=evdev,xkblayout=us,CoreKeyboard -mouse evdev,,devi
    ce=/dev/input/event2,Emulate3Buttons=true,CorePointer dpms -nozap -br :1 -auth /var/lib/gdm/:1.Xauth -nolisten tcp vt8
    <<>>

    ReplyDelete
  3. Changing #exec $command to exec $command in duautomseat 2 seats are now working but only in one card, i have realised all other gdm sessions are poping up on one card, i strongly think this is something to do xorg.conf since it's not been configured for multiple dual headed VGAs.Am i right?

    ReplyDelete
  4. Hi Laxman, any solution(s) to issues I informed you about? Am really looking forward to having a working dual headed multiple VGAs systems.

    ReplyDelete
  5. As I said in earlier version you have to figure it out how to configure your root X session

    For example with nvidia vga cards you may have to use both 'Twinview' and 'Xinerama' options in your xorg.conf to expand the root X session for all displays. send me your VGA and Mother-boad models then I may able to create xorg.conf for you

    ReplyDelete
  6. Thanks so much.Am testing with ATI Technologies Inc M9+ 5C63 [Radeon Mobility 9200], ATI Technologies Inc Radeon RV250 [Mobility FireGL 9000] and nVidia Corporation NV34 [GeForce FX 5500] about Mother-board I will be setting up with different models not a specific M/B. For testing purpose am using a PIV Dell Dimension 8300 Series PC.

    PS:Am not mixing ATI and nVidia cards, am testing with same type of cards at a go.

    ReplyDelete
  7. Hi Laxaman, just a matter of curiosity, is there no way you can tweak your script for single headed VGAs to work with dual headed cards.That script is perfect, works like a charm.

    ReplyDelete
  8. Laxaman,I hope you are doing OK, otherwise am still waiting for the solution(s) to multiple headed VGAs.Sorry for bothering you.

    ReplyDelete
  9. In my case motherboards available here have only one AGP or PCI-E Graphic cards I think same for you also so the solution is using PCI Graphic cards but here It is very hard to find PCI Graphic cards also. Therefore I didn't had opportunity to test script version-0.2. Now I found another Dual-head PCI Graphic card and I tested the setup for 4 seats with two Dual-head PCI Graphic cards. Following that procedure it is possible to extend for more cards. But I can not guarantee without testing for more cards. Ill release that setup as version-0.3 soon.

    ReplyDelete
  10. versin 0.3 : http://nmlaxaman.blogspot.com/2009/02/multiseat-for-dual-headedmultiple_23.html

    ReplyDelete