Steam client version (build number or date): 1787097529
Distribution (e.g. Ubuntu): NixOS
Opted into Steam client beta?: Yes
Have you checked for system updates?: Yes
Steam Logs: N/A
GPU: AMD
Please describe your issue in as much detail as possible:
I would like to ask for Steam Input to take a shared advisory lock (flock() on linux, LockFileEx on windows) when it opens a HID device, and release the device if it finds an exclusive lock, so that third-party applications can take specific controllers from Steam Input's management.
When Steam Input recognizes a supported controller it opens the corresponding /dev/hidrawX device directly and starts managing it regardless of whether another program was already using the same device. There is no way for a third party program (for example a custom controller driver) to tell Steam Input that it wants to manage a specific device instead.
This is how I expected it to work:
Before opening a HID device Steam Input tries taking a shared lock. Steam Input doesn't need exclusivity for its purposes so I believe a shared lock makes sense in this situation.
A third party program that wants exclusive ownership of a controller takes an exclusive lock before Steam Input and after launching Steam the lock attempt fails and Steam Input leaves the device alone.
Since exclusive locks can't evict existing shared lock holders, Steam Input could try to periodically check if there are any exclusive locks on the device.
If this isn't a viable approach an equivalent mechanism for allowing third-party applications to take a specific controller out of Steam Input's management would also work.
Steps for reproducing this issue:
Have a Steam Input compatible controller connected.
run sudo flock -x /dev/hidrawX -c 'sleep infinity' to lock the HID device exclusively
Launch Steam
Observe that Steam still opens and manages the same HID device
Your system information
Please describe your issue in as much detail as possible:
I would like to ask for Steam Input to take a shared advisory lock (flock() on linux, LockFileEx on windows) when it opens a HID device, and release the device if it finds an exclusive lock, so that third-party applications can take specific controllers from Steam Input's management.
When Steam Input recognizes a supported controller it opens the corresponding /dev/hidrawX device directly and starts managing it regardless of whether another program was already using the same device. There is no way for a third party program (for example a custom controller driver) to tell Steam Input that it wants to manage a specific device instead.
This is how I expected it to work:
Before opening a HID device Steam Input tries taking a shared lock. Steam Input doesn't need exclusivity for its purposes so I believe a shared lock makes sense in this situation.
A third party program that wants exclusive ownership of a controller takes an exclusive lock before Steam Input and after launching Steam the lock attempt fails and Steam Input leaves the device alone.
Since exclusive locks can't evict existing shared lock holders, Steam Input could try to periodically check if there are any exclusive locks on the device.
If this isn't a viable approach an equivalent mechanism for allowing third-party applications to take a specific controller out of Steam Input's management would also work.
Steps for reproducing this issue:
sudo flock -x /dev/hidrawX -c 'sleep infinity'to lock the HID device exclusively