audio: hold guest audio while a long pipeline compile blocks the GPU #1979
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!1979
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1979"
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?
@MrBigBritches on GitHub · 2026-10-29 17:36 UTC · original
MrBigBritches:audio-compile-hold→main· +1023 −17 · 15 files · 10 commits · openSome games pace their cutscenes by the audio they submit. When a pipeline compile blocks Kyty's GPU command thread, the game's frame loop stops, but its audio thread keeps pushing buffers. Atelier Yumia builds some compute pipelines for up to 141 s on NVIDIA. While it waits, its in-engine cutscene follows the audio clock, so by the time the picture comes back the scene is over.
With the new
--audio-compile-holdswitch, guest audio submits wait while a runtime pipeline compile has blocked the GPU command thread for at least 250 ms. Shorter compiles are hidden by the host audio queue, and holding for them would add dropouts nobody would otherwise hear. The switch is off by default. It has only been tested in one engine so far.How it works
common/gpuStallScope.WaitWhileStalled()blocks the caller while a Scope has lasted at least the threshold.GetGraphicsPipelineandGetComputePipelineare marked, and only on the GPU command thread. Boot warm-up and compiles on other threads leave audio alone.AudioOutOutput(s).AudioOut2ContextPushloop.Audio3dPortPush.AudioOut2ContextPushto a destroyed or unknown context used to loop forever. It now returns NOT_READY, the result non-blocking pushes already gave. The console's real error code for this case is unknown. This is a separate commit, because the hold made the race likely.Testing
gpu_stalltests:audio_out_timingandaudio_out2_port. The compile runs on a stand-in GPU thread and each submit on its own thread. They cover:--audio-compile-hold:Not in this PR
@coderabbitai[bot] on GitHub · 2026-10-29 17:43 UTC · original
No actionable comments were generated in the recent review.
65a65c1d-d9f8-4210-82a7-88b6274ea07cReviewing files that changed from the base of the PR and between
5e837a9beaand5e9d269ce2.CMakeLists.txtsrc/common/debugCounters.hsrc/common/emulatorConfig.cppsrc/common/emulatorConfig.hsrc/common/gpuStall.cppsrc/common/gpuStall.hsrc/graphics/host_gpu/renderer/pipeline/pipelineCache.cppsrc/graphics/presentation/performanceOverlay.cppsrc/libs/audio.cppsrc/libs/audio3d.cppsrc/libs/libAudio2.cppsrc/main.cpptests/AudioOut2PortTests.cpptests/AudioOutTimingTests.cpptests/GpuStallTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Walkthrough
Adds optional GPU-stall tracking and a command-line option that enables audio holds during qualifying pipeline compilation stalls. Audio submission paths wait for the stall to end when holding is enabled. The change adds hold counters and performance-overlay reporting, adjusts underrun accounting after a hold, and adds tests for stall tracking and audio submission behavior.
Suggested reviewers:
nmzik,juanfariasdevPriority:
Normal
Change: Feature
Merge Risk:
Minimal · up to
5e9d2The reviewed hold paths and test linkage show no unresolved issue that needs to be fixed before merging.
Pre-merge checks:
4 ·
1
Full details: Docstring Coverage
Explanation
Docstring coverage is 43.24% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 37 functions across 14 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
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.