Rumble a USB DualSense read over HID #314

Manually merged
github merged 1 commit from github-bot/gh-314 into gh-pr/314/base 2026-11-27 16:28:08 +00:00 AGit
Owner

@⁠nullexxx on GitHub · 2026-11-27 15:44 UTC · original
nullexxx:feat/dualsense-feedback → main · +325 −6 · 3 files · 1 commits · merged 2026-11-27 16:26 UTC

Rumble for a USB DualSense read over HID (VICTORY_DUALSENSE). Before, set_rumble (slot 0x50) went only to XInput, which doesn't know a pad read over HID, so that pad got no rumble.

The report layout and the firmware check are ported from Asem912's Marvisak/VIctory#2337 as developed in aleksesipenko/VIctory-RTX; both are co-authors.

What changes

  • A USB DualSense takes the title's two motor levels as output report 0x02 (dualsense/feedback.rs). The reports come from a writer thread, at most one per 10 ms per pad and only when the levels change. Writes are overlapped and cancelled after 100 ms. The reader clears the handle before closing it, so no write runs on a closed handle.
  • Compatible vibration 2 is used from firmware 0x0224 on, read from feature report 0x20 at open.
  • The report sets only the motor bits; triggers, lights and audio are left alone.
  • VICTORY_DUALSENSE_RUMBLE=0 leaves the motors alone.
  • A completed write counts as written when the bytes written equal the report length, or the report length minus one (the report ID). That second case is the one Proton gives: 48 bytes complete as 47.

Not included

  • Bluetooth (0x31 with CRC-32) and the DualShock 4: no hardware coverage yet. They are left as before.
  • Trigger levels: still dropped, and pads still declare two motors (0x3). With 0xF declared, this title never sent a nonzero trigger level in testing. #276 covers triggers behind VICTORY_HAPTICS.

Tested on hardware

DualSense over USB, firmware 0x0630, CachyOS + GE-Proton (viewtree), RTX 5080: rumble works. The log line PlayStation gamepad: first rumble report sent shows bytes=48 written=47. Unit tests cover the report, the write-length check and the firmware read.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SEGb52ApL88uPMf5GhSz8K

**@⁠nullexxx** on GitHub · 2026-11-27 15:44 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/314) `nullexxx:feat/dualsense-feedback` → `main` · +325 −6 · 3 files · 1 commits · merged 2026-11-27 16:26 UTC Rumble for a USB DualSense read over HID (`VICTORY_DUALSENSE`). Before, `set_rumble` (slot 0x50) went only to XInput, which doesn't know a pad read over HID, so that pad got no rumble. The report layout and the firmware check are ported from Asem912's Marvisak/VIctory#2337 as developed in aleksesipenko/VIctory-RTX; both are co-authors. ## What changes - A USB DualSense takes the title's two motor levels as output report 0x02 (`dualsense/feedback.rs`). The reports come from a writer thread, at most one per 10 ms per pad and only when the levels change. Writes are overlapped and cancelled after 100 ms. The reader clears the handle before closing it, so no write runs on a closed handle. - Compatible vibration 2 is used from firmware 0x0224 on, read from feature report 0x20 at open. - The report sets only the motor bits; triggers, lights and audio are left alone. - `VICTORY_DUALSENSE_RUMBLE=0` leaves the motors alone. - A completed write counts as written when the bytes written equal the report length, or the report length minus one (the report ID). That second case is the one Proton gives: 48 bytes complete as 47. ## Not included - Bluetooth (0x31 with CRC-32) and the DualShock 4: no hardware coverage yet. They are left as before. - Trigger levels: still dropped, and pads still declare two motors (0x3). With 0xF declared, this title never sent a nonzero trigger level in testing. #276 covers triggers behind `VICTORY_HAPTICS`. ## Tested on hardware DualSense over USB, firmware 0x0630, CachyOS + GE-Proton (viewtree), RTX 5080: rumble works. The log line `PlayStation gamepad: first rumble report sent` shows `bytes=48 written=47`. Unit tests cover the report, the write-length check and the firmware read. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01SEGb52ApL88uPMf5GhSz8K
A pad read over HID (VICTORY_DUALSENSE) got no rumble: set_rumble went
to XInput, which does not know the pad, and the impulse trigger levels a
title sends were dropped. They now go to the pad as output reports from
a writer thread: USB 0x02 and Bluetooth 0x31 (CRC-32) for the DualSense,
USB 0x05 for the DualShock 4. The trigger levels become a DualSense
trigger effect: zone vibration (VICTORY_DUALSENSE_TRIGGERS=vibration,
the default), light resistance turning into vibration (hybrid), or none
(off); VICTORY_DUALSENSE_TRIGGER_STRENGTH scales them and
VICTORY_DUALSENSE_RUMBLE=0 leaves the motors alone.

The report layouts, checksum, firmware check (feature 0x20, compatible
vibration 2 from 0x0224) and trigger effects are ported from Asem912's
Marvisak/VIctory#2337 as developed in aleksesipenko/VIctory-RTX.

Co-Authored-By: Asem912 <[email protected]>
Co-Authored-By: aleksesipenko <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SEGb52ApL88uPMf5GhSz8K
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This reverts commit 5a92a863b4.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 15:57:45 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 15:54 UTC · original

@⁠nullexxx USB rumble on the DualSense is confirmed by your run. Please keep the report-length handling narrow: a 48-byte report completing with 47 bytes under Wine is a specific case. DS4 and Bluetooth still need hardware coverage, and #276 already touches the same HID output path.

**@⁠TaynanGT** on GitHub · 2026-11-27 15:54 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/314#issuecomment-7222622475) @⁠nullexxx USB rumble on the DualSense is confirmed by your run. Please keep the report-length handling narrow: a 48-byte report completing with 47 bytes under Wine is a specific case. DS4 and Bluetooth still need hardware coverage, and #276 already touches the same HID output path.
github-bot changed title from Drive PlayStation pad rumble and DualSense adaptive triggers over HID to Rumble a USB DualSense read over HID 2026-11-27 16:11:36 +00:00
github-bot force-pushed github-bot/gh-314 from 40efed3df4 to ad795903ee 2026-11-27 16:11:37 +00:00 Compare
Author
Owner

@⁠nullexxx on GitHub · 2026-11-27 16:06 UTC · original

Thanks. I've narrowed it to what the hardware run covers:

  • USB DualSense rumble only. Bluetooth and the DualShock 4 are left as before until someone can test them.
  • Length check: a completed write counts only at the full length, or at the full length minus the report ID byte (48 completes as 47 under Proton). Anything else is logged once and retried.
  • Trigger code removed: pads declare two motors again (0x3), so it no longer overlaps #276's VICTORY_HAPTICS path. This title never sent a trigger level anyway.

Squashed into one commit on the current main.

**@⁠nullexxx** on GitHub · 2026-11-27 16:06 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/314#issuecomment-7222859304) Thanks. I've narrowed it to what the hardware run covers: - **USB DualSense rumble only.** Bluetooth and the DualShock 4 are left as before until someone can test them. - **Length check:** a completed write counts only at the full length, or at the full length minus the report ID byte (48 completes as 47 under Proton). Anything else is logged once and retried. - **Trigger code removed:** pads declare two motors again (0x3), so it no longer overlaps #276's `VICTORY_HAPTICS` path. This title never sent a trigger level anyway. Squashed into one commit on the current `main`.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 16:13 UTC · original

@⁠nullexxx The USB-only scope matches the hardware result. Accepting the full report and the 47-byte Proton completion covers the two known lengths, with other short writes kept visible. The two-motor path also gives us a clean test alongside #276's opt-in haptics.

**@⁠TaynanGT** on GitHub · 2026-11-27 16:13 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/314#issuecomment-7223001367) @⁠nullexxx The USB-only scope matches the hardware result. Accepting the full report and the 47-byte Proton completion covers the two known lengths, with other short writes kept visible. The two-motor path also gives us a clean test alongside #276's opt-in haptics.
github-bot changed target branch from main to gh-pr/314/base 2026-11-27 16:28:07 +00:00
github manually merged commit ad795903ee into gh-pr/314/base 2026-11-27 16:28:08 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.