fix(libSceAudioOut): return 0 from sceAudioOut2LoTerminate and forward sceAudioOut2InitializeEx #9032

Merged
hypermoist merged 2 commits from upstream-pr/9032 into main 2026-10-22 20:43:36 +00:00
hypermoist commented 2026-10-21 10:10:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hypermoist on 2026-10-21T10:10:46Z.


What

Two AudioOut2 calls threw:

Export (NID, address in the decrypted PS5 12.00 libSceAudioOut) Console Here
sceAudioOut2LoTerminate (QuAWXdMHi88, 0x248d0) Runs the low-latency service's stop routine, then returns 0 unconditionally. The routine returns early when the service is not running; otherwise it disconnects from the audio server, frees the service tables and clears the initialized state Returns 0. sceAudioOut2LoInit here is sceAudioOut2Initialize and starts no service, so there is nothing to stop. Open contexts and ports are left as they are, and the call is listed under a new Silent stubs section in the debt file
sceAudioOut2InitializeEx (3livsiq3ji4, 0x2a640) Stores its 32-bit argument in a module global and continues into sceAudioOut2Initialize (0x2a650) Takes the argument, ignores it and returns sceAudioOut2Initialize(). The argument's meaning stays in the debt file

The code is written from the observed behaviour; nothing from the module is copied.

Tested

Linux (CachyOS, GCC, Release). audio_out2_latency asserted that sceAudioOut2LoTerminate throws. It now checks that the call returns 0 twice in a row, and that sceAudioOut2InitializeEx returns 0 for arguments 0 and 1. All 41 audio_out* tests pass.

