diff --git a/src/engine/engine_config.h b/src/engine/engine_config.h index 3433e1e1..9f5be0b6 100644 --- a/src/engine/engine_config.h +++ b/src/engine/engine_config.h @@ -27,8 +27,10 @@ #define AUDIO_MIX_CHANNEL_COUNT 16 #define AUDIO_DEVICEPAIR_INPUTBUFFER 16384 -// Avoid too high resampler quality - it can take many CPU and cause gaps in playing -#define AUDIO_RESAMPLER_QUALITY 1 +// Resampler quality on the Speex 0..10 scale. Quality 1 upsampling (e.g. G.711 8k -> 48k) +// adds audible aliasing and hurts PVQA/AQuA scores; 7 is a good fidelity/CPU balance for a +// single mono stream on modern ARM64. Raise toward 10 for max fidelity if CPU allows. +#define AUDIO_RESAMPLER_QUALITY 7 #define AEC_FRAME_TIME 10 #define AEC_TAIL_TIME 160 diff --git a/src/engine/media/MT_AudioReceiver.cpp b/src/engine/media/MT_AudioReceiver.cpp index fd7d435f..86cfc2b7 100644 --- a/src/engine/media/MT_AudioReceiver.cpp +++ b/src/engine/media/MT_AudioReceiver.cpp @@ -381,6 +381,12 @@ AudioReceiver::AudioReceiver(const CodecList::Settings& settings, MT::Statistics // Avoid collecting too much data mRtpBuffer.setHigh(240ms); + // Keep a non-zero low-water cushion. With low-water at 0 the buffer drains all the way to + // empty before reacting, so ordinary clock drift / jitter periodically starves the decoder + // and forces silence/PLC insertion (heard as periodic artifacts, uncounted by rtp_lost / + // rtp_dropped). Holding ~60ms lets a late packet arrive before the buffer underruns. + mRtpBuffer.setLow(60ms); + // Resamplers are lazy inside; there is no actual memory allocation mResampler8.start(AUDIO_CHANNELS, 8000, AUDIO_SAMPLERATE); mResampler16.start(AUDIO_CHANNELS, 16000, AUDIO_SAMPLERATE);