Skip to content

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

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
nikowolf123:feat/audioout-set-main-output
Oct 26, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
nikowolf123:feat/audioout-set-main-output

Conversation

@nikowolf123

@nikowolf123 nikowolf123 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

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.
  • feat(libSceAudioOut): answer the legacy mastering calls without a mastering stage #8525 (for sceAudioOutMasteringTerm) and fix(libSceAudioOut): return 0 from sceAudioOut2LoTerminate and forward sceAudioOut2InitializeEx #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 434e965, and again at d16be88 on main 2c4b116: 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 2c4b116: 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

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Progress report (73ad397 → 91039af)

📈 System libraries: 50.52% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceAudioOut sceAudioOutSetMainOutput
⚪ 1 behaviourally empty (constant return or throw)
Library Name
libSceAudioOut sceAudioOutSetMainOutput

Changed libraries (implemented exports)

Library Before After Change
libSceAudioOut 67/146 (45.89%) 68/146 (46.58%) +0.68 pp

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

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 9818 core/libs/prx/libSceAudioOut/src/AudioOut.cpp
PR 9826 core/libs/prx/libSceAudioOut/src/AudioOut.cpp

@ycbuzi

ycbuzi commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Windows run of 18088be merged onto main b77bd58 (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.

… firmware stub

sceAudioOutSetMainOutput threw "not implemented". In firmware 12.70
the export is `xor eax,eax; ret` (PS5-Audio-Passthrough-Research,
docs/FINDINGS.md line 25 at cf3c921): it reads no argument, changes
nothing and returns 0. It now does the same, defined in AudioOut.cpp
next to the Sys output calls.

Its parameters stay unknown and other firmware versions are
unverified. The debt file records this under Silent stubs, which
check_conventions requires for an export that returns a constant,
in place of the function's unknown-signature line.

The audio_out_sys test checks that the call does not throw and
returns 0; on main both checks fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nikowolf123
nikowolf123 force-pushed the feat/audioout-set-main-output branch from 18088be to d16be88 Compare October 21, 2026 15:10
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
@xdCloudy

Copy link
Copy Markdown
Contributor

@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 harisibrar1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked against main b607bfd 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.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@nikowolf123 This PR now conflicts with main in core/libs/prx/libSceAudioOut/src/AudioOut.cpp, core/libs/prx/libSceAudioOut/tests/AudioOutSys.cpp, docs/dev/debt/libSceAudioOut.md. Main’s corrected AudioOut signatures and debt entries overlap this PR’s changes, including the SetMixLevelPadSpk argument type. Main now requires each exported function to be declared once, in the library's public header (checked by the public_headers tests). Could you reconcile the MainOutput change and retained tests with the current public AudioOut signatures?

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@nikowolf123 this conflicted with main in AudioOut, so I merged main into the branch (91039af). Main now declares the AudioOut functions in the public header, so the test's local extern block is gone, and your SetMainOutput debt bullet sits next to main's. Your code is unchanged. Next is CI on this head.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 26, 2026
@oneandonlydean
oneandonlydean merged commit 45b246f into boykopovar:main Oct 26, 2026
10 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.

5 participants