2

I have a multiseat setup using loginctl and I'm having issues with a bluetooth headset.

The USB bluetooth dongle in on seat0 but my display number :N changes randomly on restarts and my headset attaches to whatever display number it attached to last time, or seat0 if there's no other active seats.

Connecting the headset gives me...

❯ sudo udevadm -d monitor -p
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[11828.639536] add      /devices/pci0000:00/0000:00:05.0/0000:06:00.0/usb8/8-2/8-2:1.0/bluetooth/hci0/hci0:12 (bluetooth)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:05.0/0000:06:00.0/usb8/8-2/8-2:1.0/bluetooth/hci0/hci0:12
SUBSYSTEM=bluetooth
DEVTYPE=link
SEQNUM=5747

UDEV  [11828.643688] add      /devices/pci0000:00/0000:00:05.0/0000:06:00.0/usb8/8-2/8-2:1.0/bluetooth/hci0/hci0:12 (bluetooth)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:05.0/0000:06:00.0/usb8/8-2/8-2:1.0/bluetooth/hci0/hci0:12
SUBSYSTEM=bluetooth
DEVTYPE=link
SEQNUM=5747
USEC_INITIALIZED=11828643524
SYSTEMD_ALIAS=/sys/subsystem/bluetooth/devices/hci0:12
SYSTEMD_WANTS=bluetooth.target
SYSTEMD_USER_WANTS=bluetooth.target
TAGS=:systemd:
CURRENT_TAGS=:systemd:

KERNEL[11830.906947] add      /devices/virtual/input/input74 (input)
ACTION=add
DEVPATH=/devices/virtual/input/input74
SUBSYSTEM=input
PRODUCT=5/0/0/0
NAME="NC-25 (AVRCP)"
PHYS="5c:f3:70:6a:03:6c"
PROP=0
EV=100007
KEY=2fc800 145200000000 0 10300 49e800000c00 e16800000000f f810000010000ffc
REL=0
MODALIAS=input:b0005v0000p0000e0000-e0,1,2,14,k71,72,73,8A,8B,A3,A5,A6,A7,A8,AB,AE,C8,C9,D0,161,164,166,16A,16C,18B,18E,18F,190,191,192,193,195,ramlsfw
SEQNUM=5748

KERNEL[11830.907167] add      /devices/virtual/input/input74/event265 (input)
ACTION=add
DEVPATH=/devices/virtual/input/input74/event265
SUBSYSTEM=input
DEVNAME=/dev/input/event265
SEQNUM=5749
MAJOR=13
MINOR=265

UDEV  [11831.445222] add      /devices/virtual/input/input74 (input)
ACTION=add
DEVPATH=/devices/virtual/input/input74
SUBSYSTEM=input
PRODUCT=5/0/0/0
NAME="NC-25 (AVRCP)"
PHYS="5c:f3:70:6a:03:6c"
PROP=0
EV=100007
KEY=2fc800 145200000000 0 10300 49e800000c00 e16800000000f f810000010000ffc
REL=0
MODALIAS=input:b0005v0000p0000e0000-e0,1,2,14,k71,72,73,8A,8B,A3,A5,A6,A7,A8,AB,AE,C8,C9,D0,161,164,166,16A,16C,18B,18E,18F,190,191,192,193,195,ramlsfw
SEQNUM=5748
USEC_INITIALIZED=11830908664
ID_INPUT=1
ID_INPUT_KEY=1
ID_BUS=bluetooth
TAGS=:seat:
CURRENT_TAGS=:seat:

UDEV  [11832.553850] add      /devices/virtual/input/input74/event265 (input)
ACTION=add
DEVPATH=/devices/virtual/input/input74/event265
SUBSYSTEM=input
DEVNAME=/dev/input/event265
SEQNUM=5749
USEC_INITIALIZED=11831463188
ID_INPUT=1
ID_INPUT_KEY=1
ID_BUS=bluetooth
LIBINPUT_DEVICE_GROUP=5/0/0:5c:f3:70:6a:03:6c
MAJOR=13
MINOR=265
TAGS=:power-switch:
CURRENT_TAGS=:power-switch:

loginctl creates udev rules to attach specific devices to specific seats, but the bluetooth device doesn't show up at all on loginctl seat-status seat0, only the bluetooth adaptor shows up, but that's already on seat0 by default. None of the sound devices match the bluetooth headset:

❯ loginctl seat-status seat0 | grep sound
                  ├─/sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:00.0/0000:03:00.1/sound/card3
                  │ sound:card3 "HDMI_1"
                  │ ├─/sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:00.0/0000:03:00.1/sound/card3/input27
                  │ ├─/sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:00.0/0000:03:00.1/sound/card3/input28
                  │ ├─/sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:00.0/0000:03:00.1/sound/card3/input29
                  │ ├─/sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:00.0/0000:03:00.1/sound/card3/input30
                  │ └─/sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:00.0/0000:03:00.1/sound/card3/input31
                  ├─/sys/devices/pci0000:00/0000:00:14.2/sound/card2
                  │ sound:card2 "SB"
                  │ ├─/sys/devices/pci0000:00/0000:00:14.2/sound/card2/input40
                  │ ├─/sys/devices/pci0000:00/0000:00:14.2/sound/card2/input41
                  │ ├─/sys/devices/pci0000:00/0000:00:14.2/sound/card2/input42
                  │ ├─/sys/devices/pci0000:00/0000:00:14.2/sound/card2/input43
                  │ ├─/sys/devices/pci0000:00/0000:00:14.2/sound/card2/input44
                  │ ├─/sys/devices/pci0000:00/0000:00:14.2/sound/card2/input45
                  │ ├─/sys/devices/pci0000:00/0000:00:14.2/sound/card2/input46
                  │ └─/sys/devices/pci0000:00/0000:00:14.2/sound/card2/input47

Can I write a udev rule similar to the ones that loginctl creates in order to force the bluetooth headset to always bind to seat0?

❯ cat /etc/udev/rules.d/72-seat-sound-pci-0000_04_00_1.rules
TAG=="seat", ENV{ID_FOR_SEAT}=="sound-pci-0000_04_00_1", ENV{ID_SEAT}="seat1"
2
  • Did you ever find an answer to this? I'm struggling with the same thing now. Strange thing is udevadm monitor --environment --udev suggests that the correct seat is picked for it (seat0) but then it somehow attaches to seat1 anyway. Apr 25, 2023 at 14:01
  • 1
    I have added 6 rules to /etc/udev/rules.d/multiseat.rules to bind to seat0: SUBSYSTEM=="bluetooth", ATTRS{address}=="11:11:22:33:34:3C", TAG+="seat", TAG+="seat0", ENV{ID_SEAT}="seat0" and SUBSYSTEM=="input", ATTRS{phys}=="11:11:22:33:34:3C", TAG+="seat", TAG+="seat0", ENV{ID_SEAT}="seat0" and SUBSYSTEM=="sound", ATTRS{uniq}=="11:11:22:33:34:3C", TAG+="seat", TAG+="seat0", ENV{ID_SEAT}="seat0" for both the BT reported address of 11:11:22:33:34:3C as well as what udevmon reported 5C:F3:70:6A:03:6C. I no longer experience the issue but that could just as well be anecdotal.
    – SHawarden
    Apr 25, 2023 at 22:57

0

You must log in to answer this question.

Browse other questions tagged .