Skip to content

fix(audio): retain completed AudioOut2 grains until pushed - #6216

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
eljackjoestar-cmd:fix/audioout2-completed-grain-backlog
Oct 17, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
eljackjoestar-cmd:fix/audioout2-completed-grain-backlog

Conversation

@eljackjoestar-cmd

@eljackjoestar-cmd eljackjoestar-cmd commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What

During a level-loading test, Lost Soul Aside (PPSA26358) queued more than sixteen completed audio grains before Push consumed them. sceAudioOut2ContextAdvance then threw AudioOut2: more than 16 completed grains await a push, terminating the process.

Remove the emulator's sixteen-grain restriction. Completed PCM and gain snapshots remain queued in order until sceAudioOut2ContextPush consumes them. The regression advances 64 distinct grains on a producer thread using a rewritten buffer, ends that thread, then pushes and checks every stereo output sample. The technical-debt note records that an unconsumed backlog retains PCM storage and that a console backlog limit is unverified.

Tested

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; no silent stub added
  • No investigation files or images added to the repository
  • New third-party code is a submodule built from source: n/a
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA26358 Lost Soul Aside (PPSA26358): bring-up and remaining blockers #4401 (the AudioOut2 backlog abort; gameplay entry observed in the disclosed integration, performance remains poor)
  • GPUs tested: n/a (audio change)
  • AI-assisted: yes

@eljackjoestar-cmd
eljackjoestar-cmd force-pushed the fix/audioout2-completed-grain-backlog branch from c6391f8 to eb17286 Compare October 15, 2026 07:52
@eljackjoestar-cmd
eljackjoestar-cmd force-pushed the fix/audioout2-completed-grain-backlog branch from eb17286 to 6575aa2 Compare October 15, 2026 09:10
@Dextroid17

Copy link
Copy Markdown
Contributor

I ran the test case this PR adds, on Linux.

Setup: head 6575aa2 merged into main at ff23657 (no conflicts; the PR's base is 262 commits behind), Linux, default CMake build (CMAKE_BUILD_TYPE empty, unoptimized), clean environment (env -i with only HOME, PATH and VK_ICD_FILENAMES set). ctest -R '^audio_out2_port_buffers$', 3 runs each.

  • with this PR: 3 of 3 runs pass.
  • with core/libs/prx/libSceAudioOut/src/AudioOut2Context.cpp put back to main's version (the PR's test changes kept): 3 of 3 runs fail, each aborting on main's 16-grain limit (uncaught std::runtime_error: "AudioOut2: more than 16 completed grains await a push").

The test uses SDL's disk audio driver, so no sound device was involved. I did not run Lost Soul Aside.
I did not check Windows or macOS.

AI-assisted: yes

@isnisk

isnisk commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Checked on Linux: Ubuntu 26.04 (WSL2), GCC 15.2.0, Release, this head (6575aa217) merged onto main 489466d3f (clean merge).

  • With the change: audio_out2_port_buffers and the other 16 audio_out* tests pass, 3 rounds, including the four audio_out*_shutdown tests from fix(libSceAudioOut): park guest audio calls at exit before the port tables are destroyed #6000; no compiler warnings.
  • Without it (main's AudioOut2Context.cpp, the new test kept): audio_out2_port_buffers aborts 3 of 3 with what(): AudioOut2: more than 16 completed grains await a push.
  • check_conventions.py --base origin/main passes.

Not checked: macOS, the title.

AI-assisted: yes (Claude Code).

@github-actions

github-actions Bot commented Oct 16, 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 6447 docs/dev/debt/libSceAudioOut.md
PR 6493 docs/dev/debt/libSceAudioOut.md
PR 6964 docs/dev/debt/libSceAudioOut.md

@oneandonlydean oneandonlydean self-assigned this Oct 17, 2026
@oneandonlydean
oneandonlydean merged commit 532f3e7 into boykopovar:main Oct 17, 2026
9 checks passed
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.

4 participants