feat(libSceAudioOut): return 0 from sceAudioOutSetMainOutput like the firmware stub #8652

Merged
nikowolf123 merged 2 commits from upstream-pr/8652 into main 2026-10-26 07:35:31 +00:00
nikowolf123 commented 2026-10-20 20:04:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nikowolf123 on 2026-10-20T20:04:39Z.


What

sceAudioOutSetMainOutput (NID KI9cl22to7E) now returns 0 and does nothing, for any arguments. Until now it threw sceAudioOutSetMainOutput not implemented. It has no error path and writes no output.

The source is the symbol survey of firmware 12.70's libSceAudioOut.sprx in PS5-Audio-Passthrough-Research, docs/FINDINGS.md L25, which lists this export as "yes, but it is a stub: xor eax,eax; ret". That body reads no argument register, writes no memory, calls nothing and returns 0. The row is unchanged at the repository's latest commit (c3be9c2, L25), and docs/dev/debt/libSceAudioOut.md already cites the same document for sceAudioOutExOpen, sceAudioOutExConfigureOutput, sceAudioOutExClose and sceAudioOutSysGetHdmiMonitorInfo. compute_nid("sceAudioOutSetMainOutput") in tools/nid_names.py gives KI9cl22to7E, the NID in that row.

  • The stub is removed from src/Unimplemented.cpp, and the function is defined in src/AudioOut.cpp after sceAudioOutSysOpen. It stays declared without parameters: the export reads none, so whatever a caller passes is ignored.
  • Unverified: the parameter list, since the export reads no argument, and the body on firmware other than 12.70. Both are recorded in docs/dev/debt/libSceAudioOut.md under a new Silent stubs section, which replaces the function's "unknown signature" line under Unknown function info. tools/check_conventions.py requires that listing for an export whose body is a constant return: on a probe commit without the entry it reports [silent-stub] ... sceAudioOutSetMainOutput.
  • The progress report will list the function as implemented and as behaviourally empty (constant return), which is what the firmware body is.
  • #8525 (for sceAudioOutMasteringTerm) and #9032 (for sceAudioOut2LoTerminate) also add a ### Silent stubs section at the top of docs/dev/debt/libSceAudioOut.md. Whichever of them merges later conflicts there and needs a rebase that keeps all entries under one heading. As of 2026-10-21, no other open pull request's diff mentions sceAudioOutSetMainOutput or KI9cl22to7E.

Tested

Linux: WSL2 Ubuntu 26.04, GCC 15.2.0 (Ubuntu 15.2.0-16ubuntu1), Release. I built the libSceAudioOut and audio_out_sys_tests targets and ran ctest -R '^audio_out_sys$' --output-on-failure --timeout 120:

  • This branch, on main 434e965d4, and again at d16be88e3 on main 2c4b116da: audio_out_sys passes (1/1).
  • The test change alone on the same main, where the function still throws "not implemented": audio_out_sys fails with failed: sceAudioOutSetMainOutput does not throw and failed: sceAudioOutSetMainOutput returns 0, and no other check fails.
  • tools/check_conventions.py --base origin/main passes, also with --title and --body.
  • tools/progress.py --module libSceAudioOut on main 2c4b116da: done goes from 59 to 60 and todo from 86 to 85; the only newly done function is sceAudioOutSetMainOutput.

