Repository navigation
fix(voice): don't spin the audio receiver while DAVE isn't ready - #639
Merged
topi314 merged 2 commits intoOct 28, 2026
Merged
Conversation
topi314
reviewed
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When DAVE isn't ready,
receive()returns right away andopen()calls it again with no wait. It never gets toReadPacket(the only call that blocks), so the loop spins until the session is ready. That happens during every handshake and transition, or forever if the session never recovers.With a stub session that never becomes ready, I measured ~72M
Ready()checks and a full core used in one second. With this change it's 50 checks and ~2ms of CPU: it waits one frame (20ms) before checking again, same as the sender loop does between frames.This only affects bots that receive audio. Mine only sends, so I don't have prod numbers for this one, just the test.
It doesn't depend on #604: that one delays starting the loops until UDP is ready, but DAVE still isn't ready during the handshake after that, so the spin is still there. The only overlap is the import block.