You are not logged in.

#1 2020-06-15 21:24:23

DexterLB
Member
Registered: 2011-06-20
Posts: 50

Keyboards appear several times in udev's device tree, causing problems

Hello,

I have a multi-seat setup: two GPUs, two USB hubs with respective mice and keyboards.

I am able to successfully create udev seats by assigning the GPUs as masters and to obtain an useful configuration by assigning the USB hubs to the respective seats. This "assignment" (using "loginctl attach") works correctly for mice and other devices, EXCEPT for keyboards.

Here is my device tree:

		  ├─/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input1
		  │ input:input1 "Power Button"
		  ├─/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0
		  │ input:input0 "Power Button"
		  ├─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:02.0/0000:04:00.0/0000:05:00.0/0000:06:00.0/drm/card0
		  │ [MASTER] drm:card0
		  │ ├─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:02.0/0000:04:00.0/0000:05:00.0/0000:06:00.0/drm/card0/card0-DP-1
		  │ │ [MASTER] drm:card0-DP-1
		  │ ├─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:02.0/0000:04:00.0/0000:05:00.0/0000:06:00.0/drm/card0/card0-DP-2
		  │ │ [MASTER] drm:card0-DP-2
		  │ ├─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:02.0/0000:04:00.0/0000:05:00.0/0000:06:00.0/drm/card0/card0-HDMI-A-1
		  │ │ [MASTER] drm:card0-HDMI-A-1
		  │ └─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:02.0/0000:04:00.0/0000:05:00.0/0000:06:00.0/drm/card0/card0-HDMI-A-2
		  │   [MASTER] drm:card0-HDMI-A-2
		  ├─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:02.0/0000:04:00.0/0000:05:00.0/0000:06:00.1/sound/card0
		  │ sound:card0 "HDMI"
		  │ ├─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:02.0/0000:04:00.0/0000:05:00.0/0000:06:00.1/sound/card0/input10
		  │ │ input:input10 "HDA ATI HDMI HDMI/DP,pcm=10"
		  │ ├─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:02.0/0000:04:00.0/0000:05:00.0/0000:06:00.1/sound/card0/input11
		  │ │ input:input11 "HDA ATI HDMI HDMI/DP,pcm=11"
		  │ ├─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:02.0/0000:04:00.0/0000:05:00.0/0000:06:00.1/sound/card0/input6
		  │ │ input:input6 "HDA ATI HDMI HDMI/DP,pcm=3"
		  │ ├─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:02.0/0000:04:00.0/0000:05:00.0/0000:06:00.1/sound/card0/input7
		  │ │ input:input7 "HDA ATI HDMI HDMI/DP,pcm=7"
		  │ ├─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:02.0/0000:04:00.0/0000:05:00.0/0000:06:00.1/sound/card0/input8
		  │ │ input:input8 "HDA ATI HDMI HDMI/DP,pcm=8"
		  │ └─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:02.0/0000:04:00.0/0000:05:00.0/0000:06:00.1/sound/card0/input9
		  │   input:input9 "HDA ATI HDMI HDMI/DP,pcm=9"
		  ├─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:08:00.1/usb1
		  │ usb:usb1
		  ├─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:08:00.1/usb2
		  │ usb:usb2
		  ├─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:08:00.3/usb3
		  │ usb:usb3
		  ├─/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:08:00.3/usb4
		  │ usb:usb4
		  ├─/sys/devices/pci0000:00/0000:00:03.1/0000:0b:00.0/0000:0c:00.0/0000:0d:00.0/drm/card1
		  │ [MASTER] drm:card1
		  │ ├─/sys/devices/pci0000:00/0000:00:03.1/0000:0b:00.0/0000:0c:00.0/0000:0d:00.0/drm/card1/card1-DP-3
		  │ │ [MASTER] drm:card1-DP-3
		  │ ├─/sys/devices/pci0000:00/0000:00:03.1/0000:0b:00.0/0000:0c:00.0/0000:0d:00.0/drm/card1/card1-DP-4
		  │ │ [MASTER] drm:card1-DP-4
		  │ ├─/sys/devices/pci0000:00/0000:00:03.1/0000:0b:00.0/0000:0c:00.0/0000:0d:00.0/drm/card1/card1-HDMI-A-3
		  │ │ [MASTER] drm:card1-HDMI-A-3
		  │ └─/sys/devices/pci0000:00/0000:00:03.1/0000:0b:00.0/0000:0c:00.0/0000:0d:00.0/drm/card1/card1-HDMI-A-4
		  │   [MASTER] drm:card1-HDMI-A-4
		  ├─/sys/devices/pci0000:00/0000:00:03.1/0000:0b:00.0/0000:0c:00.0/0000:0d:00.0/graphics/fb0
		  │ graphics:fb0 "amdgpudrmfb"
		  ├─/sys/devices/pci0000:00/0000:00:03.1/0000:0b:00.0/0000:0c:00.0/0000:0d:00.1/sound/card1
		  │ sound:card1 "HDMI_1"
		  │ ├─/sys/devices/pci0000:00/0000:00:03.1/0000:0b:00.0/0000:0c:00.0/0000:0d:00.1/sound/card1/input12
		  │ │ input:input12 "HDA ATI HDMI HDMI/DP,pcm=3"
		  │ ├─/sys/devices/pci0000:00/0000:00:03.1/0000:0b:00.0/0000:0c:00.0/0000:0d:00.1/sound/card1/input13
		  │ │ input:input13 "HDA ATI HDMI HDMI/DP,pcm=7"
		  │ ├─/sys/devices/pci0000:00/0000:00:03.1/0000:0b:00.0/0000:0c:00.0/0000:0d:00.1/sound/card1/input14
		  │ │ input:input14 "HDA ATI HDMI HDMI/DP,pcm=8"
		  │ ├─/sys/devices/pci0000:00/0000:00:03.1/0000:0b:00.0/0000:0c:00.0/0000:0d:00.1/sound/card1/input15
		  │ │ input:input15 "HDA ATI HDMI HDMI/DP,pcm=9"
		  │ ├─/sys/devices/pci0000:00/0000:00:03.1/0000:0b:00.0/0000:0c:00.0/0000:0d:00.1/sound/card1/input16
		  │ │ input:input16 "HDA ATI HDMI HDMI/DP,pcm=10"
		  │ └─/sys/devices/pci0000:00/0000:00:03.1/0000:0b:00.0/0000:0c:00.0/0000:0d:00.1/sound/card1/input17
		  │   input:input17 "HDA ATI HDMI HDMI/DP,pcm=11"
		  ├─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.3/usb5
		  │ usb:usb5
		  │ └─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.3/usb5/5-1
		  │   usb:5-1
		  │   ├─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.3/usb5/5-1/5-1.1/5-1.1:1.0/0003:04B3:3025.0001/input/input2
		  │   │ input:input2 "LITE-ON Technology USB NetVista Full Width Keyboard."
		  │   │ ├─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.3/usb5/5-1/5-1.1/5-1.1:1.0/0003:04B3:3025.0001/input/input2/input2::capslock
		  │   │ │ leds:input2::capslock
		  │   │ ├─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.3/usb5/5-1/5-1.1/5-1.1:1.0/0003:04B3:3025.0001/input/input2/input2::numlock
		  │   │ │ leds:input2::numlock
		  │   │ └─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.3/usb5/5-1/5-1.1/5-1.1:1.0/0003:04B3:3025.0001/input/input2/input2::scrolllock
		  │   │   leds:input2::scrolllock
		  │   ├─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.3/usb5/5-1/5-1.2/5-1.2:1.0/0003:046D:C247.0002/input/input3
		  │   │ input:input3 "Logitech G100s Optical Gaming Mouse"
		  │   ├─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.3/usb5/5-1/5-1.3/5-1.3:1.0/sound/card3
		  │   │ sound:card3 "Snowball"
		  │   └─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.3/usb5/5-1/5-1.4
		  │     usb:5-1.4
		  ├─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.3/usb6
		  │ usb:usb6
		  ├─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.4/sound/card2
		  │ sound:card2 "Generic"
		  │ ├─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.4/sound/card2/input18
		  │ │ input:input18 "HD-Audio Generic Front Mic"
		  │ ├─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.4/sound/card2/input19
		  │ │ input:input19 "HD-Audio Generic Rear Mic"
		  │ ├─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.4/sound/card2/input20
		  │ │ input:input20 "HD-Audio Generic Line"
		  │ ├─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.4/sound/card2/input21
		  │ │ input:input21 "HD-Audio Generic Line Out"
		  │ └─/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.4/sound/card2/input22
		  │   input:input22 "HD-Audio Generic Front Headphone"
		  ├─/sys/devices/platform/pcspkr/input/input5
		  │ input:input5 "PC Speaker"
		  ├─/sys/devices/virtual/input/input23
		  │ input:input23 "LITE-ON Technology USB NetVista Full Width Keyboard."
		  │ ├─/sys/devices/virtual/input/input23/input23::capslock
		  │ │ leds:input23::capslock
		  │ ├─/sys/devices/virtual/input/input23/input23::numlock
		  │ │ leds:input23::numlock
		  │ └─/sys/devices/virtual/input/input23/input23::scrolllock
		  │   leds:input23::scrolllock
		  └─/sys/devices/virtual/misc/uinput
		    misc:uinput

As I see it, the problem is that a keyboard appears twice: for example, the "LITE-ON Technology USB NetVista Full Width Keyboard." appears at the following paths:

/sys/devices/pci0000:00/0000:00:08.1/0000:0f:00.3/usb5/5-1/5-1.1/5-1.1:1.0/0003:04B3:3025.0001/input/input2
/sys/devices/virtual/input/input23

For some reason, only the second instance actually generates key events (as per the output of "libinput debug-events"). "input2" seems to correspond to "/dev/input/event1", while "input23" seems to correspond to "/dev/input/event22". Only "/dev/input/event1" has a corresponding symlink in "/dev/input/by-path", which may be part of the problem.

Only the first instance is "attachable" to a seat (for the other one, loginctl says "No such device"). Since it doesn't generate the actual key events, attaching it to a seat doesn't help for assigning the keyboard to the seat.

What are these weird virtual devices? Why do key events come from them instead of the original keyboard device? How can I attach them to a seat?


The best solution to a problem is usually the easiest one.

Offline

Board footer

Powered by FluxBB