rootpages icon indicating copy to clipboard operation
rootpages copied to clipboard

[computer_hardware][accessories] Understanding InputPlumber

Open LukeShortCloud opened this issue 1 year ago • 0 comments
trafficstars

Enabling the inputplumber service will improve controller compatibility for a lot of devices. For more obscure controllers, they are mapped to popular controllers that are better supported based on their similar features (ex., Xbox 360, Xbox Series, DualSense 5, etc.). It also allows remapping controls and emulating different controllers.

InputPlumber will mask the original /dev/event<NUMBER> device and create a new virtual input device instead. This avoids having duplicate input. Everything is controlled via InputPlumber configuration files. evtest is typically used to view controller inputs. However, InputPlumber has exclusive access over a physical device so it will not work. Turn off the inputplumber service for evtest to work.

InputPlumber also has a DBus interface. Use busctl monitor org.shadowblip.InputPlumber | grep -A1 'ui_' to view the inputs sent to DBus. This can be used in an intercept mode for a console UI outside of a game to respond to a Guide and/or Quick Access Menu (QAM) button, for example.

Example configuration file for a controller: https://github.com/ShadowBlip/InputPlumber/blob/main/rootfs/usr/share/inputplumber/devices/50-rog_ally.yaml . Use udevadm info /dev/input/event<NUMBER> --attribute-walk to view all of the inputs that can be configured for InputPlumber to control.

Generate debug logs for InputPlumber:

$ sudo systemctl stop inputplumber
$ sudo LOG_LEVEL=debug inputplumber | tee /tmp/inputplumber.log

LukeShortCloud avatar Nov 18 '24 20:11 LukeShortCloud