Skip to content

docs(debt): name what the emulators do for two AudioOut entries - #12765

Open
xXPBSXx wants to merge 2 commits into
boykopovar:mainfrom
xXPBSXx:docs/audioout-emulator-sources
Open

xXPBSXx wants to merge 2 commits into
boykopovar:mainfrom
xXPBSXx:docs/audioout-emulator-sources

Conversation

@xXPBSXx

@xXPBSXx xXPBSXx commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What

Two libSceAudioOut debt entries cited a single emulator. They now say what the other emulators do, with PS4/PS5 named per source and the disagreements stated:

sceAudioOutSetMixLevelPadSpk (libSceAudioOut) - no emulator applies the level: shadPS4 (PS4) checks and stores it, fpPS4 (PS4) ignores it and KytyPS5 (PS5) has no such function anywhere in its repository; it is assumed to be a linear gain on the port's own output, and the -9 dB default (11626) is applied to every pad speaker port, including those of titles that never call the function

sceAudioOutGetSystemState (libSceAudioOut) - the 32-byte layout (float loudness, 4 reserved bytes, 3 reserved 64-bit words) follows shadPS4's OrbisAudioOutSystemState and SharpProspero's SceAudioOutSystemState (Size = 32); it is not confirmed on a console. Loudness is reported as a constant 0.0f, although SharpProspero documents it in LKFS, so the value is unconfirmed. shadPS4 returns NOT_INIT before sceAudioOutInit; that check is not modelled. Imported by PPSA30528, which fails to load without it. KytyPS5 (PS5), shadPS4 and AnyPS5 zero the whole state; fpPS4 (PS4) writes only the loudness (1) and checks the pointer before initialization

Changed: docs/dev/debt/libSceAudioOut.md, two existing entries. No code change.

Method: the three implementations were read at the linked commits; only their behaviour is described here, no code or names that exist only there were taken over. KytyPS5 targets the PS5, shadPS4 and fpPS4 the PS4, so their answers are not console measurements. For sceAudioOutGetSystemState AnyPS5 already matches KytyPS5 and shadPS4 (whole state zeroed, loudness 0); fpPS4 differs (loudness 1, pointer checked first), so the entry names that difference and no code changes.

Overlap

Four open PRs change docs/dev/debt/libSceAudioOut.md (#12698, #12425, #11762, #5021; file sets from git diff --name-only against each PR head's merge base); none changes these two entries. git merge-tree against #12698, #12425 and #11762 is clean; #5021 already conflicts with main, and the conflict is the same with this branch. Update after the rebase onto main with #13676 merged (checked 2026-10-31 at 19:45 UTC against main 620449652e): #12698 is merged, #12425 and #11762 are no longer open. The open pull requests that change the file, taken from today's overlap checks of #13885 and #14048 and a file check of the 61 pull requests opened since 16:50 UTC: #13885, #12791, #14048, #13988, #13989, #13998 and #14085 merge cleanly with this head; #13781, #12863 and #5021 conflict, but each of them conflicts with main on its own.

Tested

Documentation only. tools/check_conventions.py --base upstream/main passes; based on main 1cac0ca433 (the merge of #13676), and it merges with main 620449652e without a conflict (checked 2026-10-31 19:33 UTC). Not built, not run.

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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

AI-assisted (Claude Code).

🤖 Generated with Claude Code

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@xXPBSXx One sentence in the new sceAudioOutGetSystemState entry does not match the code it describes. It says "KytyPS5 (PS5) and shadPS4 zero the whole state, AnyPS5 sets only the loudness". sceAudioOutGetSystemState in core/libs/prx/libSceAudioOut/src/AudioOut.cpp starts with *state = {}; and then writes state->loudness = 0.0f, so AnyPS5 also zeroes the whole 32-byte state (AudioOutSystemState has no other members; the loudness line is redundant). The emulator that sets only the loudness is fpPS4: at the commit you cite it does state^.loudness:=1 and nothing else.

Could you change it to say that KytyPS5 (*state = {}), shadPS4 (memset(state, 0, sizeof(*state))) and AnyPS5 zero the whole state, while fpPS4 writes only the loudness (1)?

I checked the rest against the cited revisions and it matches:

  • shadPS4 sceAudioOutSetMixLevelPadSpk checks init, handle, port type and level and stores the level with a "TODO: Apply mix level to backend";
  • fpPS4 ps4_sceAudioOutSetMixLevelPadSpk acquires the handle and ignores the level (//ignore);
  • fpPS4 ps4_sceAudioOutGetSystemState checks the pointer before initialization;
  • shadPS4 checks initialization first and then the pointer.

One thing to confirm in the text: I found no PadSpk in KytyPS5's src/libs/audio.cpp at the cited commit; if "does not implement it" rests on a wider search of that repository, say so, otherwise write "not in audio.cpp".

@oneandonlydean oneandonlydean self-assigned this Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

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 docs/dev/debt/libSceAudioOut.md
PR 12863 docs/dev/debt/libSceAudioOut.md
PR 14212 docs/dev/debt/libSceAudioOut.md

@xXPBSXx

xXPBSXx commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, you are right. sceAudioOutGetSystemState starts with *state = {};, so AnyPS5 also zeroes the whole state; I had missed that line. The entry now says that KytyPS5, shadPS4 and AnyPS5 zero the whole state, while fpPS4 writes only the loudness (1) and checks the pointer before initialization.

On KytyPS5 and sceAudioOutSetMixLevelPadSpk: the statement rests on a search of the whole repository at the cited commit, not only audio.cpp. PadSpk occurs there only as a port type (audio.cpp, libAudio2.cpp) and MixLevel only as an error code in errno.h; there is no such function. The entry now says "has no such function anywhere in its repository".

Head 37648e7c77 (a follow-up commit, no force push); check_conventions.py passes.

AI-assisted (Claude Code).

xXPBSXx and others added 2 commits October 31, 2026 19:54
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 31, 2026
@xXPBSXx
xXPBSXx force-pushed the docs/audioout-emulator-sources branch from 37648e7 to 352b341 Compare October 31, 2026 19:18
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 31, 2026

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants