Re: [systemd-devel] [multiseat] Attach virtual input to seat1

2023-09-05 Thread Lennart Poettering
On So, 03.09.23 00:46, LuKaRo (li...@lrose.de) wrote:

>
> $ sudo loginctl attach seat1 /sys/devices/virtual/input/input43
> Could not attach device: No such device
> $ sudo loginctl attach seat1 /sys/devices/virtual/input/input44
> Could not attach device: No such device
> $ sudo loginctl attach seat1 /sys/devices/virtual/input/input23
> Could not attach device: No such device
> $ sudo loginctl attach seat1 /sys/devices/virtual/input/input22
> Could not attach device: No such device
> $ sudo loginctl attach seat1 /sys/devices/virtual/input/input21
> Could not attach device: No such device
>
> Any idea why all of them fail, and what could be a possible
> workaround?

See my reply here:

https://lists.freedesktop.org/archives/systemd-devel/2023-September/049470.html

The key is that the udev property ID_FOR_SEAT is not set for these
devices. (We should definitely generate a more useful error in that
case.) Only devices that have that property set can be assigned to seats.

ID_FOR_SEAT is supposed to carry some form of stable ID string we can
identify the device with, that remains the same between reboots. We
currently set ID_FOR_SEAT to useful values for PCI and USB devices,
but not on other busses. In particular virtual devices are not
covered. "input23" is not useful as an identifier string in
ID_FOR_SEAT, because they are assigned in the order of probing, which
typically is not stable.

it should suffice setting the udev property via some udev rule to
something reasonable, for the devices you add... I have no idea how
that looks like for your specific type of devices.

Lennart

--
Lennart Poettering, Berlin


[systemd-devel] [multiseat] Attach virtual input to seat1

2023-09-02 Thread LuKaRo

Hi everyone,

been following this list for a while now, and I'm glad to see that I'm 
not the only one using multiseat nowadays. That makes me wonder if this 
could be the right place to get help with an issue I'm trying to solve 
for months now.


It burns down to attaching a virtual input to a different seat than 
seat0. For example, loginctl seat-status seat0 shows me this:


$ loginctl --no-pager seat-status seat0
seat0
    Sessions: *c3
     Devices:
      [...]
      ├─/sys/devices/virtual/input/input21
      │ input:input21 "Logitech Wireless Mouse PID:4038"
      ├─/sys/devices/virtual/input/input22
      │ input:input22 "Touchscreen passthrough"
      ├─/sys/devices/virtual/input/input23
      │ input:input23 "Keyboard passthrough"
      ├─/sys/devices/virtual/input/input42
      │ input:input42 "Logitech Wireless Mouse PID:4038"
      ├─/sys/devices/virtual/input/input43
      │ input:input43 "Touchscreen passthrough"
      ├─/sys/devices/virtual/input/input44
      │ input:input44 "Keyboard passthrough"
      [...]

And seat1 is freshly created by attaching a MASTER device, having no 
input devices at all:


$ loginctl --no-pager seat-status seat1
seat1
    Sessions: *c2
     Devices:
└─/sys/devices/pci:00/:00:01.1/:01:00.0/:02:00.0/:03:00.0/drm/card1
        [MASTER] drm:card1
├─/sys/devices/pci:00/:00:01.1/:01:00.0/:02:00.0/:03:00.0/drm/card1/card1-DP-1
        │ [MASTER] drm:card1-DP-1
        │ 
└─/sys/devices/pci:00/:00:01.1/:01:00.0/:02:00.0/:03:00.0/drm/card1/card1-DP-1/i2c-7/i2c-dev/i2c-7

        │   i2c-dev:i2c-7 "AMDGPU DM aux hw bus 0"
├─/sys/devices/pci:00/:00:01.1/:01:00.0/:02:00.0/:03:00.0/drm/card1/card1-DP-2
        │ [MASTER] drm:card1-DP-2
        │ 
└─/sys/devices/pci:00/:00:01.1/:01:00.0/:02:00.0/:03:00.0/drm/card1/card1-DP-2/i2c-8/i2c-dev/i2c-8

        │   i2c-dev:i2c-8 "AMDGPU DM aux hw bus 1"
├─/sys/devices/pci:00/:00:01.1/:01:00.0/:02:00.0/:03:00.0/drm/card1/card1-DP-3
        │ [MASTER] drm:card1-DP-3
        │ 
└─/sys/devices/pci:00/:00:01.1/:01:00.0/:02:00.0/:03:00.0/drm/card1/card1-DP-3/i2c-9/i2c-dev/i2c-9

        │   i2c-dev:i2c-9 "AMDGPU DM aux hw bus 2"
└─/sys/devices/pci:00/:00:01.1/:01:00.0/:02:00.0/:03:00.0/drm/card1/card1-HDMI-A-1
      [MASTER] drm:card1-HDMI-A-1

However, attaching the virtual input to seat1 always fails, although I 
do it exactly the same way as I attached the GPU:


$ sudo loginctl attach seat1 /sys/devices/virtual/input/input43
Could not attach device: No such device
$ sudo loginctl attach seat1 /sys/devices/virtual/input/input44
Could not attach device: No such device
$ sudo loginctl attach seat1 /sys/devices/virtual/input/input23
Could not attach device: No such device
$ sudo loginctl attach seat1 /sys/devices/virtual/input/input22
Could not attach device: No such device
$ sudo loginctl attach seat1 /sys/devices/virtual/input/input21
Could not attach device: No such device

Any idea why all of them fail, and what could be a possible workaround?

Thanks in advance!

lukaro

Some background for those interested: This is a gaming desktop machine 
I'm using to stream games with sunshine (server) and moonlight (client), 
basically VNC for video content. sunshine creates a video stream of the 
desktop, moonlight plays it back in fullscreen and sends user input in 
return. sunshine creates virtual devices for each input sent by 
moonlight. This works flawlessly on seat0, where the virtual input gets 
attached automatically, but I want to allow a second person to play on 
that machine, so I need seat1 to work as well. When seat1 is controlled 
using USB input devices, everything works fine, but when both seats are 
remote, input of both sessions ends up in seat0, with seat1 not 
receiving input at all.