Add native USB DualSense HD haptics on Windows #495

Open
github-bot wants to merge 3 commits from github-bot/gh-495 into main AGit
Owner

@⁠ForthtuN on GitHub · 2026-12-06 01:32 UTC · original
ForthtuN:feature/dualsense-usb-haptics → main · +872 −17 · 7 files · 3 commits · open

Summary

  • Sends the game's PadHaptics audio to the actuators of a native, wired DualSense via WASAPI, keeping the controller speaker silent.
  • Retains the existing L2/R2 effects. Bluetooth and unsupported or unavailable USB audio fall back to regular rumble.
  • Guards the mixer hook with the known title fingerprint and exact prologue. Ported from Darner v2026.12.04.01 (GPL-3.0-or-later), with source and attribution retained.
  • This is independent of the RCAS and adaptive effect/notch changes. The two controller PRs share the HID retry logic for reliable mode changes.

Validation

**@⁠ForthtuN** on GitHub · 2026-12-06 01:32 UTC · [original](https://github.com/gamingwithhomie/larp/pull/495) `ForthtuN:feature/dualsense-usb-haptics` → `main` · +872 −17 · 7 files · 3 commits · open ## Summary - Sends the game's PadHaptics audio to the actuators of a native, wired DualSense via WASAPI, keeping the controller speaker silent. - Retains the existing L2/R2 effects. Bluetooth and unsupported or unavailable USB audio fall back to regular rumble. - Guards the mixer hook with the known title fingerprint and exact prologue. Ported from Darner v2026.12.04.01 (GPL-3.0-or-later), with source and attribution retained. - This is independent of the RCAS and adaptive effect/notch changes. The two controller PRs share the HID retry logic for reliable mode changes. ## Validation - The author confirmed haptics worked in-game in the combined CNF 1.1.6 fork build. [Windows Release and regression tests passed on that build](https://github.com/ForthtuN/larp/actions/runs/47591269250). - This isolated PR was checked against current main; the linked CI run is for the combined fork, not this exact PR head.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-06 01:45:56 +00:00
Author
Owner

@⁠vanya890 on GitHub · 2026-12-06 01:39 UTC · original

One real-time concern: output_step() runs on the title's mixer thread, but take() enters the blocking RING_STATE mutex to copy each 256-frame haptics block. The WASAPI player also takes that mutex to pop/trim the ring. If the player is preempted while holding it, the game's mixer can wait on an optional haptics feature and potentially introduce audio glitches. Could the mixer side use try_lock and drop/count that haptics block on contention, or use an SPSC ring? Dropping a haptics frame is preferable to blocking the title's audio thread.

**@⁠vanya890** on GitHub · 2026-12-06 01:39 UTC · [original](https://github.com/gamingwithhomie/larp/pull/495#issuecomment-7449343049) One real-time concern: `output_step()` runs on the title's mixer thread, but `take()` enters the blocking `RING_STATE` mutex to copy each 256-frame haptics block. The WASAPI player also takes that mutex to pop/trim the ring. If the player is preempted while holding it, the game's mixer can wait on an optional haptics feature and potentially introduce audio glitches. Could the mixer side use `try_lock` and drop/count that haptics block on contention, or use an SPSC ring? Dropping a haptics frame is preferable to blocking the title's audio thread.
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/495/head:github-bot/gh-495'
git switch 'github-bot/gh-495'

Merge

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