We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5488 - HIDAPI on Linux relies on udev_monitor, which won't work in containers
Summary: HIDAPI on Linux relies on udev_monitor, which won't work in containers
Status: WAITING
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.1
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-20 12:14 UTC by Simon McVittie
Modified: 2021-01-20 21:13 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon McVittie 2021-01-20 12:14:13 UTC
src/joystick/hidapi/SDL_hidapijoystick.c uses a udev_monitor to watch for changes to the set of devices available. Similar to Bug #5337, this isn't reliable in a container.

Similar to the evdev code path in src/joystick/linux/SDL_sysjoystick.c, if it detects a Flatpak or pressure-vessel container, it should fall back to using inotify instead of udev_monitor. The inotify should be on "/dev" to pick up devices matching "/dev/hidapi*", unlike the evdev code path which watches "/dev/input" for devices matching "/dev/input/event*". It would also be useful for debugging if there was an environment variable or hint that could be set to force the inotify code path.
Comment 1 Sam Lantinga 2021-01-20 18:18:43 UTC
Can you provide a tested patch?
Comment 2 Simon McVittie 2021-01-20 20:05:49 UTC
Not immediately, but I can add it to the queue.
Comment 3 Sam Lantinga 2021-01-20 21:13:36 UTC
Great, thanks