mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 20:37:33 +00:00
Fix TX mic hoarseness: pre-roll flush bug and wider stall margin
Pre-roll bug: when MIC_PREROLL_SAMP is an exact multiple of OPUS_FRAME_SAMP (1920/960=2), the N<=Want branch filled the buffer but never flushed it, losing the first 40ms of audio and leaving the ring empty long enough for silence blocks to be injected into WDSP. StallCount threshold raised from 2 to 4 (~43ms) to cover OS scheduler jitter of up to 22ms, preventing false silence injection when an Opus frame arrives slightly late relative to the DSP tick. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+3
-1
@@ -603,9 +603,11 @@ begin
|
||||
Want := MIC_PREROLL_SAMP - FMicPreRollPos;
|
||||
if N <= Want then
|
||||
begin
|
||||
// Pre-roll ещё не набран: просто копим
|
||||
Move(P^, FMicPreRoll[FMicPreRollPos], N * SizeOf(Single));
|
||||
Inc(FMicPreRollPos, N);
|
||||
// N = Want точно заполняет pre-roll — надо слить (иначе буфер потерян)
|
||||
if FMicPreRollPos = MIC_PREROLL_SAMP then
|
||||
FlushMicToCallback(@FMicPreRoll[0], MIC_PREROLL_SAMP);
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
||||
Reference in New Issue
Block a user