fix(libSceAudioOut): drain active calls before shutdown #3533
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3533"
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 krishalivaibhav on 2026-10-11T12:36:33Z.
What
Drain active legacy AudioOut calls before closing SDL audio devices during normal libc shutdown. Reject new calls once shutdown starts and cancel paced output waits so teardown does not race port state or mutex destruction.
Add a regression test using the actual AudioOut implementation and libc shutdown registry. A controlled guest clock keeps an output call waiting until shutdown cancels it.
Tested
Rebased onto main
f40b6930ff156834b786730771518b3bd7fe8648; head11ad8bd1a. The shutdown fixture now links the SDL initialization helper added on main. New title-backed A/B evidence for Vampire Survivors (PPSA21703): main AudioOut source aborts insleepUs → mutex::lockafter a normal exit request; candidate exits 0. Only AudioOut differs between the recorded game binaries. This uses an older adapted Mac runtime around current-main AudioOut, not a complete current-main title build. The PR stays closed pending the maintainer’s assessment of that evidence scope. Earlier platform reports below refer to their explicitly stated older heads.pending output was not cancelled.audio_out_shutdown, using head243bcfaddmerged onto mainc6efe068atogether with three other PRs. Their 20-test result is for that combination, not this branch alone; they did not run a no-fix negative control or a title run.This covers legacy AudioOut shutdown. It does not establish game loading compatibility or AudioOut2 shutdown coverage.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T13:43:11Z.
Windows test of head
243bcfaddmerged onto currentmain(c6efe068a, clean merge; built together with three other open PRs from the same list, so the numbers below are for the combination): Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, full build 0 errors.audio_out_shutdown(the test this PR adds) passes, with the otheraudio_out*tests (20 of 20 in the filteraudio_out|guest_directory|guest_dup|guest_kernel_sys|guest_sce_net|guest_file).Not checked: that the test fails without the change, Linux, a title run.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T22:17:16Z.
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.
main)core/libs/prx/libSceAudioOut/CMakeLists.txtL19core/libs/prx/libSceAudioOut/CMakeLists.txtL19Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:32:30Z.
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.
Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-14T04:33:11Z.
Title-backed follow-up for the closure request: Vampire Survivors, PPSA21703, on Apple M2 / Rosetta / MoltenVK. This reproduces the AudioOut shutdown defect; it is not a gameplay-crash or performance claim.
I rebased the branch onto main
f40b6930ff156834b786730771518b3bd7fe8648; candidate head11ad8bd1a6b587275301c187626c5361ca8beed8. The shutdown fixture now links main's newly addedAudioOutSdl.cpp, while retaining the existing SDL initialization test.Controlled title A/B:
AudioOut.cpp(Git blobfcd7d359f82f93dab75949e89df458e07e2136aa) andAudioOutSdl.cppinto the baseline AudioOut library. Build the candidate with the rebased admission/drain/cancel change, using the same auxiliary objects and dependencies. Process both libraries through the same NID patcher.libc++abi: terminating due to uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument.std::__1::mutex::lock() → sleepUs(std::__1::unique_lock<std::__1::mutex>&, unsigned long long)in libSceAudioOut.prx; crash-report PID matches the recorded title process, 8644.pending output was not cancelled; against the rebased candidate it passes. These fixtures compiled with current-main headers and the new SDL initialization helper. Parent and independent low-reasoning agent reviewed the integration and evidence.Important scope limitation: this is current-main AudioOut source executed in our older adapted macOS runtime; auxiliary AudioOut2 objects and the surrounding libc/libkernel/graphics runtime are not a complete current-main build. The initial test dependencies also use that adapted Mac libc/SDL. I am not presenting this as a pristine/current-main whole-title run, Linux/Windows validation, or proof of long gameplay stability. There was one title run per variant.
The branches and original test evidence are preserved. Does this isolated, current-source title shutdown reproduction meet the reopening requirement for the macOS case, or should I keep it closed until the entire Mac runtime is aligned to main? I have kept it closed pending that distinction.
AI-assisted: yes (Codex).
Pull request closed