libSceAudioOut: legacy vibration PCM succeeds without reaching controller output #6824

Closed
opened 2026-10-16 13:30:50 +00:00 by Amoenus · 3 comments
Amoenus commented 2026-10-16 13:30:50 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-16T13:30:50Z.


Summary

On main82ddae75b6761757f3d3ba9c0723647469270f76, legacy vibration port type10 accepts stereo S16/F32 PCM through sceAudioOutOutput and sceAudioOutOutputs, but does not pass it to controller output. Opening succeeds and output returns a nonnegative frame count; the pad audio-vibration state remains unchanged.

This is a CPU component finding, not a new game-startup or physical-controller result. I have not established that the public source revision below matches our owned dump.

Caller and code path

The public PPSA99902 input wrapper opens vibration type10 with256 stereo frames at48000Hz, first S16 then F32 if opening fails. After a successful open it accepts vibration mode1 and feeds sceAudioOutOutput; its compatible motor route is used when setup/output reports failure. This identifies a real API consumer in public source, not an observed stop in that exact build.

In legacy allocatePort, vibration ports deliberately receive no SDL device. Both legacy output entrypoints then take the virtual-port pacing path, update timing and return; no PCM reaches the existing pad output bridge. Why legacy routing was left out is not established; this is not attributed to a recent regression.

Merged #5448 (superseding closed #2467) bridges AudioOut2 PCM to motor state, and #180 adds AudioOut2 DualSense audio routing. Their changed implementations are AudioOut2*, not this legacy path. #2056 concerns the Bluetooth transport for AudioOut2 haptics; this is the earlier legacy-API handoff gap.

Reproduce

Test-only fork commitaa53ed390, branchcodex/repro-legacy-haptic-output-main82, adds a fixture/registration to main without production changes. These are intentionally failing regression expectations, not a proposed implementation.

cmake --build build --target audio_out_vibration_tests audio_out2_pad_mix_tests
ctest --test-dir build -V -j1 --timeout 5 -R '^audio_out_vibration_s16$'
ctest --test-dir build -V -j1 --timeout 5 -R '^audio_out_vibration_pad_control$'

Actual regression message: accepted legacy vibration PCM did not publish controller output.

Component case Windows Linux
Legacy single output, S16 stereo fails3/3 fails3/3
Legacy single output, F32 stereo fails3/3 fails3/3
Legacy batched output, S16 stereo fails3/3 fails3/3
Legacy batched output, F32 stereo fails3/3 fails3/3
Direct existing pad-output bridge control passes3/3 passes3/3
Existing AudioOut2 PCM/RMS helper fixture passes3/3 passes3/3

Windows11 Enterprise26200 / GCC15.2r7 and Ubuntu24.04/WSL2 / GCC13.3. All are fresh processes, maximum0.27s. Selected targets build, conventions/registration pass. No GPU, host-speaker or physical-controller validation is claimed.

Proposed fix and validation

PR #6860, from our focused fork branch, supplies native controller PCM routing and source-owned legacy RMS intervals. It uses frame count/rate, clears only the drained/closed port, and preserves AudioOut2's separate 80 ms hold and regular motor state. Wider layouts and device discovery/open failures throw.

Updated 2026-10-18: #6860 is rebased onto main 1c523bdb48 at a2d6c16bcd, with main's checked-size protection retained for both regular and expanded controller PCM. Full Windows/Linux builds pass. The preserved bf16a3f7f0 checkpoint repeats 37 Windows / 41 Linux audio-Pad groups three times (111 / 123 passes). A matched main-AudioOut.cpp producer control fails all eight nonzero output cases three times per OS at legacy vibration output published the wrong controller state; direct Pad and AudioOut2 controls pass. Exact restoration and full rebuild restore all 22 focused groups three times on each OS. All ten contribution files are unchanged by the final AMM-only main rebase, followed by 12 AMM/audio linkage passes per OS. Production-command analysis of six translation units has one existing byte-cast portability advisory, zero clang-tidy findings, and no parser errors. Exact scope and the retained independent review are in the updated PR description. Native controller hardware and public-source/dump revision identity remain unverified; no new game-frontier claim.

AI-assisted investigation, code and tests: Codex; builds/tests run locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5885031800 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6824). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-16T13:30:50Z. --- <!-- codex-legacy-vibration-main82 --> ### Summary On main`82ddae75b6761757f3d3ba9c0723647469270f76`, legacy vibration port type10 accepts stereo S16/F32 PCM through `sceAudioOutOutput` and `sceAudioOutOutputs`, but does not pass it to controller output. Opening succeeds and output returns a nonnegative frame count; the pad audio-vibration state remains unchanged. This is a CPU component finding, not a new game-startup or physical-controller result. I have not established that the public source revision below matches our owned dump. ### Caller and code path The public [PPSA99902 input wrapper](https://github.com/Nazky/UnleashedRecomp-Prospero/blob/2ce067a1d51bb58670c7ee4a3aed893c504da805/UnleashedRecomp/hid/driver/sdl_hid.cpp#L316) opens vibration type10 with256 stereo frames at48000Hz, first S16 then F32 if opening fails. After a successful open it accepts vibration mode1 and feeds `sceAudioOutOutput`; its compatible motor route is used when setup/output reports failure. This identifies a real API consumer in public source, not an observed stop in that exact build. In [legacy `allocatePort`](https://github.com/boykopovar/AnyPS5/blob/82ddae75b6761757f3d3ba9c0723647469270f76/core/libs/prx/libSceAudioOut/src/AudioOut.cpp#L303), vibration ports deliberately receive no SDL device. Both legacy output entrypoints then take the virtual-port pacing path, update timing and return; no PCM reaches the existing pad output bridge. Why legacy routing was left out is not established; this is not attributed to a recent regression. Merged #5448 (superseding closed #2467) bridges AudioOut2 PCM to motor state, and #180 adds AudioOut2 DualSense audio routing. Their changed implementations are `AudioOut2*`, not this legacy path. #2056 concerns the Bluetooth transport for AudioOut2 haptics; this is the earlier legacy-API handoff gap. ### Reproduce [Test-only fork commit`aa53ed390`](https://github.com/Amoenus/AnyPS5/commit/aa53ed390b3076dba9e35ee2f9a765ad341b9b78), branch`codex/repro-legacy-haptic-output-main82`, adds a fixture/registration to main without production changes. These are intentionally failing regression expectations, not a proposed implementation. ```sh cmake --build build --target audio_out_vibration_tests audio_out2_pad_mix_tests ctest --test-dir build -V -j1 --timeout 5 -R '^audio_out_vibration_s16$' ctest --test-dir build -V -j1 --timeout 5 -R '^audio_out_vibration_pad_control$' ``` Actual regression message: `accepted legacy vibration PCM did not publish controller output`. | Component case | Windows | Linux | | --- | --- | --- | | Legacy single output, S16 stereo | fails3/3 | fails3/3 | | Legacy single output, F32 stereo | fails3/3 | fails3/3 | | Legacy batched output, S16 stereo | fails3/3 | fails3/3 | | Legacy batched output, F32 stereo | fails3/3 | fails3/3 | | Direct existing pad-output bridge control | passes3/3 | passes3/3 | | Existing AudioOut2 PCM/RMS helper fixture | passes3/3 | passes3/3 | Windows11 Enterprise26200 / GCC15.2r7 and Ubuntu24.04/WSL2 / GCC13.3. All are fresh processes, maximum0.27s. Selected targets build, conventions/registration pass. No GPU, host-speaker or physical-controller validation is claimed. ### Proposed fix and validation [PR #6860](https://github.com/boykopovar/AnyPS5/pull/6860), from our [focused fork branch](https://github.com/Amoenus/AnyPS5/tree/codex/fix-legacy-haptic-output-main82), supplies native controller PCM routing and source-owned legacy RMS intervals. It uses frame count/rate, clears only the drained/closed port, and preserves AudioOut2's separate 80 ms hold and regular motor state. Wider layouts and device discovery/open failures throw. **Updated 2026-10-18:** #6860 is rebased onto main `1c523bdb48` at [`a2d6c16bcd`](https://github.com/Amoenus/AnyPS5/commit/a2d6c16bcde01b749993cc04fb50919307cad5a7), with main's checked-size protection retained for both regular and expanded controller PCM. Full Windows/Linux builds pass. The preserved [`bf16a3f7f0` checkpoint](https://github.com/Amoenus/AnyPS5/commit/bf16a3f7f04eb5176f227c0793520be927789a00) repeats 37 Windows / 41 Linux audio-Pad groups three times (111 / 123 passes). A matched main-`AudioOut.cpp` producer control fails all eight nonzero output cases three times per OS at `legacy vibration output published the wrong controller state`; direct Pad and AudioOut2 controls pass. Exact restoration and full rebuild restore all 22 focused groups three times on each OS. All ten contribution files are unchanged by the final AMM-only main rebase, followed by 12 AMM/audio linkage passes per OS. Production-command analysis of six translation units has one existing byte-cast portability advisory, zero clang-tidy findings, and no parser errors. Exact scope and the retained independent review are in the updated PR description. Native controller hardware and public-source/dump revision identity remain unverified; no new game-frontier claim. AI-assisted investigation, code and tests: Codex; builds/tests run locally.
MarcZX10 commented 2026-10-16 13:43:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T13:43:29Z.


