fix(libSceAudioOut): fail a repeated sceAudioOut2Initialize and sceAudioOutInit as measured on a PS5 #11035

Merged
orezraey merged 1 commit from upstream-pr/11035 into main 2026-10-26 20:16:48 +00:00
orezraey commented 2026-10-25 14:39:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orezraey on 2026-10-25T14:39:56Z.


What

Repeated sceAudioOut2Initialize and sceAudioOutInit measured on a retail PS5 (firmware 13.60) with two homebrew probes calling libSceAudioOut.sprx from fresh payload processes, one per initialization order. No port is opened and no sound plays. The sources and console logs are in this gist (paoinit, paoinit2).

Both functions returned 0 on every call, and sceAudioOutInit just called sceAudioOut2Initialize. On the console:

Order Calls and results
AudioOut2 first (paoinit) sceAudioOut2Initialize 0, again 0x80268004; sceAudioOutInit 0; sceAudioOut2Initialize 0x80268004; sceAudioOutInit 0x8026000e
Legacy first (paoinit2) sceAudioOutInit 0; sceAudioOut2Initialize 0x80268004 twice; sceAudioOutInit 0x8026000e

In both orders sceAudioOut2GetSpeakerInfo then returns 0 and writes 0x50 bytes, as AnyPS5 already does.

So the two keep separate state: AudioOut2 fails once it is initialized, by either call, and the legacy call fails only on its own second call. AnyPS5 now does the same. sceAudioOut2InitializeEx and sceAudioOut2LoInit were not measured: they keep returning 0 and marking AudioOut2 initialized, and the debt entry now records that gap instead of the measured one.

Tested

Head 9925a9e401 on main 3a2c51afd2, Windows 11 Pro 26200, WinLibs GCC 15.2, Release.

  • audio_out2_latency follows the AudioOut2-first order and audio_out2_device_state the legacy-first order, each in its own process, with the console's results.
  • On the previous code both fail (the second calls returned 0).
  • The 43 audio_out* tests pass three runs in a row; no other test calls either function.
  • tools/check_conventions.py passes. Linux (WSL, same head 9925a9e401): the 47 audio_out* tests registered there pass three runs in a row.

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
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5005692613 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11035). Originally posted by [orezraey](https://github.com/orezraey) on 2026-10-25T14:39:56Z. --- ### What Repeated `sceAudioOut2Initialize` and `sceAudioOutInit` measured on a retail PS5 (firmware 13.60) with two homebrew probes calling `libSceAudioOut.sprx` from fresh payload processes, one per initialization order. No port is opened and no sound plays. The sources and console logs are in [this gist](https://gist.github.com/orezraey/90ad8091771385abf72dc8acde9f2f26) (`paoinit`, `paoinit2`). Both functions returned 0 on every call, and `sceAudioOutInit` just called `sceAudioOut2Initialize`. On the console: | Order | Calls and results | |---|---| | AudioOut2 first (`paoinit`) | `sceAudioOut2Initialize` 0, again `0x80268004`; `sceAudioOutInit` 0; `sceAudioOut2Initialize` `0x80268004`; `sceAudioOutInit` `0x8026000e` | | Legacy first (`paoinit2`) | `sceAudioOutInit` 0; `sceAudioOut2Initialize` `0x80268004` twice; `sceAudioOutInit` `0x8026000e` | In both orders `sceAudioOut2GetSpeakerInfo` then returns 0 and writes 0x50 bytes, as AnyPS5 already does. So the two keep separate state: AudioOut2 fails once it is initialized, by either call, and the legacy call fails only on its own second call. AnyPS5 now does the same. `sceAudioOut2InitializeEx` and `sceAudioOut2LoInit` were not measured: they keep returning 0 and marking AudioOut2 initialized, and the debt entry now records that gap instead of the measured one. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Head `9925a9e401` on `main` `3a2c51afd2`, Windows 11 Pro 26200, WinLibs GCC 15.2, Release. - `audio_out2_latency` follows the AudioOut2-first order and `audio_out2_device_state` the legacy-first order, each in its own process, with the console's results. - On the previous code both fail (the second calls returned 0). - The 43 `audio_out*` tests pass three runs in a row; no other test calls either function. - `tools/check_conventions.py` passes. Linux (WSL, same head `9925a9e401`): the 47 `audio_out*` tests registered there pass three runs in a row. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-25 15:02:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T15:02:53Z.

Review: APPROVED


Reviewed exact head 9925a9e401ac5fde5cf0fe7dd12b1b906f2f4263. The five changed production/test translation units pass GCC 12.2 syntax checking when using the repository SDL headers; git diff --check upstream/main...HEAD and conventions pass. The PR reports 43 focused AudioOut tests passing three times and PS5 firmware 13.60 observations for the two initialization APIs; the additional InitializeEx/LoInit repeated-call behavior remains explicitly unmeasured in the debt entry. Hosted product jobs are skipped by path policy, so the runtime suite was not independently run here. Search for open PRs by the changed API found no duplicate implementation.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5643780334 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11035#pullrequestreview-5643780334). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T15:02:53Z. **Review:** APPROVED --- Reviewed exact head `9925a9e401ac5fde5cf0fe7dd12b1b906f2f4263`. The five changed production/test translation units pass GCC 12.2 syntax checking when using the repository SDL headers; `git diff --check upstream/main...HEAD` and conventions pass. The PR reports 43 focused AudioOut tests passing three times and PS5 firmware 13.60 observations for the two initialization APIs; the additional `InitializeEx`/`LoInit` repeated-call behavior remains explicitly unmeasured in the debt entry. Hosted product jobs are skipped by path policy, so the runtime suite was not independently run here. Search for open PRs by the changed API found no duplicate implementation.
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!11035
No description provided.