feat(pad): bridge controller audio haptics to motor rumble #5448

Merged
joelfernandes23 merged 2 commits from upstream-pr/5448 into main 2026-10-14 12:43:54 +00:00
joelfernandes23 commented 2026-10-13 20:02:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by joelfernandes23 on 2026-10-13T20:02:25Z.


What

Convert controller vibration PCM into Xbox-compatible motor rumble when a DualSense audio device is absent. The two channels' RMS energy sets large/small motor intensity; near-silence is ignored and output expires after 80 ms. Regular vibration remains separate, with the stronger intensity used per motor on non-PS5 controllers. DualSense waveform routing and controller-speaker fallback are retained.

Supersedes closed #2467. Main already includes #2032's speaker muting; this adds the rumble bridge. No duplicate rumble implementation was found. The overlap bot flags #4789 (SDL initialization/include), #5021 (platform-specific audio library linking), and #5198 (captured PCM/gain in the mixer). These are independent changes; merge-order coordination with their authors is still pending. A separate local integration check reconciles both includes, retains libScePad in both platform link branches, and combines captured gain with haptic/speaker routing. This PR does not include those other implementations. Motor intensity approximates waveform energy and is peak-held while impulses remain active. Per-user/multi-controller routing follows the existing single-controller limitation.

Tested

  • Separate overlap integration on Windows GCC15.2: PR5448 + main 0aa4cb1c2 + PR4789 5031432db + PR5198 79dae11d1, with only PR5021 platform-link reconciliation, passed 12/12 audio/controller tests (6.04 s). A new integration-only regression verifies captured haptic PCM/gain drives motors without speaker leakage; bypassing captured gain fails and restoring it passes. This validation is not a build of the unchanged isolated PR head; Linux/macOS and new title gameplay were not tested.

  • Windows, MinGW-w64 GCC 15.2: 6/6 focused tests passed on today's current-main integration build: audio_out2_pad_mix, audio_out2_port_layouts, audio_out2_port_buffers, audio_out2_latency, audio_out2_timing and guest_pad (3.70 seconds). Bridge sources match that build after ignoring comments/whitespace. The integration includes separate 4K output edits and additional layout assertions excluded from this PR. The exact isolated contribution was not freshly rebuilt.

  • Earlier isolated rebase on main ba2a0a31 built audio/pad/video libraries and passed the same six tests.

  • Earlier Windows Silksong PPSA12544 01.000.010 gameplay on Ryzen 7700X/RX 7900 XT with an Xbox controller: the user confirmed working rumble. That was the earlier runtime; no new gameplay validation is claimed.

  • Contribution conventions and whitespace checks passed. Full suite, Linux and physical DualSense audio not tested. No proprietary files included.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • No new unimplemented paths or silent stubs
  • No notes, investigation files or images added to the repository
  • No new third-party code
  • Generic behaviour, not specific to one title
  • Depends on: none functionally; merge order for overlaps #4789, #5021 and #5198 is pending agreement with their authors.
  • Unblocks: none; restores controller feedback in PPSA12544
  • GPUs tested: none for this revision; VideoOut change is controller-output routing, with no GPU/shader changes. Earlier physical gameplay used AMD Radeon RX 7900 XT on Windows; driver version not recorded.
  • AI-assisted: yes, Codex
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4848766928 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5448). Originally posted by [joelfernandes23](https://github.com/joelfernandes23) on 2026-10-13T20:02:25Z. --- ### What Convert controller vibration PCM into Xbox-compatible motor rumble when a DualSense audio device is absent. The two channels' RMS energy sets large/small motor intensity; near-silence is ignored and output expires after 80 ms. Regular vibration remains separate, with the stronger intensity used per motor on non-PS5 controllers. DualSense waveform routing and controller-speaker fallback are retained. Supersedes closed #2467. Main already includes #2032's speaker muting; this adds the rumble bridge. No duplicate rumble implementation was found. The overlap bot flags #4789 (SDL initialization/include), #5021 (platform-specific audio library linking), and #5198 (captured PCM/gain in the mixer). These are independent changes; merge-order coordination with their authors is still pending. A separate local integration check reconciles both includes, retains libScePad in both platform link branches, and combines captured gain with haptic/speaker routing. This PR does not include those other implementations. Motor intensity approximates waveform energy and is peak-held while impulses remain active. Per-user/multi-controller routing follows the existing single-controller limitation. ### Tested - Separate overlap integration on Windows GCC15.2: PR5448 + main 0aa4cb1c2 + PR4789 5031432db + PR5198 79dae11d1, with only PR5021 platform-link reconciliation, passed 12/12 audio/controller tests (6.04 s). A new integration-only regression verifies captured haptic PCM/gain drives motors without speaker leakage; bypassing captured gain fails and restoring it passes. This validation is not a build of the unchanged isolated PR head; Linux/macOS and new title gameplay were not tested. - Windows, MinGW-w64 GCC 15.2: 6/6 focused tests passed on today's current-main integration build: audio_out2_pad_mix, audio_out2_port_layouts, audio_out2_port_buffers, audio_out2_latency, audio_out2_timing and guest_pad (3.70 seconds). Bridge sources match that build after ignoring comments/whitespace. The integration includes separate 4K output edits and additional layout assertions excluded from this PR. The exact isolated contribution was not freshly rebuilt. - Earlier isolated rebase on main ba2a0a31 built audio/pad/video libraries and passed the same six tests. - Earlier Windows Silksong PPSA12544 01.000.010 gameplay on Ryzen 7700X/RX 7900 XT with an Xbox controller: the user confirmed working rumble. That was the earlier runtime; no new gameplay validation is claimed. - Contribution conventions and whitespace checks passed. Full suite, Linux and physical DualSense audio not tested. No proprietary files included. ### Checklist - [x] Based on current main; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] No new unimplemented paths or silent stubs - [x] No notes, investigation files or images added to the repository - [x] No new third-party code - [x] Generic behaviour, not specific to one title - [x] Depends on: none functionally; merge order for overlaps #4789, #5021 and #5198 is pending agreement with their authors. - [x] Unblocks: none; restores controller feedback in PPSA12544 - [x] GPUs tested: none for this revision; VideoOut change is controller-output routing, with no GPU/shader changes. Earlier physical gameplay used AMD Radeon RX 7900 XT on Windows; driver version not recorded. - [x] AI-assisted: yes, Codex
joelfernandes23 commented 2026-10-13 21:16:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by joelfernandes23 on 2026-10-13T21:16:18Z.


Checked the overlap warning in a separate Windows Release integration using GCC 15.2: this PR at d182fe25f, main 0aa4cb1c2, #4789 at 5031432db, and #5198 at 79dae11d1. For #5021, I reconciled only its relevant CMake linking change, not its AOT implementation or dependency stack.

  • #4789: keep both AudioOutSdl.hpp and PadState.hpp includes; its initialization serialization and this rumble bridge are independent.
  • #5021: keep libScePad in both platform link branches, alongside libSceAgcDriver on Apple and SDL2-static elsewhere. Only the Windows branch was built.
  • #5198: retain captured PCM and captured volume while preserving this PR's haptic routing and controller-speaker fallback. Both accumulation calls must receive the captured volume.

All 12 audio/controller tests passed in 6.04 seconds. An integration-only regression snapshots haptic PCM, then overwrites the source buffer and sets gain to zero before Push: motors still receive the captured signal and the main output stays silent. Bypassing captured gain makes that regression fail; restoring it passes.

These changes remain on a local integration branch; this PR's source head is unchanged. Linux/macOS, physical controller output on this combined build, and new title gameplay were not tested.

Proposed merge order: keep this PR rumble-only and merge it first, with the other PRs retaining the reconciliation above when rebased. Would the authors of #4789, #5021 and #5198 prefer a different order? No functional dependency is required, but I will update Depends on once an order is agreed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6155360447 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5448#issuecomment-6155360447). Originally posted by [joelfernandes23](https://github.com/joelfernandes23) on 2026-10-13T21:16:18Z. --- Checked the overlap warning in a separate Windows Release integration using GCC 15.2: this PR at d182fe25f, main 0aa4cb1c2, #4789 at 5031432db, and #5198 at 79dae11d1. For #5021, I reconciled only its relevant CMake linking change, not its AOT implementation or dependency stack. - #4789: keep both AudioOutSdl.hpp and PadState.hpp includes; its initialization serialization and this rumble bridge are independent. - #5021: keep libScePad in both platform link branches, alongside libSceAgcDriver on Apple and SDL2-static elsewhere. Only the Windows branch was built. - #5198: retain captured PCM and captured volume while preserving this PR's haptic routing and controller-speaker fallback. Both accumulation calls must receive the captured volume. All 12 audio/controller tests passed in 6.04 seconds. An integration-only regression snapshots haptic PCM, then overwrites the source buffer and sets gain to zero before Push: motors still receive the captured signal and the main output stays silent. Bypassing captured gain makes that regression fail; restoring it passes. These changes remain on a local integration branch; this PR's source head is unchanged. Linux/macOS, physical controller output on this combined build, and new title gameplay were not tested. Proposed merge order: keep this PR rumble-only and merge it first, with the other PRs retaining the reconciliation above when rebased. Would the authors of #4789, #5021 and #5198 prefer a different order? No functional dependency is required, but I will update Depends on once an order is agreed.
adriadam10 commented 2026-10-14 11:48:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T11:48:41Z.


Checked on Linux (build + audio_out2_pad_mix, guest_pad and the rest of the audio/pad/video ctest scope, 61/61 after the rebase). The new tests need the new API, so they cannot pass without the change.

Added as our own commits on your branch:

  • Rebased onto main (include conflict with the SDL init helper in AudioOut2Context.cpp, both includes kept).
  • A Functional line in docs/dev/TechnicalDebt.md: the RMS-to-motor mapping (2x scale, 0.01 floor, 80 ms hold) approximates waveform energy and is not measured against console hardware.

Merging once the full Build (Windows) is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6167645757 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5448#issuecomment-6167645757). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T11:48:41Z. --- Checked on Linux (build + `audio_out2_pad_mix`, `guest_pad` and the rest of the audio/pad/video ctest scope, 61/61 after the rebase). The new tests need the new API, so they cannot pass without the change. Added as our own commits on your branch: - Rebased onto main (include conflict with the SDL init helper in `AudioOut2Context.cpp`, both includes kept). - A `Functional` line in `docs/dev/TechnicalDebt.md`: the RMS-to-motor mapping (2x scale, 0.01 floor, 80 ms hold) approximates waveform energy and is not measured against console hardware. Merging once the full Build (Windows) is green.
github-actions[bot] commented 2026-10-14 11:51:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T11:51:10Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#5021 core/libs/prx/libSceAudioOut/CMakeLists.txt L17
#5198 core/libs/prx/libSceAudioOut/src/AudioOut2Port.cpp L125-131
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6167688446 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5448#issuecomment-6167688446). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-14T11:51:10Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #5021 | `core/libs/prx/libSceAudioOut/CMakeLists.txt` [L17](https://github.com/boykopovar/AnyPS5/blob/b52356acca6ca6745d22264eb34e887a0ceaec08/core/libs/prx/libSceAudioOut/CMakeLists.txt#L17) | | | | #5198 | `core/libs/prx/libSceAudioOut/src/AudioOut2Port.cpp` [L125-131](https://github.com/boykopovar/AnyPS5/blob/b52356acca6ca6745d22264eb34e887a0ceaec08/core/libs/prx/libSceAudioOut/src/AudioOut2Port.cpp#L125-L131) | | |
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
boykopovar/AnyPS5!5448
No description provided.