Skip to content

feat(libSceAudioOut): implement sceAudioOut2MasteringGetState - #6380

Closed
Capmare wants to merge 1 commit into
boykopovar:mainfrom
Capmare:feat/audioout2-mastering-getstate
Closed

Capmare wants to merge 1 commit into
boykopovar:mainfrom
Capmare:feat/audioout2-mastering-getstate

Conversation

@Capmare

@Capmare Capmare commented Oct 15, 2026

Copy link
Copy Markdown

What

Implements sceAudioOut2MasteringGetState, which threw NotImplemented_nid_no_patch. States id 1 (default, three compressor bands) and 2 (V2, four bands) return a zeroed state with the states id, compressor descriptor (0x01010001 / 0x01020001) and limiter descriptor (0x01010003) set. A null pointer returns 0x80268201 and an unknown id 0x80268204. The layouts, ids and error codes follow KytyPS5 src/libs/libAudio2.cpp (GPL-2.0); the code is written from scratch. The behaviour is unverified on a console and recorded in docs/dev/debt/libSceAudioOut.md.

Tested

  • Linux x86-64, full build with BUILD_TESTING=ON: audio_out2_latency (new TestMasteringGetState plus compile-time size checks, 336 and 400 bytes) and all 23 audio tests pass. The new test fails on the old stub.
  • python3 tools/check_conventions.py --base origin/main passes.
  • A hand-written guest ELF (not committed) imports the function by NID (VZidxi2cYh0), is converted with the relinker and run against the built libSceAudioOut.prx. It checks the return value, ids, descriptor sizes and zeroed fields for both states ids; a control with a wrong expected id fails.
  • Not tested: a console, a real title or homebrew, other operating systems, GPUs (not applicable).
  • libraries progress: 3272/3689 to 3273/3689.

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: none
  • GPUs tested: n/a
  • AI-assisted: yes. The change was written with Claude Code; I reviewed it and am responsible for it.

🤖 Generated with Claude Code

@github-actions

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
#6170 core/libs/SceTypes.hpp L554
core/libs/prx/libSceAudioOut/src/AudioOut2Mastering.cpp L4, L17, L20-21
core/libs/prx/libSceAudioOut/tests/AudioOut2Latency.cpp L1-2, L13, L80
docs/dev/debt/libSceAudioOut.md L26

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
#5995 core/libs/SceTypes.hpp

@Capmare

Capmare commented Oct 15, 2026

Copy link
Copy Markdown
Author

Closing as a duplicate. #6170 (opened earlier) already implements sceAudioOut2MasteringGetState with the same KytyPS5 layouts, ids and error codes. My check for open pull requests searched titles and descriptions only, so I missed it and the checklist line saying no other open pull request implements this function was wrong. This change was written with AI assistance.

@Capmare Capmare closed this Oct 15, 2026
primesoul-web added a commit to primesoul-web/AnyPS5 that referenced this pull request Oct 15, 2026
…ing states layout

guest_gameupdate still asserted the throw that sceGameUpdateGetAddcontLatestVersion
no longer raises for a null entitlement label since it answers 0x80412803, so the
test aborts; it now asserts the error, the same change boykopovar#5919 makes. The mastering
states layout is pinned with compile-time size checks for the descriptors, the
compressor and limiter states and both states structs, as boykopovar#6380 suggested.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant