Rumble a USB DualSense read over HID #314

Merged
nullexxx merged 1 commit from upstream-pr/314 into main 2026-11-27 16:26:16 +00:00
nullexxx commented 2026-11-27 15:44:46 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by nullexxx on 2026-11-27T15:44:46Z.


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

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5529351792 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/314). Originally posted by [nullexxx](https://github.com/nullexxx) on 2026-11-27T15:44:46Z. --- 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
TaynanGT commented 2026-11-27 15:54:21 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T15:54:21Z.


@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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7222622475 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/314#issuecomment-7222622475). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T15:54:21Z. --- @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.
nullexxx commented 2026-11-27 16:06:12 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by nullexxx on 2026-11-27T16:06:12Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7222859304 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/314#issuecomment-7222859304). Originally posted by [nullexxx](https://github.com/nullexxx) on 2026-11-27T16:06:12Z. --- 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`.
TaynanGT commented 2026-11-27 16:13:19 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T16:13:19Z.


@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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7223001367 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/314#issuecomment-7223001367). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T16:13:19Z. --- @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.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
TaynanGT/Vice-Tay!314
No description provided.