tools/check_conventions.py is clean. Three-way merges with the open PRs touching these five files add no conflicts in the code or tests (#1384, #5021, #5965, #6879, #8098, #8525, #8652, #8693, and my #9023 and #9027). The exception is the debt file: #8525 and #8652 also create the ### Silent stubs section at the top of libSceAudioOut.md. Whichever lands second keeps the header once and both entries.

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 known; neither call is imported by my three title dumps
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4949900661 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9032). Originally posted by [hypermoist](https://github.com/hypermoist) on 2026-10-21T10:10:46Z. --- ### What Two AudioOut2 calls threw: | Export (NID, address in the decrypted PS5 12.00 `libSceAudioOut`) | Console | Here | |---|---|---| | `sceAudioOut2LoTerminate` (`QuAWXdMHi88`, 0x248d0) | Runs the low-latency service's stop routine, then returns 0 unconditionally. The routine returns early when the service is not running; otherwise it disconnects from the audio server, frees the service tables and clears the initialized state | Returns 0. `sceAudioOut2LoInit` here is `sceAudioOut2Initialize` and starts no service, so there is nothing to stop. Open contexts and ports are left as they are, and the call is listed under a new Silent stubs section in the debt file | | `sceAudioOut2InitializeEx` (`3livsiq3ji4`, 0x2a640) | Stores its 32-bit argument in a module global and continues into `sceAudioOut2Initialize` (0x2a650) | Takes the argument, ignores it and returns `sceAudioOut2Initialize()`. The argument's meaning stays in the debt file | The code is written from the observed behaviour; nothing from the module is copied. ### Tested Linux (CachyOS, GCC, Release). `audio_out2_latency` asserted that `sceAudioOut2LoTerminate` throws. It now checks that the call returns 0 twice in a row, and that `sceAudioOut2InitializeEx` returns 0 for arguments 0 and 1. All 41 `audio_out*` tests pass. `tools/check_conventions.py` is clean. Three-way merges with the open PRs touching these five files add no conflicts in the code or tests (#1384, #5021, #5965, #6879, #8098, #8525, #8652, #8693, and my #9023 and #9027). The exception is the debt file: #8525 and #8652 also create the `### Silent stubs` section at the top of `libSceAudioOut.md`. Whichever lands second keeps the header once and both entries. ### 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](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 known; neither call is imported by my three title dumps - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
github-actions[bot] commented 2026-10-21 10:12:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T10:12:13Z.


Progress report (2abfb1b → e0f3e86)

📈 System libraries: 49.69% (+0.03%, +2 implemented functions)

✅ 2 implemented
Library Name
libSceAudioOut sceAudioOut2InitializeEx
libSceAudioOut sceAudioOut2LoTerminate
⚪ 1 behaviourally empty (constant return or throw)
Library Name
libSceAudioOut sceAudioOut2LoTerminate
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6313471130 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9032#issuecomment-6313471130). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T10:12:13Z. --- <!-- progress-report --> ### Progress report (2abfb1b → e0f3e86) 📈 **System libraries**: 49.69% (+0.03%, +2 implemented functions) <details> <summary>✅ 2 implemented</summary> | Library | Name | | - | - | | libSceAudioOut | `sceAudioOut2InitializeEx` | | libSceAudioOut | `sceAudioOut2LoTerminate` | </details> <details> <summary>⚪ 1 behaviourally empty (constant return or throw)</summary> | Library | Name | | - | - | | libSceAudioOut | `sceAudioOut2LoTerminate` | </details>
github-actions[bot] commented 2026-10-21 10:33:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T10:33:00Z.


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
PR 8525 docs/dev/debt/libSceAudioOut.md L2

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5021 docs/dev/debt/libSceAudioOut.md
PR 8652 core/libs/prx/libSceAudioOut/src/Unimplemented.cpp
docs/dev/debt/libSceAudioOut.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6313839264 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9032#issuecomment-6313839264). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T10:33:00Z. --- <!-- 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 | |---|---|---|---| | [PR 8525](https://www.github.com/boykopovar/AnyPS5/pull/8525) | `docs/dev/debt/libSceAudioOut.md` [L2](https://github.com/boykopovar/AnyPS5/blob/d6eafa54d0464258574fd2f71889754d05a5bc93/docs/dev/debt/libSceAudioOut.md#L2) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `docs/dev/debt/libSceAudioOut.md` | | [PR 8652](https://www.github.com/boykopovar/AnyPS5/pull/8652) | `core/libs/prx/libSceAudioOut/src/Unimplemented.cpp`<br>`docs/dev/debt/libSceAudioOut.md` |
xXPBSXx commented 2026-10-21 13:43:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T13:43:59Z.


Linux data point for e0f3e860a2: WSL2 Ubuntu 24.04 (virtualised kernel, not bare-metal Linux), GCC 13.3.0, Release, BUILD_TESTING=ON, PR head alone (not merged onto main) (its merge-base is 27c88a8d7).

  • With the PR: ctest -R '^audio_out2_latency$' passes 3 of 3.
  • With the production files of the PR restored to the merge-base (AudioOut2Low.cpp, AudioOut2System.cpp and Unimplemented.cpp (libSceAudioOut/src); the PR's tests kept): fails (Subprocess aborted).
    Not tested: macOS, Windows, a title run.
    AI-assisted (Claude Code).
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6317609541 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9032#issuecomment-6317609541). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-21T13:43:59Z. --- Linux data point for `e0f3e860a2`: WSL2 Ubuntu 24.04 (virtualised kernel, not bare-metal Linux), GCC 13.3.0, Release, `BUILD_TESTING=ON`, PR head alone (not merged onto `main`) (its merge-base is `27c88a8d7`). - With the PR: `ctest -R '^audio_out2_latency$'` passes 3 of 3. - With the production files of the PR restored to the merge-base (`AudioOut2Low.cpp, AudioOut2System.cpp and Unimplemented.cpp (libSceAudioOut/src)`; the PR's tests kept): fails (`Subprocess aborted`). Not tested: macOS, Windows, a title run. AI-assisted (Claude Code).
hypermoist commented 2026-10-22 09:10:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hypermoist on 2026-10-22T09:10:11Z.


@xXPBSXx thanks for the Linux run, and for the control that restores the production files: it shows the test fails without the change (aborts) and passes with it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6337083916 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9032#issuecomment-6337083916). Originally posted by [hypermoist](https://github.com/hypermoist) on 2026-10-22T09:10:11Z. --- @xXPBSXx thanks for the Linux run, and for the control that restores the production files: it shows the test fails without the change (aborts) and passes with it.
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!9032
No description provided.