From 3a8df884d1691260c93da86ce864f8c890e9d155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Terelius?= Date: Mon, 16 Dec 2019 17:46:55 +0100 Subject: [PATCH] Add field trial to avoid extra backoffs in AIMD rate control. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: None Change-Id: Iaa7dd0ffd6cfabb933e8e68a002b5432d13b9aab Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161946 Commit-Queue: Björn Terelius Reviewed-by: Sebastian Jansson Cr-Commit-Position: refs/heads/master@{#30103} --- .../remote_bitrate_estimator/aimd_rate_control.cc | 13 +++++++++---- .../remote_bitrate_estimator/aimd_rate_control.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/remote_bitrate_estimator/aimd_rate_control.cc b/modules/remote_bitrate_estimator/aimd_rate_control.cc index 560edfec0c..6c8e6eb99a 100644 --- a/modules/remote_bitrate_estimator/aimd_rate_control.cc +++ b/modules/remote_bitrate_estimator/aimd_rate_control.cc @@ -101,11 +101,13 @@ AimdRateControl::AimdRateControl(const WebRtcKeyValueConfig* key_value_config, IsNotDisabled(*key_value_config, "WebRTC-Bwe-EstimateBoundedIncrease")), initial_backoff_interval_("initial_backoff_interval"), - low_throughput_threshold_("low_throughput", DataRate::Zero()) { + low_throughput_threshold_("low_throughput", DataRate::Zero()), + link_capacity_fix_("link_capacity_fix") { // E.g // WebRTC-BweAimdRateControlConfig/initial_backoff_interval:100ms, // low_throughput:50kbps/ - ParseFieldTrial({&initial_backoff_interval_, &low_throughput_threshold_}, + ParseFieldTrial({&initial_backoff_interval_, &low_throughput_threshold_, + &link_capacity_fix_}, key_value_config->Lookup("WebRTC-BweAimdRateControlConfig")); if (initial_backoff_interval_) { RTC_LOG(LS_INFO) << "Using aimd rate control with initial back-off interval" @@ -312,8 +314,10 @@ DataRate AimdRateControl::ChangeBitrate(DataRate new_bitrate, // Set bit rate to something slightly lower than the measured throughput // to get rid of any self-induced delay. new_bitrate = estimated_throughput * beta_; - if (new_bitrate > current_bitrate_) { - // Avoid increasing the rate when over-using. + if (new_bitrate > current_bitrate_ && !link_capacity_fix_) { + // TODO(terelius): The link_capacity estimate may be based on old + // throughput measurements. Relying on them may lead to unnecessary + // BWE drops. if (link_capacity_.has_estimate()) { new_bitrate = beta_ * link_capacity_.estimate(); } @@ -329,6 +333,7 @@ DataRate AimdRateControl::ChangeBitrate(DataRate new_bitrate, } new_bitrate = std::min(new_bitrate, low_throughput_threshold_.Get()); } + // Avoid increasing the rate when over-using. new_bitrate = std::min(new_bitrate, current_bitrate_); if (bitrate_is_initialized_ && estimated_throughput < current_bitrate_) { diff --git a/modules/remote_bitrate_estimator/aimd_rate_control.h b/modules/remote_bitrate_estimator/aimd_rate_control.h index b4c59cd3be..85e4025914 100644 --- a/modules/remote_bitrate_estimator/aimd_rate_control.h +++ b/modules/remote_bitrate_estimator/aimd_rate_control.h @@ -117,6 +117,7 @@ class AimdRateControl { absl::optional last_decrease_; FieldTrialOptional initial_backoff_interval_; FieldTrialParameter low_throughput_threshold_; + FieldTrialFlag link_capacity_fix_; }; } // namespace webrtc