feat(libSceAudioOut): answer the legacy mastering calls without a mastering stage #8525
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8525"
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 MarrasFederico on 2026-10-20T15:08:17Z.
What
The legacy mastering calls
sceAudioOutMasteringInit,SetParam,GetStateandTermthrewnot implemented, and their debt entries listed the signatures as unknown. SharpProsperoAudioOut.csdocuments them:Init(uint flags)withSwapEqCompressor(bit 0);SetParam(header*, uint flags)with the default params id 1;GetState(header*)with the default states id 1, which writes the compressor input RMS and gain reduction and the limiter input, output and gain peaks;Term().The two default header identifiers are documented separately in AudioOut.cs lines 243–247.
Its
AudioOutMasteringwrapper reads those meters at offsets 32, 128, 240, 272 and 304 of a 336-byte struct, which match the repo'sAudioOut2MasteringStates;static_asserts pin them.AnyPS5 has no mastering stage, so these calls follow their AudioOut2 counterparts, next to which they now live:
SwapEqCompressor, but shadPS4's PS4 stub rejects any non-zero Init flags with 0x80260201, so its effect is disputed.The four "unknown signature" entries are replaced by entries recording what is unverified: the disputed bit 0, repeated or unmatched Init/Term, SetParam or GetState before Init, the id 1 parameter layout, and whether a console reports zero meters for an idle chain.
Tested
Ubuntu 26.04.1, kernel 7.0.0-38, GCC 15.2.0, Release, full build with
BUILD_TESTING=ON. Windows was not compiled. No title was run.audio_out2_latency, new legacy-mastering cases:main, where the calls throw. Accepting Init flag bit 0, missing one meter array, or accepting another params or states id makes it fail.audio_outpass.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pyfinds no conflicting lines. It could not compare #5021 and #5965, which conflict withmain; neither touches the mastering calls.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)Imported from boykopovar/AnyPS5. Originally posted by nikowolf123 on 2026-10-20T19:04:58Z.
sceAudioOutMasteringInit(1)returns 0 here (AudioOut2Mastering.cpp#L39), and the new test requires it (AudioOut2Latency.cpp#L123). The debt entry (libSceAudioOut.md#L126) and the PR text both say the sources document no error code for these calls. shadPS4 does document one. ItssceAudioOutMasteringInitreturnsORBIS_AUDIO_OUT_ERROR_MASTERING_INVALID_API_PARAM(0x80260201) for any non-zeroflags, andaudioout_error.hlists the legacy mastering codes 0x80260200 to 0x80260204. Neither source is a console measurement, and shadPS4's function is a PS4 stub. Still, they disagree on exactly the input the test pins: SharpProspero documentsSwapEqCompressoras an Init flag, and shadPS4 rejects it.I would take one of two routes. The first is to throw for bit 0 as well, as
sceAudioOut2MasteringInitalready does for flags it cannot confirm, and to change the test so it expects a throw for flags 1:The second is to keep accepting bit 0 and replace "the sources document no error code" in the entry with what shadPS4 shows: 0x80260201 for any non-zero Init flags, plus 0x80260203 (not initialized) and 0x80260204 (invalid states id). Since a not-initialized code exists, GetState before Init could also be listed as unknown, next to SetParam before Init.
One smaller point: the SharpProspero link in the entry and the PR text (
AudioOut.cs#L106-L114) shows only the flags enum. The signatures are at L312-L344, and the id 1 constants are at L243-L247.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T04:48:14Z.
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.Results (3 runs each):
audio_out2_latencypasses 3/3.core/libs/prx/libSceAudioOut/src/AudioOut2Mastering.cpp,core/libs/prx/libSceAudioOut/src/Unimplemented.cppwith their versions from the PR's merge base (acda0b06f9), then rebuilt. The test fails 3/3 (exit 0xc0000409). I restored the PR's files afterwards.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 MarrasFederico on 2026-10-21T12:33:23Z.
@nikowolf123 thanks, I took the first route in
bef257883(on top of currentmain):sceAudioOutMasteringInitandsceAudioOutMasteringSetParamnow throw for any non-zero flags,SwapEqCompressorincluded, and the test expects that;AudioOut.cs#L312-L344) and the id constants (#L243-L247).GetState and SetParam before Init are listed as unknown too. All 41
audio_outtests pass.@xXPBSXx thanks for the Windows run.
Imported from boykopovar/AnyPS5. Originally posted by xdCloudy on 2026-10-22T01:01:36Z.
Hi MarrasFederico — 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 from the legacy mastering calls here. I propose #8525 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 MarrasFederico on 2026-10-22T04:54:48Z.
@xdCloudy agreed: #8525 lands first and #9541 rebases afterward. I compared the diffs, and the exports are distinct. In
Unimplemented.cpp, #8525 only removes the legacy mastering stubs (sceAudioOutMasteringInit,sceAudioOutMasteringSetParamand their neighbours), while #9541 adds thesceAudioDeviceControlGet/Setdeclarations. The two touch neighbouring lines indocs/dev/debt/libSceAudioOut.md, so the rebase should only need that list merged. Thanks for coordinating.