audio: return synchronous AudioOut2 pushes once the queue has room #1872
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1872
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1872"
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?
@NeySlim on GitHub · 2026-10-24 02:56 UTC · original
NeySlim:fix/audioout2-sync-room→main· +68 −1 · 2 files · 1 commits · openA synchronous AudioOut2 push returns while the queue is still full: without a device it does not block at all, and with a device the first pushes go through while the SDL queue fills up.
God of War Ragnarök's Wwise output uses a context with a queue depth of 2. Its render thread only renders a buffer when
AudioOut2ContextGetQueueLevelreports a free slot, and the output thread pushes it synchronously and then wakes the renderer. After a push that left the queue at 2/2 the renderer sees no room and goes back to sleep, the output thread waits for the next buffer, and audio output stops. The reload after dying on the first QTE waits on audio and never finishes (tip screen with the loading icon forever).f380d69b9), so the modelled queue is capped at depth - 1 instead of waiting on a second clock.TestSynchronousPushLeavesRoomcovers both cases, each half fails without the fix.TestHandleWithoutPcmDoesNotBypassQueueexpected the queue to stay full after a synchronous push; it now checks that the push without PCM waits for its grain on the simulated clock.In game: the Wwise output gets about 35k pushes per session instead of 6, and 4 out of 4 deaths on the QTE reload, as do deaths later in the fight.
AI use
Investigation, code and tests written with Claude Code; reviewed and tested locally by me.
@coderabbitai[bot] on GitHub · 2026-10-24 02:59 UTC · original
No actionable comments were generated in the recent review.
0d3ac44c-e0db-48b9-b6fe-299d20248344Reviewing files that changed from the base of the PR and between
6aaa533296and0611eb7540.src/libs/libAudio2.cpptests/AudioOut2PortTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Walkthrough
Synchronous audio pushes now wait for queue room after queuing audio. Device-paced pushes update the modeled queue without waiting for it to drain. Other synchronous pushes wait when the queue reaches its configured depth. Asynchronous pushes retain the existing full-queue error behavior. Tests check elapsed process time and available queue slots, with and without PCM.
Suggested reviewers:
nmzikPriority:
Normal
Change: Bug fix
Merge Risk:
Minimal · up to
0611eThe supplied evidence identifies no issue that should block merging after normal checks.
Pre-merge checks:
4 ·
1
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.