Closed pastaq closed 2 years ago
In my normal testing environment is has been the case that the user is able to use the device.
Usually from what I have seen so far regular users don't have access to the devices. I guess to prevent keyloggers. I usually do sudo evtest
.
I haven't been able to determine what the root cause of this change in behavior is.
I'm not aware of anything, can't tell.
steam is not able to use the device
I wonder how steam usually accesses controllers. I would have thought that there must be some sort of interface between the display server and steam. Just like how X11 accesses keyboards, translates the events to symbols and then provides those to all the applications.
Maybe you could try to figure out if it makes a difference if wayland or X11 is used.
I guess your applications is running as root? You could try to grant the o+r permission to the created uinput automatically. Since there doesn't seem to be any sensitive information in there, just gamepad events, I guess this change would not be critical for security.
Usually from what I have seen so far regular users don't have access to the devices. I guess to prevent keyloggers. I usually do
sudo evtest
.
Up until whatever recently changed I was able to see both the xbox360 controller and the virtual controller created from that device as user, and only needed sudo to see things like keyboards, lid switches, etc.
I wonder how steam usually accesses controllers. I would have thought that there must be some sort of interface between the display server and steam. Just like how X11 accesses keyboards, translates the events to symbols and then provides those to all the applications.
Presumably there is some translation layer. Steam can see keyboards after all.
Maybe you could try to figure out if it makes a difference if wayland or X11 is used.
I will verify if the behavior has also affected X11 as I have only tested it in wayland. Previously it was working in both however.
I guess your applications is running as root? You could try to grant the o+r permission to the created uinput automatically. Since there doesn't seem to be any sensitive information in there, just gamepad events, I guess this change would not be critical for security.
Is there a way to copy/change ACL's when creating a new uinput device through python? Manually setting this didn't seem to solve the problem and could be a symptom instead of a cause.
I also have ACLs set on my uinput devices by default by the way
Is there a way to copy/change ACL's when creating a new uinput device through python?
couldn't find anything. You could use subprocess.Popen
to call setfacl
of course, though it's probably not very pretty.
Maybe those are related: https://github.com/ValveSoftware/steam-for-linux/issues/4794, https://github.com/pwr-Solaar/Solaar/pull/1607
Usually from what I have seen so far regular users don't have access to the devices
I completely missed that this doesn't seem to apply to uinputs, good to know
Thank you! After reading that second link and then creating some udev rules I was able to get everything working as expected.
In case someone else has the same problem, place the following in /etc/udev/rules.d:
60-{custom-device-name}.rules (change name and xxxx to expected values)
KERNEL=="py-evdev-uinput", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="xxxx", MODE="0660", TAG+="uaccess", ENV{ID_INPUT_JOYSTICK}="1"
I have a project that uses python-evdev to create a virtual xbox controller for the Aya Neo line of handheld devices so that the keyboard buttons on the device can be mapped to controller events. I have received reports from users in different OS's that the device isn't detectable by the user. In my normal testing environment is has been the case that the user is able to use the device. However, when switching to the latest build I also began to experience the issue. I haven't been able to determine what the root cause of this change in behavior is. For reference, the OS i usually use is ChimeraOS. In v33 the
evtest
program shows the virtual device when run by the user. In v34 it does not, and steam is not able to use the device.One difference I did notice is the ACL does not seem to be transferred to the UInput device in the latest build. v33
v34
Setting the ACL after the fact does not fix the problem however. I am a bit lost on where to go from here. UDEV rules were not changed from v33 to v34, though systemd was upgraded from v 250 to v251. Any advice on solving this problem would be appreciated. Thank you.
Here is a link to my project's implementation: https://github.com/ShadowBlip/aya-neo-fixes/blob/main/neo-controller.py Here is the build difference from the two versions: