fangorn/sunshine-qemu
public
ref:main
Deferred: emulated USB gamepad device in QEMU for Windows guests #11
open
Opened by cole.christensen@gmail.com
Links
Deferred: emulated USB gamepad device in QEMU (Windows guests)
Parent: #1. Deferred; follows #7. This is QEMU work, not Sunshine work.
Problem
Windows guests have no virtio-input driver that exposes a gamepad, so the #7 approach (uinput + virtio-input-host-pci) doesn’t reach Windows. Windows has built-in drivers for USB HID game controllers and for XInput (Xbox 360 wired: vendor 045e, product 028e). An emulated USB device in QEMU would work with no guest drivers.
Options to evaluate
usb-gamepadHID device in QEMU (hw/usb/dev-hid.calready hasusb-tablet/usb-kbd/usb-mousebuilt onhw/input/hid.c). Generic HID gamepad descriptor; input from a QEMU input backend. Needs a new input event type or a D-BusGamepadinterface on the Console, which would also fill the D-Bus display gap for #7.- XInput-compatible USB device (Xbox 360 wired descriptor, vendor-class interface). Best Windows game compatibility, but more protocol work, and the VID/PID/trademark questions need raising with QEMU upstream.
- No QEMU change: USB/IP from a host
dummy_hcd+ raw-gadget device into the guest viausb-host. Clunky, root-heavy, poor deployment story.
Tasks when picked up
- Ask on qemu-devel or check the archives for prior gamepad device proposals.
- Prototype option 1 with a D-Bus
org.qemu.Display1.Gamepadinterface (Press/Release(u button),SetAxis(u axis, i value), rumble signal back), and hook it into the Sunshine input routing from #5. - Windows guest test: Game Controllers panel (
joy.cpl) shows the device, buttons and axes respond.
Requirements
When started, add REQ-INP-005 “Gamepad input for Windows guests”.