ref:main

Deferred: emulated USB gamepad device in QEMU for Windows guests #11

open Opened by cole.christensen@gmail.com

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

  1. usb-gamepad HID device in QEMU (hw/usb/dev-hid.c already has usb-tablet/usb-kbd/usb-mouse built on hw/input/hid.c). Generic HID gamepad descriptor; input from a QEMU input backend. Needs a new input event type or a D-Bus Gamepad interface on the Console, which would also fill the D-Bus display gap for #7.
  2. 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.
  3. No QEMU change: USB/IP from a host dummy_hcd + raw-gadget device into the guest via usb-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.Gamepad interface (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”.