← Back to team overview

ubuntu-multiseat team mailing list archive

Re: keyboard/mouse events are not going to the correct seat

 

On 2015-02-11 11:07, Greg Hood wrote:
> Sorry if this e-mail is redundant, but a couple of weeks ago I had sent
> the message below to the ubuntu-multiseat@xxxxxxxxxxxxxxxxxxx mailing
> list, and it never showed up in the Mailing List Archive, so I'm not
> sure whether it got through or not.

It did not make it through, which is a little concerning...

> 
> We had successfully been using ubuntu-multiseat with Ubuntu 13.10 on our
> 6-seat server, but have recently switched to Ubuntu 14.04 (with lightdm
> 1.10.3-0ubuntu2) and have been encountering problems.  seat0 always
> works fine.  However, the inputs (keyboard and mouse) for seat-1 through
> seat-5 appear to be delivered to a different seat than the correct one.

Consistently?  For example, does input to seat-1 always go to seat-4?
Or is it different each time you reboot?

Is there ever a case where events from a keyboard and mouse plugged into
the same hub go to different seats?

> Yet, if one lists a seat with, e.g., "loginctl seat-status seat-1", the
> input devices and video card are listed correctly.

Are you *sure* you have the correct USB devices assigned to the correct
seats in your udev rules?

> I have included our configuration files below.

I don't see USB rules for seats 4 and 5.

> Anyone know what might be going wrong?

Come to think of it, I recall an odd experience on my home machine where
Linux was reporting the wrong device path for USB devices.  It's been a
long time so my memory is very hazy, but I recall something along these
lines:  When I plugged a USB device into one hub Linux would report that
it was on a different hub.  If I moved it to a different port on the
same hub, Linux would think that I moved to a third hub.  I was in a
hurry and shrugged it off as something I was doing wrong, but if there
is such a bug then that might explain the behavior you're seeing.

So something might be broken about Linux's ability to identify where a
USB device is actually connected.  Perhaps others have reported similar
strangeness with USB device paths?

> 
> One thing we noticed was that the display numbers assigned to seat-1
> through seat-5 vary from reboot to reboot; not sure if this is related
> to the above problem or not.

I don't think it's related.

> For example,
> $ ps aux |grep X
> root      3218  0.0  0.0 197776 59328 ?        S    18:43   0:02 /usr/bin/X -core :1 -seat seat-4 -sharevts -auth /var/run/lightdm/root/:1 -nolisten tcp
> root      3219  0.0  0.0 197844 59448 ?        S    18:43   0:02 /usr/bin/X -core :2 -seat seat-2 -sharevts -auth /var/run/lightdm/root/:2 -nolisten tcp
> root      3221  0.0  0.0 201096 57928 ?        S    18:43   0:03 /usr/bin/X -core :3 -seat seat-5 -sharevts -auth /var/run/lightdm/root/:3 -nolisten tcp
> root      3222  0.0  0.0 198548 62084 ?        S    18:43   0:02 /usr/bin/X -core :4 -seat seat-3 -sharevts -auth /var/run/lightdm/root/:4 -nolisten tcp
> root      3223  0.0  0.0 203164 62000 ?        S    18:43   0:05 /usr/bin/X -core :5 -seat seat-1 -sharevts -auth /var/run/lightdm/root/:5 -nolisten tcp
> root     29348  0.0  0.0 201816 61888 tty7     Ss+  20:20   0:00 /usr/bin/X -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
> 
> In any case, it would make things less confusing if the display number
> could correspond to the seat number.

Agreed.

> Is there any way to do that?

Not sure.  If you manually specify each seat in your lightdm.conf
(rather than let LightDM discover the seats) then it might assign
displays in the listed order.

It would be nice if LightDM did some sort of sorting of the reported
seat names before assigning display numbers.  Perhaps you can file a bug
report about that?

-Richard

