feat(libSceAudioOut): implement sceAudioOutGetSystemState #5965
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5965"
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 bcortezf on 2026-10-14T17:21:48Z.
What
Red Dead Redemption (PPSA30528) imports
sceAudioOutGetSystemState(NIDR5hemoKKID8) and fails to load without it:This PR adds it:
float loudness, 4 reserved bytes, 3 reserved 64-bit words, checked by astatic_assert) and reports a loudness of0.0f.0x80260004, like the other AudioOut calls.The layout follows shadPS4's
OrbisAudioOutSystemStateand SharpProspero'sSceAudioOutSystemState(Size = 32), not a console measurement. The debt entry indocs/dev/debt/libSceAudioOut.mdrecords that, and that the constant0.0fis unconfirmed (SharpProspero documents loudness in LKFS) and that shadPS4's NOT_INIT beforesceAudioOutInitis not modelled.A unit test (
audio_out_system_state) checks the result, the loudness and the null pointer.Tested
Windows 11 (10.0.26200), MinGW build, on current
main(a6dcea927) + this commit (abd3af907)ctest -R audio_out_system_statepasses.python3 tools/check_conventions.py --base origin/mainpasses.Not tested: Linux/macOS.
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 bcortezf on 2026-10-14T20:11:08Z.
could someone check this? @adriadam10
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T19:08:09Z.
Review: CHANGES_REQUESTED
Thanks. Build and the AudioOut ctest scope are green here, and
audio_out_system_statefails to build without the change. One thing to fix:core/libs/SceTypes.hpp:575AudioOutSystemStateis 64 bytes (copied fromAudioOut2SystemState), but the sources the debt line cites say 32: shadPS4'sOrbisAudioOutSystemStateisfloat loudness; u8 reserved8[4]; u64 reserved64[3], and SharpProspero'sSceAudioOutSystemStatehasSize = 32. Please use the 32-byte layout (std::uint64_t reserved[3]), and add astatic_assert(sizeof(...) == 32).docs/dev/debt/libSceAudioOut.md:15: the layout is not from shadPS4/fpPS4 as written, so correct it once the struct matches. Also note there that shadPS4 returns NOT_INIT before init (not modelled) and that SharpProspero documents loudness in LKFS, so the constant0.0fis unconfirmed.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T02:43:30Z.
@bcortezf this PR now conflicts with
mainindocs/dev/debt/libSceAudioOut.md(thesceAudioOutSysOpenentry was rewritten there).In case it helps: I rebased your commit onto current
main(cd700fe9ec) without changing it, keeping you as its author, and resolved only that debt conflict (yoursceAudioOutGetSystemStateentry stays, themaintext of thesceAudioOutSys*entry stays): branchxXPBSXx:carry/5965-audioout-system-state, head4bff38aa2d. You can take it withgit fetch https://github.com/xXPBSXx/AnyPS5 carry/5965-audioout-system-stateandgit reset --hard FETCH_HEAD, or rebase yourself; I will not open a second PR for it.Windows 10 19045, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON, on that head:ctest -R '^audio_out_system_state$'passes 3 of 3; the 38audio_out*tests pass (38 of 38).core/libs/SceTypes.hppandlibSceAudioOut/src/AudioOut.cpprestored tomain(your new test kept),audio_out_system_state_testsdoes not compile ('AudioOutSystemState' was not declared).python tools/check_conventions.py --base upstream/mainpasses.Not tested: Linux/macOS, a title run (PPSA30528).
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by bcortezf on 2026-10-21T23:36:50Z.
@adriadam10 Done. struct is now 32 bytes with a static_assert, debt entry corrected (sources, LKFS, NOT_INIT not modelled), rebased on current main.
Imported from boykopovar/AnyPS5. Originally posted by bcortezf on 2026-10-22T00:27:08Z.
btw, with this, im able to run rdr1 at 17 fps
Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-22T12:58:55Z.
Re-checked head abd3af907:
AudioOutSystemStateis now 32 bytes, with the static_assert, so adriadam10's size point looks resolved. The null path returns 0x80260004, as described. Small nit: onlyloudnessis written, so the reserved fields keep the caller's bytes;*state = {}before setting loudness would match the other AudioOut getters. Not blocking. (Code review only; I don't have PPSA30528 to test.)