User-space input daemon for the Trimui family (Smart Pro, Smart Pro S, Brick). It reads the device-specific GPIO/serial inputs, publishes a unified uinput gamepad, and supports rumble on the supported A133-based hardware.
- Auto-detects Smart Pro, Smart Pro S, or Brick at startup.
- Maps physical buttons, triggers, sticks, and hat to a single virtual gamepad.
- Rumble for A133-based units through the GPIO 227 and Smart Pro S PWM-vibrator backends.
- Upstream joystick calibration files with per-axis min/max/center values and normalized deadzone support.
- Learned calibration fallback when no upstream calibration file is available.
The repo ships with a cross-compilation container. From the project root:
docker compose up --buildIf you are using an x86 host, you might need to run this first:
docker run --privileged --rm tonistiigi/binfmt --install arm64If you prefer a native toolchain, install gcc, make, and standard headers for your aarch64 rootfs, then run:
make clean && makeThe native build outputs to build/trimui_inputd/bin/trimui_inputd.
- Requires access to
/dev/uinput, serial ports (/dev/ttyS3/4or/dev/ttyAS5/7),/dev/mem(Brick GPIO), and/sys/class/gpio(A133 rumble). - Run the built binary as root (or with the needed capabilities):
sudo ./build/trimui_inputd/bin/trimui_inputdThe daemon auto-detects the connected Trimui variant and starts polling.
BRICK_ACTIVE_LOW=0forces Brick buttons to be treated as active-high (defaults to active-low).- Joystick calibration lookup checks the first available file in this order:
/etc/trimui/joypad*.config,/userdata/system/joypad*.config(Batocera), then/mnt/UDISK/joypad*.config(stock BSP). The concrete filenames arejoypad.configfor the left stick andjoypad_right.configfor the right stick. Override the paths withTRIMUI_JOYPAD_CONFIGandTRIMUI_JOYPAD_RIGHT_CONFIG. Each file usesx_min,x_max,y_min,y_max,x_zero,y_zero, and a normalizeddeadzone(for example0.10). Missing files retain the learned calibration fallback. - Rumble uses GPIO 227 on the A133 backend and the PWM-vibrator backend on Smart Pro S.
src/devices/: Device-specific logic (Smart Pro, Smart Pro S, Brick) and shared rumble core.src/drivers/: Low-level helpers (serial, GPIO, sunxi GPIO mmap, rumble drivers).src/gamepad/: uinput wrapper.src/calibration/: Upstream and learned stick calibration helpers.