From a42041a3ae4c035288ea02e1c3de54726e566600 Mon Sep 17 00:00:00 2001 From: Victor Gaydov Date: Wed, 14 Aug 2024 00:33:23 +0400 Subject: [PATCH] gh-688: A bit more conservative defaults for jitter --- src/internal_modules/roc_audio/jitter_meter.cpp | 16 ++-------------- src/internal_modules/roc_audio/jitter_meter.h | 6 +++--- src/internal_modules/roc_audio/latency_config.h | 2 +- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/internal_modules/roc_audio/jitter_meter.cpp b/src/internal_modules/roc_audio/jitter_meter.cpp index 5f6778628..824ab9e3a 100644 --- a/src/internal_modules/roc_audio/jitter_meter.cpp +++ b/src/internal_modules/roc_audio/jitter_meter.cpp @@ -13,23 +13,11 @@ namespace roc { namespace audio { bool JitterMeterConfig::deduce_defaults(audio::LatencyTunerProfile latency_profile) { - if (jitter_window == 0) { - if (latency_profile == audio::LatencyTunerProfile_Responsive) { - jitter_window = 10000; - } else { - jitter_window = 30000; - } - } - - if (peak_quantile_window == 0) { - peak_quantile_window = jitter_window / 5; - } - if (envelope_resistance_coeff == 0) { if (latency_profile == audio::LatencyTunerProfile_Responsive) { - envelope_resistance_coeff = 0.05; + envelope_resistance_coeff = 0.07; } else { - envelope_resistance_coeff = 0.1; + envelope_resistance_coeff = 0.10; } } diff --git a/src/internal_modules/roc_audio/jitter_meter.h b/src/internal_modules/roc_audio/jitter_meter.h index 1adb550e5..d17608f59 100644 --- a/src/internal_modules/roc_audio/jitter_meter.h +++ b/src/internal_modules/roc_audio/jitter_meter.h @@ -95,12 +95,12 @@ struct JitterMeterConfig { double peak_quantile_coeff; JitterMeterConfig() - : jitter_window(0) + : jitter_window(50000) , envelope_smoothing_window_len(10) , envelope_resistance_exponent(6) , envelope_resistance_coeff(0) - , peak_quantile_window(0) - , peak_quantile_coeff(0.90) { + , peak_quantile_window(10000) + , peak_quantile_coeff(0.92) { } //! Automatically fill missing settings. diff --git a/src/internal_modules/roc_audio/latency_config.h b/src/internal_modules/roc_audio/latency_config.h index bc7146157..e6fb46529 100644 --- a/src/internal_modules/roc_audio/latency_config.h +++ b/src/internal_modules/roc_audio/latency_config.h @@ -181,7 +181,7 @@ struct LatencyConfig { , starting_timeout(5 * core::Second) , cooldown_dec_timeout(5 * core::Second) , cooldown_inc_timeout(15 * core::Second) - , max_jitter_overhead(1.15f) + , max_jitter_overhead(1.2f) , mean_jitter_overhead(3.00f) { }