fix(audio): retain completed AudioOut2 grains until pushed #6216
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6216"
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 eljackjoestar-cmd on 2026-10-15T04:21:03Z.
What
During a level-loading test, Lost Soul Aside (PPSA26358) queued more than sixteen completed audio grains before Push consumed them.
sceAudioOut2ContextAdvancethen threwAudioOut2: 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
sceAudioOut2ContextPushconsumes 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
audio_out2_port_buffersfails with the new regression and main's implementation, throwing at the seventeenth advance; it passes with this change (1.78 s). Rebased onto current main0afa6a607ed0; all 10 focused audio checks pass again (7.27 s).audio_out2_*andaudio_out_shutdownchecks pass (3.80 s), covering PCM order, rewritten buffers, gain snapshots, cross-thread pushes, output timing and shutdown.a077a88df, with existing #5851, #5870 and #5872 (lazy preparation enabled), a missing-metadata PlayGo diagnostic and-onethread, using the same relinked executable. Before this change the run aborted in AudioOut2 during loading; with this change it passes that point. The user confirmed gameplay in run173; a later run with the same verified executable/module hashes (run177) also reached gameplay, captured through the game window with the combat tutorial visible. The cutscene ran around 6 FPS and the later scene around 1 FPS, with substantial memory pressure; sustained playability is not established. Run173 was stopped by the old stdout logging guard, not a demonstrated allocation failure. This does not resolve the separate garbage-collection timeout seen with the normal threaded launch. #5851 has since been closed in favor of #6060; the recorded integration above retained the tested #5851 version. Runtime diagnostics and other integration changes are absent from this PR.tools/check_conventions.py --base origin/mainandgit diff --checkpass.Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-15T15:04:41Z.
I ran the test case this PR adds, on Linux.
Setup: head
6575aa217merged into main atff23657f3(no conflicts; the PR's base is 262 commits behind), Linux, default CMake build (CMAKE_BUILD_TYPE empty, unoptimized), clean environment (env -iwith only HOME, PATH and VK_ICD_FILENAMES set).ctest -R '^audio_out2_port_buffers$', 3 runs each.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
Imported from boykopovar/AnyPS5. Originally posted by isnisk on 2026-10-15T16:26:50Z.
Checked on Linux: Ubuntu 26.04 (WSL2), GCC 15.2.0, Release, this head (
6575aa217) merged ontomain489466d3f(clean merge).audio_out2_port_buffersand the other 16audio_out*tests pass, 3 rounds, including the fouraudio_out*_shutdowntests from #6000; no compiler warnings.main'sAudioOut2Context.cpp, the new test kept):audio_out2_port_buffersaborts 3 of 3 withwhat(): AudioOut2: more than 16 completed grains await a push.check_conventions.py --base origin/mainpasses.Not checked: macOS, the title.
AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T18:37:33Z.
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.
docs/dev/debt/libSceAudioOut.mddocs/dev/debt/libSceAudioOut.mddocs/dev/debt/libSceAudioOut.mddocs/dev/debt/libSceAudioOut.md