The report establishes the legacy type-10 routing gap, and the existing AudioOut2 bridge gives us an implementation reference. Before a production fix, I think the duration contract needs one more piece: PadSubmitAudioHaptics currently holds a nonzero value for 80 ms after a submission, while legacy calls may use arbitrary frame counts/rates and may send ptr == nullptr to drain. Would you expect legacy output to reuse AudioOut2’s per-grain RMS/80 ms behavior, or should output duration track the submitted block and explicitly clear on drain? The current fixture checks a hard-coded 128/255 after one block, which demonstrates the missing handoff but not a specified mapping.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6216826381 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6824#issuecomment-6216826381). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T13:43:29Z. --- The report establishes the legacy type-10 routing gap, and the existing AudioOut2 bridge gives us an implementation reference. Before a production fix, I think the duration contract needs one more piece: `PadSubmitAudioHaptics` currently holds a nonzero value for 80 ms after a submission, while legacy calls may use arbitrary frame counts/rates and may send `ptr == nullptr` to drain. Would you expect legacy output to reuse AudioOut2’s per-grain RMS/80 ms behavior, or should output duration track the submitted block and explicitly clear on drain? The current fixture checks a hard-coded 128/255 after one block, which demonstrates the missing handoff but not a specified mapping.
MarcZX10 commented 2026-10-16 13:54:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T13:54:08Z.


I opened #6839 for the legacy type-10 vibration route. It sends mono/stereo S16/F32 blocks through the existing AudioOut2 pad mix/RMS conversion, applies the legacy volume and mix level, and covers both single and batched output calls. It intentionally uses the existing 80 ms controller haptic hold behavior; tests pass locally with a temporary host CPU guard bypass because this machine lacks the PS5-required CPU features. The PR does not claim physical-controller validation.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6217032984 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6824#issuecomment-6217032984). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T13:54:08Z. --- I opened #6839 for the legacy type-10 vibration route. It sends mono/stereo S16/F32 blocks through the existing AudioOut2 pad mix/RMS conversion, applies the legacy volume and mix level, and covers both single and batched output calls. It intentionally uses the existing 80 ms controller haptic hold behavior; tests pass locally with a temporary host CPU guard bypass because this machine lacks the PS5-required CPU features. The PR does not claim physical-controller validation.
Amoenus commented 2026-10-16 13:56:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-16T13:56:26Z.


@MarcZX100 The duration/ownership work is now in #6860, with the focused code pushed to our fork. Thank you for withdrawing #6839 to avoid parallel implementations.

The deterministic model verifies a 256-frame/48 kHz interval of 5,333 us and a 4,800-frame/24 kHz interval of 200,000 us, exact expiry boundaries, silent grains and independent sources. The producer fixture checks those frame-derived intervals, separate grain energies, drain waiting and per-port close. The actual Pad fixture confirms that clearing legacy output preserves both AudioOut2's existing 80 ms state and regular motor requests.

Both OS builds and repeated focused tests pass; the PR holds exact source pins and the additional current-main Linux linkage validation. These establish the documented host model, not console waveform semantics or physical-controller output. The original 128/255 handoff control remains only an existing-RMS mapping control.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6217076680 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6824#issuecomment-6217076680). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-16T13:56:26Z. --- @MarcZX100 The duration/ownership work is now in [#6860](https://github.com/boykopovar/AnyPS5/pull/6860), with the focused code pushed to our fork. Thank you for withdrawing #6839 to avoid parallel implementations. The deterministic model verifies a 256-frame/48 kHz interval of 5,333 us and a 4,800-frame/24 kHz interval of 200,000 us, exact expiry boundaries, silent grains and independent sources. The producer fixture checks those frame-derived intervals, separate grain energies, drain waiting and per-port close. The actual Pad fixture confirms that clearing legacy output preserves both AudioOut2's existing 80 ms state and regular motor requests. Both OS builds and repeated focused tests pass; the PR holds exact source pins and the additional current-main Linux linkage validation. These establish the documented host model, not console waveform semantics or physical-controller output. The original 128/255 handoff control remains only an existing-RMS mapping control.
Sign in to join this conversation.
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#6824
No description provided.