Skip to content

feat(libSceAudioOut): implement sceAudioOutGetSystemState - #5965

Open
bcortezf wants to merge 1 commit into
boykopovar:mainfrom
bcortezf:feat/audioout-get-system-state
Open

bcortezf wants to merge 1 commit into
boykopovar:mainfrom
bcortezf:feat/audioout-get-system-state

Conversation

@bcortezf

Copy link
Copy Markdown

What

Red Dead Redemption (PPSA30528) imports sceAudioOutGetSystemState (NID R5hemoKKID8) and fails to load without it:

FAIL: unresolved ELF import R5hemoKKID8 from libSceAudioOut.prx

This PR adds it with the same behaviour as the existing sceAudioOut2GetSystemState:

  • Arguments and state: it takes a pointer to a 64-byte system state (a float loudness, padding and reserved words) and reports a loudness of 0.0f.
  • Null pointer: returns 0x80260004, like the other AudioOut calls.

The signature and layout come from the shadPS4 and fpPS4 reimplementations, not from a console measurement. They are recorded under "Unknown function info" in docs/dev/debt/libSceAudioOut.md.

A unit test (audio_out_system_state) checks the result, the loudness and the null pointer.

Tested

Windows 11 (10.0.26200), MinGW build

  • Unit test: ctest -R audio_out_system_state passes.
  • Conventions: python3 tools/check_conventions.py --base origin/main passes.
  • PPSA30528: with this export, the title loads past the import. It reaches gameplay on main a0f5916 plus this commit, together with separate local rendering workarounds that are not part of this PR. On current main, a fresh run of the title also needs its executable converted again with the current relinker, which I have not redone.

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
  • Unblocks: PPSA30528 (Red Dead Redemption): it does not load without this export
  • GPUs tested: n/a
  • AI-assisted: yes

@bcortezf

Copy link
Copy Markdown
Author

could someone check this? @adriadam10

@bcortezf
bcortezf force-pushed the feat/audioout-get-system-state branch from 8f22c85 to 46cd6d5 Compare October 14, 2026 23:36
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 14, 2026
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6170 docs/dev/debt/libSceAudioOut.md L14-15

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 core/libs/prx/libSceAudioOut/CMakeLists.txt
docs/dev/debt/libSceAudioOut.md
PR 6044 core/libs/prx/libSceAudioOut/CMakeLists.txt
PR 6879 core/libs/prx/libSceAudioOut/src/AudioOut.cpp
PR 6964 docs/dev/debt/libSceAudioOut.md
PR 6977 core/libs/SceTypes.hpp
PR 7332 core/libs/prx/libSceAudioOut/CMakeLists.txt

@github-actions

Copy link
Copy Markdown

Progress report (ab9a476 → 46cd6d5)

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

✅ 1 implemented
Library Name
libSceAudioOut sceAudioOutGetSystemState

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks. Build and the AudioOut ctest scope are green here, and audio_out_system_state fails to build without the change. One thing to fix:

  • core/libs/SceTypes.hpp:575 AudioOutSystemState is 64 bytes (copied from AudioOut2SystemState), but the sources the debt line cites say 32: shadPS4's OrbisAudioOutSystemState is float loudness; u8 reserved8[4]; u64 reserved64[3], and SharpProspero's SceAudioOutSystemState has Size = 32. Please use the 32-byte layout (std::uint64_t reserved[3]), and add a static_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 constant 0.0f is unconfirmed.

This branch has not been deployed

No deployments
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.

2 participants