Input: read PS5 DualSense pads directly over HID #420

Open
github-bot wants to merge 1 commit from github-bot/gh-420 into a-publier AGit
Owner

@⁠RenzoraEngine on GitHub · 2026-11-27 00:39 UTC · original
RenzoraEngine:dualsense-support → a-publier · +643 −14 · 5 files · 1 commits · open

## What

PS5 DualSense and DualSense Edge pads are read straight from HID, so they work without Steam Input or DS4Windows turning them into XInput pads.

  • USB and Bluetooth. Over Bluetooth, the calibration feature report is requested so the pad sends full 0x31 reports. The short 0x01 form is still parsed until then.
  • DualSense pads fill the host pad slots XInput leaves empty, in the order they were connected. A real Xbox pad keeps its slot.
  • Mapping by position: Cross is A, Circle B, Square X, Triangle Y. L1/R1 are the shoulders, L2/R2 the triggers, L3/R3 the stick clicks. Options is Menu; Create and the touchpad click are View.
  • Rumble goes out as output reports: report 0x02 over USB, and 0x31 with a CRC-32 over Bluetooth. It is only written when the motor speeds change.
  • Enumeration runs on a thread of its own every 2 s, and each pad has its own reader thread, so the hub's 8 ms poll never waits on SetupAPI or HID reads.
  • VICTORY_DUALSENSE=0 turns it off, for hosts where Steam Input or DS4Windows already exposes the pad as XInput, where it would otherwise be seen twice.

Also: scripts\play.ps1 -SeriesS passes --console series-s.

No new dependencies. The change only enables the Win32_Devices_HumanInterfaceDevice and Win32_Devices_DeviceAndDriverInstallation features of the existing windows-sys.

Testing

  • cargo test -p victory-hle --lib gameinput: 15 passed. Five of them are new, covering USB, Bluetooth full and short reports, skipped report kinds, and the rumble reports with their CRC.
  • cargo test -p victory-hle real_dualsense -- --ignored --nocapture against a DualSense on USB: reports read, sticks at rest within ±0.05 of center, rumble command sent.
  • The title ran with the Series S profile, and the log shows DualSense connected product=0ce6.
  • cargo clippy -p victory-hle: no warnings in the changed code.
**@⁠RenzoraEngine** on GitHub · 2026-11-27 00:39 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/420) `RenzoraEngine:dualsense-support` → `a-publier` · +643 −14 · 5 files · 1 commits · open ## What PS5 DualSense and DualSense Edge pads are read straight from HID, so they work without Steam Input or DS4Windows turning them into XInput pads. - USB and Bluetooth. Over Bluetooth, the calibration feature report is requested so the pad sends full `0x31` reports. The short `0x01` form is still parsed until then. - DualSense pads fill the host pad slots XInput leaves empty, in the order they were connected. A real Xbox pad keeps its slot. - Mapping by position: Cross is A, Circle B, Square X, Triangle Y. L1/R1 are the shoulders, L2/R2 the triggers, L3/R3 the stick clicks. Options is Menu; Create and the touchpad click are View. - Rumble goes out as output reports: report `0x02` over USB, and `0x31` with a CRC-32 over Bluetooth. It is only written when the motor speeds change. - Enumeration runs on a thread of its own every 2 s, and each pad has its own reader thread, so the hub's 8 ms poll never waits on SetupAPI or HID reads. - `VICTORY_DUALSENSE=0` turns it off, for hosts where Steam Input or DS4Windows already exposes the pad as XInput, where it would otherwise be seen twice. Also: `scripts\play.ps1 -SeriesS` passes `--console series-s`. No new dependencies. The change only enables the `Win32_Devices_HumanInterfaceDevice` and `Win32_Devices_DeviceAndDriverInstallation` features of the existing `windows-sys`. ## Testing - `cargo test -p victory-hle --lib gameinput`: 15 passed. Five of them are new, covering USB, Bluetooth full and short reports, skipped report kinds, and the rumble reports with their CRC. - `cargo test -p victory-hle real_dualsense -- --ignored --nocapture` against a DualSense on USB: reports read, sticks at rest within ±0.05 of center, rumble command sent. - The title ran with the Series S profile, and the log shows `DualSense connected product=0ce6`. - `cargo clippy -p victory-hle`: no warnings in the changed code.
DualSense and DualSense Edge pads (USB and Bluetooth) are found over HID and fill the host pad slots XInput leaves empty, so they work without Steam Input or DS4Windows. Rumble is sent as output reports (CRC-signed over Bluetooth). VICTORY_DUALSENSE=0 turns it off.

scripts\play.ps1 gains -SeriesS for the Series S console profile.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:59:40 +00:00
Author
Owner

@⁠B0pol on GitHub · 2026-11-27 01:35 UTC · original

confirm it worked for me on linux (rumble not tested)

**@⁠B0pol** on GitHub · 2026-11-27 01:35 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/420#issuecomment-7207418008) confirm it worked for me on linux (rumble not tested)
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-27 02:22 UTC · original

Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At aa8ac1c: cargo test --release -p victory-hle --lib 167 passed, 0 failed, 3 ignored. No DualSense attached, so the HID path itself is not exercised.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-27 02:22 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/420#issuecomment-7208066237) Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At `aa8ac1c`: `cargo test --release -p victory-hle --lib` 167 passed, 0 failed, 3 ignored. No DualSense attached, so the HID path itself is not exercised. AI-assisted (Claude Code); no game data.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/420/head:github-bot/gh-420'
git switch 'github-bot/gh-420'

Merge

Merge the changes and update on Forgejo.
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-420'
git switch 'github-bot/gh-420'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-420'
git switch 'github-bot/gh-420'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-420'
git switch 'a-publier'
git merge --squash 'github-bot/gh-420'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-420'
git switch 'a-publier'
git merge 'github-bot/gh-420'
git push origin 'a-publier'
This discussion has been locked. Commenting is limited to contributors.
No description provided.