Windows: not built. No title was run.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4941740512 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8652). Originally posted by [nikowolf123](https://github.com/nikowolf123) on 2026-10-20T20:04:39Z. --- ### What `sceAudioOutSetMainOutput` (NID `KI9cl22to7E`) now returns 0 and does nothing, for any arguments. Until now it threw `sceAudioOutSetMainOutput not implemented`. It has no error path and writes no output. The source is the symbol survey of firmware 12.70's `libSceAudioOut.sprx` in [PS5-Audio-Passthrough-Research, `docs/FINDINGS.md` L25](https://github.com/sainsaji/PS5-Audio-Passthrough-Research/blob/cf3c921d79bf00db4847f31b68a7bd95a8037cd7/docs/FINDINGS.md#L25), which lists this export as "yes, but it is a stub: `xor eax,eax; ret`". That body reads no argument register, writes no memory, calls nothing and returns 0. The row is unchanged at the repository's latest commit ([c3be9c2, L25](https://github.com/sainsaji/PS5-Audio-Passthrough-Research/blob/c3be9c2afcb8f7838784ead0fe1c12a2ceea965a/docs/FINDINGS.md#L25)), and `docs/dev/debt/libSceAudioOut.md` already cites the same document for `sceAudioOutExOpen`, `sceAudioOutExConfigureOutput`, `sceAudioOutExClose` and `sceAudioOutSysGetHdmiMonitorInfo`. `compute_nid("sceAudioOutSetMainOutput")` in `tools/nid_names.py` gives `KI9cl22to7E`, the NID in that row. - The stub is removed from `src/Unimplemented.cpp`, and the function is defined in `src/AudioOut.cpp` after `sceAudioOutSysOpen`. It stays declared without parameters: the export reads none, so whatever a caller passes is ignored. - Unverified: the parameter list, since the export reads no argument, and the body on firmware other than 12.70. Both are recorded in `docs/dev/debt/libSceAudioOut.md` under a new Silent stubs section, which replaces the function's "unknown signature" line under Unknown function info. `tools/check_conventions.py` requires that listing for an export whose body is a constant return: on a probe commit without the entry it reports `[silent-stub] ... sceAudioOutSetMainOutput`. - The progress report will list the function as implemented and as behaviourally empty (constant return), which is what the firmware body is. - #8525 (for `sceAudioOutMasteringTerm`) and #9032 (for `sceAudioOut2LoTerminate`) also add a `### Silent stubs` section at the top of `docs/dev/debt/libSceAudioOut.md`. Whichever of them merges later conflicts there and needs a rebase that keeps all entries under one heading. As of 2026-10-21, no other open pull request's diff mentions `sceAudioOutSetMainOutput` or `KI9cl22to7E`. ### 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. --> Linux: WSL2 Ubuntu 26.04, GCC 15.2.0 (Ubuntu 15.2.0-16ubuntu1), Release. I built the `libSceAudioOut` and `audio_out_sys_tests` targets and ran `ctest -R '^audio_out_sys$' --output-on-failure --timeout 120`: - This branch, on `main` 434e965d4, and again at d16be88e3 on `main` 2c4b116da: `audio_out_sys` passes (1/1). - The test change alone on the same `main`, where the function still throws "not implemented": `audio_out_sys` fails with `failed: sceAudioOutSetMainOutput does not throw` and `failed: sceAudioOutSetMainOutput returns 0`, and no other check fails. - `tools/check_conventions.py --base origin/main` passes, also with `--title` and `--body`. - `tools/progress.py --module libSceAudioOut` on `main` 2c4b116da: done goes from 59 to 60 and todo from 86 to 85; the only newly done function is `sceAudioOutSetMainOutput`. Windows: not built. No title was run. ### 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: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ycbuzi commented 2026-10-21 07:35:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T07:35:15Z.


Windows run of 18088be5c0 merged onto main b77bd58806 (8e72e4cb0a, clean), the build the description lists as not done. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release, BUILD_TESTING=ON.

Built libSceAudioOut and audio_out_sys_tests with no errors or warnings; ctest --repeat until-fail:2 on audio_out_sys: passes on both repeats. Not run: the negative control against main's library, a title.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6310652347 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8652#issuecomment-6310652347). Originally posted by [ycbuzi](https://github.com/ycbuzi) on 2026-10-21T07:35:15Z. --- Windows run of 18088be5c0 merged onto `main` b77bd58806 (8e72e4cb0a, clean), the build the description lists as not done. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release, `BUILD_TESTING=ON`. Built `libSceAudioOut` and `audio_out_sys_tests` with no errors or warnings; `ctest --repeat until-fail:2` on `audio_out_sys`: passes on both repeats. Not run: the negative control against `main`'s library, a title.
xdCloudy commented 2026-10-22 02:16:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xdCloudy on 2026-10-22T02:16:14Z.


@nikowolf123 — Marc's review on #9541 found shared AudioOut implementation/debt paths, though the exports are distinct. #9027's author agreed that #9027 should land before #9541. Would you also agree to land #8652 before #9541? I'll keep #9541 in draft until the order is settled.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6331069836 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8652#issuecomment-6331069836). Originally posted by [xdCloudy](https://github.com/xdCloudy) on 2026-10-22T02:16:14Z. --- @nikowolf123 — Marc's review on #9541 found shared AudioOut implementation/debt paths, though the exports are distinct. #9027's author agreed that #9027 should land before #9541. Would you also agree to land #8652 before #9541? I'll keep #9541 in draft until the order is settled.
harisibrar1 commented 2026-10-24 15:35:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T15:35:03Z.

Review: COMMENTED


Checked against main b607bfdc8b and PS5-Audio-Passthrough-Research FINDINGS.md at cf3c921 and c3be9c2:

  • The source holds up: L25 is in the "Symbol survey" table of exports from the firmware 12.70 libSceAudioOut.sprx (not the payload-SDK stub mentioned separately) and reads xor eax,eax; ret. KI9cl22to7E matches the name, and main still throws for it (Unimplemented.cpp:130), so returning 0 matches the firmware body rather than being a made-up success.
  • The branch no longer merges cleanly; git merge-tree against main shows two conflicts:
    • AudioOut.cpp: main changed the next function to sceAudioOutSetMixLevelPadSpk(int handle, std::uint32_t mixLevel) (AudioOut.cpp:654), so please keep that signature when resolving.
    • docs/dev/debt/libSceAudioOut.md: #8525 and #9032 have landed their ### Silent stubs entries, as your description anticipated, so this entry can go into that existing section.
  • Optional: the survey row gives no text offset for this export, unlike other entries in that document. The debt line could say this is the survey's disassembly reading rather than a console measurement.

Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638802880 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8652#pullrequestreview-5638802880). Originally posted by [harisibrar1](https://github.com/harisibrar1) on 2026-10-24T15:35:03Z. **Review:** COMMENTED --- Checked against main b607bfdc8b and PS5-Audio-Passthrough-Research FINDINGS.md at cf3c921 and c3be9c2: - The source holds up: L25 is in the "Symbol survey" table of exports from the firmware 12.70 `libSceAudioOut.sprx` (not the payload-SDK stub mentioned separately) and reads `xor eax,eax; ret`. KI9cl22to7E matches the name, and main still throws for it (Unimplemented.cpp:130), so returning 0 matches the firmware body rather than being a made-up success. - The branch no longer merges cleanly; `git merge-tree` against main shows two conflicts: - `AudioOut.cpp`: main changed the next function to `sceAudioOutSetMixLevelPadSpk(int handle, std::uint32_t mixLevel)` (AudioOut.cpp:654), so please keep that signature when resolving. - `docs/dev/debt/libSceAudioOut.md`: #8525 and #9032 have landed their `### Silent stubs` entries, as your description anticipated, so this entry can go into that existing section. - Optional: the survey row gives no text offset for this export, unlike other entries in that document. The debt line could say this is the survey's disassembly reading rather than a console measurement. Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
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!8652
No description provided.