Route Xbox USB trigger rumble through Windows GameInput #4789

Open
opened 2026-12-01 08:27:07 +00:00 by github-bot · 0 comments
Owner

@⁠gbmrrr on GitHub · 2026-12-01 08:23 UTC · original

What you would like

Support independent left and right trigger vibration on stock Xbox Series controllers over USB. On main at 5fabb46e and release v2026.11.30.03, the GameInput handler discards the two trigger levels and sends only body rumble. The GameInput XInput shim from #61 still uses the two-motor XInput interface.

Standalone test: Windows 11, stock Xbox Series pad over USB (045E:0B12, XboxComposite), GameInput runtime 4.0.306. Selected lines from the read-only device probe (unrelated fields omitted):

GameInputCreate(v4)=0x00000000
RegisterDeviceCallback=0x00000000
GameInput immediate reading=0x838a0003
GameInput callback +891ms: event=0 vid=045e pid=0b12 rumble_mask=0xf xinput=slot0
GameInput addressable trigger-capable pad=yes

The first query was empty, but the device callback found all four motors on the same XInput slot. In a separate foreground tester using SetRumbleState, the player confirmed independent pulses in both triggers and vibration in the body. No controller driver replacement was needed.

Proposed change: Keep input unchanged and add an optional GameInput v4 output path. Discover devices via callbacks and match by XInput slot. Report the trigger motors only once a matching pad advertises them and can be driven. Send the body and trigger levels together in one SetRumbleState call, not alongside an XInput write. Keep the existing fallback when no match or runtime is available. Start discovery before the first device-info query, with at most a bounded startup wait.

Play log from the local prototype (relevant lines only):

2026-12-01T08:01:21.264099Z  INFO victory_hle::modules::gameinput::rumble: GameInput matches an XInput pad with trigger motors slot=0 mask=15
2026-12-01T08:01:21.264839Z  INFO victory_hle::modules::gameinput: the title called device info slot=0x18
2026-12-01T08:03:52.557994Z  INFO victory_hle::modules::gameinput: the title set the rumble index=4 one_pad=true low=20223 high=15871 left_trigger=0 right_trigger=0

The prototype matched the pad before the first device-info query. The 105 logged rumble updates had no nonzero trigger request, so these excerpts do not demonstrate an in-game trigger effect. No crash is being reported. This is separate from the fork-only WinRT documentation in #4562 and the adaptive triggers requested in #2002.

Are you working on a fix?

I have a local prototype. The GameInput regression tests and the first-device-info-query test on this controller passed. I am sharing the approach, not claiming an upstream PR.

**@⁠gbmrrr** on GitHub · 2026-12-01 08:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4788) ## What you would like Support independent left and right trigger vibration on stock Xbox Series controllers over USB. On `main` at `5fabb46e` and release `v2026.11.30.03`, [the GameInput handler discards the two trigger levels](https://github.com/trustno1-coder/VIctory-NVIDIA/blob/5fabb46eaf6ed8771321787f8871051abde69b9b/crates/victory-hle/src/modules/gameinput.rs#L1643-L1667) and sends only body rumble. The GameInput XInput shim from #61 still uses the two-motor XInput interface. **Standalone test:** Windows 11, stock Xbox Series pad over USB (`045E:0B12`, `XboxComposite`), GameInput runtime `4.0.306`. Selected lines from the read-only device probe (unrelated fields omitted): ```text GameInputCreate(v4)=0x00000000 RegisterDeviceCallback=0x00000000 GameInput immediate reading=0x838a0003 GameInput callback +891ms: event=0 vid=045e pid=0b12 rumble_mask=0xf xinput=slot0 GameInput addressable trigger-capable pad=yes ``` The first query was empty, but the device callback found all four motors on the same XInput slot. In a separate foreground tester using `SetRumbleState`, the player confirmed independent pulses in both triggers and vibration in the body. No controller driver replacement was needed. **Proposed change:** Keep input unchanged and add an optional GameInput v4 output path. Discover devices via callbacks and [match by XInput slot](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getxinputdeviceindex). Report the trigger motors only once a matching pad advertises them and can be driven. Send the body and trigger levels together in one [SetRumbleState](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setrumblestate) call, not alongside an XInput write. Keep the existing fallback when no match or runtime is available. Start discovery before the first device-info query, with at most a bounded startup wait. **Play log from the local prototype (relevant lines only):** ```text 2026-12-01T08:01:21.264099Z INFO victory_hle::modules::gameinput::rumble: GameInput matches an XInput pad with trigger motors slot=0 mask=15 2026-12-01T08:01:21.264839Z INFO victory_hle::modules::gameinput: the title called device info slot=0x18 2026-12-01T08:03:52.557994Z INFO victory_hle::modules::gameinput: the title set the rumble index=4 one_pad=true low=20223 high=15871 left_trigger=0 right_trigger=0 ``` The prototype matched the pad before the first device-info query. The 105 logged rumble updates had no nonzero trigger request, so these excerpts do not demonstrate an in-game trigger effect. No crash is being reported. This is separate from the fork-only WinRT documentation in #4562 and the adaptive triggers requested in #2002. ## Are you working on a fix? I have a local prototype. The GameInput regression tests and the first-device-info-query test on this controller passed. I am sharing the approach, not claiming an upstream PR.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 08:27:07 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA#4789
No description provided.