fix(audioout): serialize SDL audio initialization for Dark Forces #4789
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4789"
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 PrintOrb on 2026-10-12T21:56:30Z.
What
STAR WARS: Dark Forces Remaster (PPSA19728, 02.000.000) can crash in
SDL_AudioQuit_REALat address zero when legacy AudioOut and AudioOut2 initialize SDL audio concurrently. Debugger traces show overlapping initialization fromsceAudioOutOpenandsceAudioOut2ContextCreate.Serialize SDL audio initialization through a shared helper. Preserve SDL's return value and the existing caller error handling.
Tested
Native Windows, Release build, based on main
529f7bfd4. Fulllibsbuild passes. The newaudio_out_initializationtest exercises the production helper with a controlled SDL backend, checks serialization and unchanged failure/success returns, and passes. Removing serialization produces overlapping backend calls and fails the regression. Existingaudio_out_ex,audio_out2_latencyandaudio_out2_port_bufferspass (4/4 total). Conventions, test registration and whitespace checks pass. Newer mainee4962190was checked before publication: neither affected library changed, and the branch merges cleanly; the build/test results above are for the stated tested base.Earlier title testing required the independent NGS2 voice-index fix to reach this audio path. With both fixes, manual testing completed the first mission. Tab/PDA performance problems remain. Gameplay was not repeated on the refreshed main build.
Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T04:56:42Z.
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/src/AudioOut2Context.cppL16core/libs/prx/libSceAudioOut/CMakeLists.txtL19Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T11:52:01Z.
Windows test: head
5031432dbmerged onto currentmain5d50886ee, together with 9 other open pull requests in one build (the merges were conflict-free); a failure would have been bisected per PR. Windows 10, MinGW GCC (WinLibs), Ninja Release,-j2: full build 0 errors; ctest for the tests this change adds or touches: audio_out_initialization passed;python tools/check_conventions.py --base upstream/mainpassed for the combined tree. I did not run the new tests againstmainwithout the change.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by johnohhh1 on 2026-10-14T02:02:20Z.
Independent Linux validation of
5031432db0d39c8c95504218673166cf6a69ef1a, applied alone to main959d39fb2b050fa76beed0b49b4c2f13a119ab5a(without #4788 or other pending PRs).Ubuntu 26.04.1 x86-64, GCC 15.2.0, Release, bundled dependencies, testing and SPIR-V Tools enabled.
SDL_AUDIODRIVER=dummywas set only in the test process.audio_out_initialization; serial CTest with a 30-second maximum. The slowest selected test takes 4.40 seconds.AudioOutSdl.cpphelper. Against an unsynchronized control that callsSDL_InitSubSystem(SDL_INIT_AUDIO)directly, it fails withpeak=2, while preserving the backend's-1,0return sequence.The concurrency checks compile the actual production helper with a controlled SDL backend. They establish serialization and return-value preservation, not reproduction of the real
SDL_AudioQuit_REALcrash or gameplay progress. The existing AudioOut library suites use SDL's dummy driver. No title or native PS5 was run, and Windows was not retested.AI-assisted validation/report: Codex. Original implementation and authorship preserved.