Steam Controller stops sending events
Summary
With some Wayland compositors (KWinFT and by my research also Mutter) the Steam Controller is recognized as a keyboard,mouse input device but does not send events afterwards (it does for a very short period of ca. half a second in KWinFT after USB stick is re-plugged).
On the other side it does work with weston and wlroots based compositors.
Steps to reproduce
Start a KWinFT Wayland session. The Steam Controller won't receive events (but will be recognized by the compositor as a keyboard, mouse device).
Required information
- libinput version: master
- hardware information: Steam Controller
-
libinput record
output: libinput-record-steam-controller.txt -
libinput debug-events --verbose
output: libinput-debug-events-steam-controller.txt
Additional resources
- gamescope issue: Steam Controller Wayland pointer input
- KWinFT issue: Steam Controller does not move cursor (has more information about tests I did)
Solution attempts
I don't have many debugging information available because there are no events besides the connection being established in the first place so I tried to replace basically everything in KWinFT's source what differed from weston and wlroots:
- Input processing in the main application thread instead of a separate one.
- Omit any configuration of the device after it was added.
- libinput_device_ref the device twice like wlroots does.
- Setting the same flags (no flags) on the udev-provided device file descriptor like wlroots.
- Handle each event individually directly after libinput_dispatch instead of caching them in a queue and then handling all at once.
- libinput_dispatch once after events are available instead of doing it multiple times before each new event.
The one thing I didn't yet replace is the QSocketNotifier that listens on the fd for new events. Without the thread the notifier is driven by the main Qt event loop and I assume it would be a bigger act to replace that with something not inherently dependent on a Qt event loop.