You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
replace the mixer-side last-frame replay/concealment workaround with input-buffer priming
keep a small real-audio cushion in each member audio_buffer before the conference mixer starts consuming it
when a primed input buffer briefly drains below one complete frame, wait 1 ms and retry a real read before marking it unprimed
mark the buffer unprimed again if it still cannot provide a complete real frame, so it re-primes from the input thread instead of replaying synthetic audio
clear and unprime the input buffer when member media is configured/reset
Why
The issue is an input-thread underflow: the mixer can become phase-locked to a member input thread and sample the buffer just before the next real frame arrives. The previous approach concealed that by replaying the last frame, but that can corrupt FSK tones because it synthesizes audio. This version avoids replay and only mixes frames that came from the input thread.
Testing
git diff --check
verified no remaining audio_underflow / replay helper references in mod_conference
Full compile/test was not available in my Windows workspace because gcc, clang, cl, make, and cmake were not present in PATH.
We had a similar fix implemented already. Unfortunately, this fix won't work for the FSK tones. The real fix should be eliminating the actual input thread underflow condition.
Thanks @figaro2015, I reworked the patch around that point.
The updated commits (4eed0b2, refined by 1e1fb29) remove the last-frame replay/concealment path and instead prime each member input audio_buffer with a small real-audio cushion before the mixer consumes it. If a primed buffer briefly drains below a complete frame, the mixer gives the input thread a 1 ms grace period and retries a real read; if no complete real frame arrives, the buffer is marked unprimed and has to re-prime from the input thread again. That keeps the fix on real input frames and avoids synthesizing/repeating samples, which should be compatible with FSK tones.
Local checks: git diff --check, plus verified the old audio_underflow / replay helper references are gone. I still cannot compile in this Windows workspace because the C toolchain is unavailable here.
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
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.
Closes #3024.
Summary
audio_bufferbefore the conference mixer starts consuming itWhy
The issue is an input-thread underflow: the mixer can become phase-locked to a member input thread and sample the buffer just before the next real frame arrives. The previous approach concealed that by replaying the last frame, but that can corrupt FSK tones because it synthesizes audio. This version avoids replay and only mixes frames that came from the input thread.
Testing
git diff --checkaudio_underflow/ replay helper references inmod_conferenceFull compile/test was not available in my Windows workspace because
gcc,clang,cl,make, andcmakewere not present in PATH.