fix(libSceAudioOut): track mastering initialization as the console does #9027
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9027"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by hypermoist on 2026-10-21T10:04:19Z.
What
sceAudioOut2MasteringInitthrew for any non-zero flags.sceAudioOut2MasteringInitExaccepts 0 and bit 31 since #9349 and throws for any other flag. This PR replaces that body with the shared Init/InitEx routine below, which returns0x80268201for those flags. Term, GetState and SetParam accepted calls in any state. All three of my title dumps importsceAudioOut2MasteringInit(PPSA03671, PPSA08427, PPSA29340).In the decrypted PS5 12.00
libSceAudioOut, both Init exports (XHl38ZNknbs0x22660 and7ukE-Yrzqog0x22650) jump into one routine at 0x22360. InitEx passes a flag that lets bit 31 through. The module keeps one mastering-initialized byte. Behaviour, with what this PR reproduces:0x802682010x80268201. Bit 31 is passed to the audio server as a mastering mode (SDK ≥ 3.0)2bbBBOkH4CY0x22690) before Init0x80268203; otherwise clears the flag and returns 0 (no count)VZidxi2cYh00x22da0)0x80268203before Init, checked before the pointer. A null state gives0x8026800C0x80268201beforev8iOE+j8a5o0x228e0)0x80268203before Init. Then0x80268201for a null parameter, then0x80268205for flags above 1The console also returns
0x80268006from all of these beforesceAudioOut2Initialize. This project does not track that initialization, so it is left out and noted in the debt file. The console'soutput/userchecks and its audio-server failures (0x80268000, -1) are not reproduced.The existing debt entry noted that PPSA01289 calls Init twice and then Term twice and only logs a non-zero result. By the module, that second Term gets
0x80268203.audio_out2_latencyasserted that it returns 0, so the test now follows the module.The code is written from the observed behaviour; nothing from the module is copied.
Tested
Linux (CachyOS, GCC, Release).
audio_out2_latencynow checks:All 41
audio_out*tests pass.Each negative control fails the test:
tools/check_conventions.pyis clean. Three-way merges with every open PR that touches these four files add no conflicts (#5021, #5965, #6879, #8098, #8525, #8652, #8693). #8525 implements the legacysceAudioOutMastering*calls in the same files and does not use these functions.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)sceAudioOut2MasteringInit; none was run with this change🤖 Generated with Claude Code
https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T13:44:01Z.
Linux data point for
5a7ef76100: WSL2 Ubuntu 24.04 (virtualised kernel, not bare-metal Linux), GCC 13.3.0, Release,BUILD_TESTING=ON, PR head alone (not merged ontomain) (its merge-base is27c88a8d7).ctest -R '^audio_out2_latency$'passes 3 of 3.AudioOut2Mastering.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).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T15:42:40Z.
Independent Windows run of this PR (data only).
Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against
mainis clean. I built onlyaudio_out2_latency_tests;ctest -N -R audio_out2_latencylists exactly one test.PR head tested:
5a7ef7610021fb35ac1f44a5ba35885cf9368a1b.Results (3 runs each):
audio_out2_latencypasses 3/3.core/libs/prx/libSceAudioOut/src/AudioOut2Mastering.cpp,core/libs/prx/libSceAudioOut/src/Unimplemented.cppwith the version from the PR's merge base (27c88a8d75), then rebuilt. The test fails 3/3 (exit 0xc0000409). I restored the PR's files afterwards.GPU: the run output has no
Selected GPUline; no GPU claim is made.Not run: other platforms, the other tests in the same family, the full repository CTest, and any title or console run.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xdCloudy on 2026-10-22T01:01:48Z.
Hi — MarcZX10's review on my #9541 found that both PRs touch
libSceAudioOut/src/Unimplemented.cppanddocs/dev/debt/libSceAudioOut.md, so the overlap scanner cannot compare the old-base branch cleanly. My two declarations are distinct fromsceAudioOut2MasteringInitEx. I propose #9027 lands before #9541; I’ll record it as a prerequisite and rebase/update #9541 afterward. Please let me know if you agree with that order.Imported from boykopovar/AnyPS5. Originally posted by hypermoist on 2026-10-22T01:30:20Z.
@xdCloudy agreed: #9027 first, then #9541 rebased on top. I've merged
maininto this branch (7ef7653590), so it's mergeable again. The only conflict was the debt entry: I keptmain's newsceAudioOutExGetMonitorInfoandsceAudioOut2Set3DLatencylines, and this PR's mastering lines, which replacemain's description of the old Init.ctest -R audio_outpasses on Linux (41 of 41).Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T06:16:24Z.
Review: APPROVED
Reviewed exact current-main head
1cee26eba7766e0db2a3fb9123beacb62db394a3. The shared Init/InitEx routine models the initialized early return, checks distinct Init versus InitEx flag masks, and stores a single initialized state; Term/GetState/SetParam enforce the measured state/error order. Tests now cover pre-init calls, flag ordering, repeat initialization, non-counted Term and SetParam validation. The author reports the focusedaudio_out2_latencytest and NID-patched PRX builds passing on Linux and Windows/Wine after merging current main; all 41 audio_out tests passed on Linux before that refresh, and the refreshed focused suite passed. Local diff-check, conventions and main-sync checks pass (3 ahead/0 behind). Product jobs are skipped by policy. #9818 and #9826 also touch the old Init flag path but request broad unsupported stub changes; their current reviews ask to retain throws. This review considers this evidence-backed implementation independently complete; if either shared-file PR is later revised/merged, preserve these measured semantics during integration. Approval applies to this exact head.