> According to the lightdm documentation, the xserver-display-number
> setting is only for remote displays (and we tried it anyway but it
> didn't work).
> Thanks.
> --Greg Hood
>   Pittsburgh Supercomputing Center
> 
> -----contents of /etc/lightdm/lightdm.conf.d/99-multiseat.conf-----
> [LightDM]
> logind-load-seats=true
> logind-check-graphical=true
> 
> -----contents of /etc/X11/xorg.conf.d/90-seat-1.conf-----
> Section "Device"
>     Identifier     "Device1"
>     Driver         "nvidia"
>     VendorName     "NVIDIA Corporation"
>     BoardName      "Quadro K2000"
>     BusID          "PCI:193:0:0"
>     Option         "ProbeAllGpus"   "false"
>     MatchSeat      "seat-1"
> EndSection
> 
> Section "Screen"
>     Identifier     "Screen1"
>     Device         "Device1"
>     Monitor        "Monitor1"
>     DefaultDepth    24
>     SubSection     "Display"
>         Depth       24
>     EndSubSection
>     Option "FlatPanelProperties" "Dithering=Disabled"
>     Option "AllowEmptyInitialConfiguration"
>     MatchSeat      "seat-1"
> EndSection
> 
> -----contents of /etc/X11/xorg.conf.d/90-seat-2.conf-----
> Section "Device"
>     Identifier     "Device2"
>     Driver         "nvidia"
>     VendorName     "NVIDIA Corporation"
>     BoardName      "Quadro K4000"
>     BusID          "PCI:194:0:0"
>     Option         "ProbeAllGpus"   "false"
>     MatchSeat      "seat-2"
> EndSection
> 
> Section "Screen"
>     Identifier     "Screen2"
>     Device         "Device2"
>     Monitor        "Monitor2"
>     DefaultDepth    24
>     SubSection     "Display"
>         Depth       24
>     EndSubSection
>     Option "FlatPanelProperties" "Dithering=Disabled"
>     Option "AllowEmptyInitialConfiguration"
>     MatchSeat      "seat-2"
> EndSection
> 
> -----other seats follow the same pattern-----
> 
> -----contents of /etc/udev/rules.d/99-multiseat.rules-----
> # add master-of-seat tag to video cards
> SUBSYSTEM=="drm", KERNEL=="card[0-9]*", ATTRS{vendor}=="0x10de", DRIVERS=="nvidia", TAG+="master-of-seat"
> 
> # assign USB ports
> TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:02.0/0000:02:00.0/0000:03:0f.0/0000:0b:00.0/usb14/*", ENV{ID_SEAT}="seat0", TAG+="seat0"
> TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:02.0/0000:02:00.0/0000:03:0d.0/0000:0a:00.0/usb13/*", ENV{ID_SEAT}="seat-1", TAG+="seat-1"
> TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:02.0/0000:02:00.0/0000:03:03.0/0000:05:00.0/usb10/*", ENV{ID_SEAT}="seat-2", TAG+="seat-2"
> TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:02.0/0000:02:00.0/0000:03:09.0/0000:08:00.0/usb12/*", ENV{ID_SEAT}="seat-3", TAG+="seat-3"
> 
> # assign video cards
> TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:03.0/0000:0e:00.0/*", ENV{ID_SEAT}="seat0", TAG+="seat0"
> TAG=="seat", DEVPATH=="/devices/pci0000:c0/0000:c0:03.0/0000:c2:00.0/*", ENV{ID_SEAT}="seat-1", TAG+="seat-1"
> TAG=="seat", DEVPATH=="/devices/pci0000:c0/0000:c0:02.0/0000:c1:00.0/*", ENV{ID_SEAT}="seat-2", TAG+="seat-2"
> TAG=="seat", DEVPATH=="/devices/pci0000:80/0000:80:02.0/0000:81:00.0/*", ENV{ID_SEAT}="seat-3", TAG+="seat-3"
> TAG=="seat", DEVPATH=="/devices/pci0000:40/0000:40:03.0/0000:43:00.0/*", ENV{ID_SEAT}="seat-4", TAG+="seat-4"
> TAG=="seat", DEVPATH=="/devices/pci0000:40/0000:40:02.0/0000:42:00.0/*", ENV{ID_SEAT}="seat-5", TAG+="seat-5"



Follow ups