fix: don't re-invoke exhausted source during keep-alive silence - #913
Draft
roderickvd wants to merge 2 commits into
Draft
fix: don't re-invoke exhausted source during keep-alive silence#913roderickvd wants to merge 2 commits into
roderickvd wants to merge 2 commits into
Conversation
SourcesQueueOutput::next() kept calling current.next() on the just-exhausted source every time the keep-alive silence budget ran out, instead of moving past it. Sources with side effects in next() (like EmptyCallback) fired repeatedly for as long as the queue stayed empty, instead of exactly once. Track exhaustion explicitly and stop calling next() on current once observed, while still checking the queue every frame so a newly appended source starts with no added latency.
Member
Author
|
Converting to draft because we're not done yet (see Discord: 100% busy-looping when no source has been added yet). @yara-blue I haven't dived into the engine rewrite PRs yet; if we are to back port this (do we need to at all?) then in which "phase PR" should I be looking? |
Member
That should be Phase four. I'll make a note in the tracking issue to check for this since with the new traits I rewrote the queue mechanic (to prevent allocating on the audio thread). |
21 tasks
- Introduce a format-aware Empty and allow queue keep-alive with an optional source (Option<Box<dyn Source + Send>>) instead of a bool. - Add Mixer helpers (channels, sample_rate, silence) and Player::new_with_keep_alive/connect_new to use a silence keep-alive. - Cache peeked metadata in SourcesQueueOutput to correctly report channel/sample_rate while the queue is briefly empty.
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.
SourcesQueueOutput::next()kept callingcurrent.next()on the just-exhausted source every time the keep-alive silence ran out, instead of moving past it. Sources likeEmptyCallbackfired repeatedly for as long as the queue stayed empty, instead of once.This PR tracks exhaustion explicitly and stops calling
next()on current once observed, while still checking the queue every frame so a newly appended source starts with no added latency.