Bug 216134 - uniq attribute unset for incoming uinput device (AVRCP)
Summary: uniq attribute unset for incoming uinput device (AVRCP)
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Input Devices (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_input-devices
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-14 08:01 UTC by macmpi
Modified: 2023-09-22 16:41 UTC (History)
6 users (show)

See Also:
Kernel Version: 5.15.41
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description macmpi 2022-06-14 08:01:54 UTC
Hi,

uniq attribute does not appear to be set for uinput device, whereas it is correctly set for uhid devices: this is an unexpected inconsistency for similar usecase (connect a bluetooth input device), and makes it difficult to properly identify through udev which actual device got connected/disconnected.

Some discussion on the issue here:
https://github.com/bluez/bluez/issues/352#issuecomment-1150299074

There have been some previous discussions on how to implement this in the past, but it does not seem to have reached a conclusion yet:
https://patchwork.kernel.org/project/linux-input/patch/20191127185139.65048-1-abhishekpandit@chromium.org/

Thanks for consideration.
Comment 1 macmpi 2022-07-15 17:05:14 UTC
Any feedback (relevance, fit for purpose, won't fix,...)?
Thanks
Comment 2 sujakulk 2023-07-18 23:42:27 UTC
Hello, 
Is there a plan to add ioctl support for getting uinput uniq identifier ? 

https://patchwork.kernel.org/project/linux-input/patch/20191127185139.65048-1-abhishekpandit@chromium.org/ 

This previous discussions seems to have gone cold for a long time. 

One problematic use case : 

Getting the uniq identifier(EVIOCGUNIQ) for a virtual input device created using libevdev library (libevdev_set_name()) always fails. A lot of VMMs rely on getting the uniq identifier as part of virtualizing it. 

Uinput needs a similar support as well.
Comment 3 Kenny Wottrich 2023-09-22 16:41:53 UTC
I also have a need for this. I am working on exposing the accelerometer and gyroscope sensor in the ASUS ROG Ally device. In parallel to a separate effort to add an iio kernel driver, I am working on userspace solution to adapt the iio data to an evdev device using uinput. One primary development goal is to be able to associate the motion controls of the gyro with the built-in buttons and joysticks, which report as an XBox 360 controller. SDL (which is used by WINE/Proton and many native games and applications) supports linking evdev controllers to their corresponding evdev motion sensors, but ONLY if the uniq attribute matches between the two. This approach works out of the box with existing Playstation and Nintendo controllers.

However, without being able to specify the uniq attribute through uinput, my evdev solution is unable to advertise to SDL that my evdev device is the motion control counterpart to the built-in controller.

I have read through the whole discussion and I believe the patch proposed remains viable. Please consider taking another look at this, Dmitry et al!

Note You need to log in before you can comment on or make changes to this bug.