Skip to content

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

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
joelfernandes23:fix/pad-audio-rumble-20261013
Oct 14, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
joelfernandes23:fix/pad-audio-rumble-20261013

Conversation

@joelfernandes23

@joelfernandes23 joelfernandes23 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

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 0aa4cb1 + PR4789 5031432 + PR5198 79dae11, 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 ba2a0a3 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

@joelfernandes23

Copy link
Copy Markdown
Contributor Author

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

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.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 14, 2026
@adriadam10 adriadam10 self-assigned this Oct 14, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

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.

@adriadam10
adriadam10 force-pushed the fix/pad-audio-rumble-20261013 branch from d182fe2 to 7956950 Compare October 14, 2026 11:48
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

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

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 14, 2026
@adriadam10
adriadam10 merged commit 3bbfc60 into boykopovar:main Oct 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants