diff --git a/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc b/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc index c32c26b2f8..ee8bf5d59a 100644 --- a/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc +++ b/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc @@ -118,7 +118,7 @@ void UpdatesTargetRateBasedOnLinkCapacity(std::string test_name = "") { truth->PrintRow(); s.RunFor(TimeDelta::seconds(50)); truth->PrintRow(); - EXPECT_NEAR(client->target_rate().kbps(), 90, 20); + EXPECT_NEAR(client->target_rate().kbps(), 90, 25); } } // namespace diff --git a/modules/congestion_controller/goog_cc/probe_controller.cc b/modules/congestion_controller/goog_cc/probe_controller.cc index 1b13694c01..65150db271 100644 --- a/modules/congestion_controller/goog_cc/probe_controller.cc +++ b/modules/congestion_controller/goog_cc/probe_controller.cc @@ -73,10 +73,6 @@ constexpr char kBweRapidRecoveryExperiment[] = // Never probe higher than configured by OnMaxTotalAllocatedBitrate(). constexpr char kCappedProbingFieldTrialName[] = "WebRTC-BweCappedProbing"; -// Only do allocation probing when in ALR (but not when network-limited). -constexpr char kAllocProbingOnlyInAlrFieldTrialName[] = - "WebRTC-BweAllocProbingOnlyInAlr"; - void MaybeLogProbeClusterCreated(RtcEventLog* event_log, const ProbeClusterConfig& probe) { RTC_DCHECK(event_log); @@ -138,9 +134,6 @@ ProbeController::ProbeController(const WebRtcKeyValueConfig* key_value_config, limit_probes_with_allocateable_rate_( key_value_config->Lookup(kCappedProbingFieldTrialName) .find("Disabled") != 0), - allocation_probing_only_in_alr_( - key_value_config->Lookup(kAllocProbingOnlyInAlrFieldTrialName) - .find("Enabled") == 0), event_log_(event_log), config_(ProbeControllerConfig(key_value_config)) { Reset(0); @@ -202,8 +195,7 @@ std::vector ProbeController::OnMaxTotalAllocatedBitrate( int64_t max_total_allocated_bitrate, int64_t at_time_ms) { const bool in_alr = alr_start_time_ms_.has_value(); - const bool allow_allocation_probe = - allocation_probing_only_in_alr_ ? in_alr : true; + const bool allow_allocation_probe = in_alr; if (state_ == State::kProbingComplete && max_total_allocated_bitrate != max_total_allocated_bitrate_ && diff --git a/modules/congestion_controller/goog_cc/probe_controller.h b/modules/congestion_controller/goog_cc/probe_controller.h index 3d18f4cc87..f22acff25f 100644 --- a/modules/congestion_controller/goog_cc/probe_controller.h +++ b/modules/congestion_controller/goog_cc/probe_controller.h @@ -132,7 +132,6 @@ class ProbeController { const bool in_rapid_recovery_experiment_; const bool limit_probes_with_allocateable_rate_; - const bool allocation_probing_only_in_alr_; // For WebRTC.BWE.MidCallProbing.* metric. bool mid_call_probing_waiting_for_result_; int64_t mid_call_probing_bitrate_bps_; diff --git a/modules/congestion_controller/goog_cc/probe_controller_unittest.cc b/modules/congestion_controller/goog_cc/probe_controller_unittest.cc index e64f4141fe..f82e7d46ca 100644 --- a/modules/congestion_controller/goog_cc/probe_controller_unittest.cc +++ b/modules/congestion_controller/goog_cc/probe_controller_unittest.cc @@ -97,7 +97,6 @@ TEST_F(ProbeControllerTest, InitiatesProbingOnMaxBitrateIncrease) { } TEST_F(ProbeControllerTest, ProbesOnMaxBitrateIncreaseOnlyWhenInAlr) { - test::ScopedFieldTrials trials("WebRTC-BweAllocProbingOnlyInAlr/Enabled/"); probe_controller_.reset( new ProbeController(&field_trial_config_, &mock_rtc_event_log)); auto probes = probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps, @@ -364,6 +363,7 @@ TEST_F(ProbeControllerTest, ConfigurableProbingFieldTrial) { clock_.AdvanceTimeMilliseconds(5000); probes = probe_controller_->Process(NowMs()); + probe_controller_->SetAlrStartTimeMs(NowMs()); probes = probe_controller_->OnMaxTotalAllocatedBitrate(200000, NowMs()); EXPECT_EQ(probes.size(), 1u); EXPECT_EQ(probes[0].target_data_rate.bps(), 400000); diff --git a/video/end_to_end_tests/probing_tests.cc b/video/end_to_end_tests/probing_tests.cc index 3e5feaffd1..2ead94ed67 100644 --- a/video/end_to_end_tests/probing_tests.cc +++ b/video/end_to_end_tests/probing_tests.cc @@ -234,6 +234,7 @@ TEST_F(ProbingEndToEndTest, ProbeOnVideoEncoderReconfiguration) { void PerformTest() override { *success_ = false; int64_t start_time_ms = clock_->TimeInMilliseconds(); + int64_t max_allocation_change_time_ms = -1; do { if (clock_->TimeInMilliseconds() - start_time_ms > kTimeoutMs) break; @@ -264,22 +265,34 @@ TEST_F(ProbingEndToEndTest, ProbeOnVideoEncoderReconfiguration) { } break; case 1: - if (stats.send_bandwidth_bps <= 210000) { + if (stats.send_bandwidth_bps <= 200000) { + // Initial probing finished. Increase link capacity and wait + // until BWE ramped up enough to be in ALR. This takes a few + // seconds. BuiltInNetworkBehaviorConfig config; config.link_capacity_kbps = 5000; send_simulated_network_->SetConfig(config); - + ++state_; + } + break; + case 2: + if (stats.send_bandwidth_bps > 240000) { + // BWE ramped up enough to be in ALR. Setting higher max_bitrate + // should trigger an allocation probe and fast ramp-up. encoder_config_->max_bitrate_bps = 2000000; encoder_config_->simulcast_layers[0].max_bitrate_bps = 1200000; task_queue_->SendTask([this]() { send_stream_->ReconfigureVideoEncoder(encoder_config_->Copy()); }); - + max_allocation_change_time_ms = clock_->TimeInMilliseconds(); ++state_; } break; - case 2: + case 3: if (stats.send_bandwidth_bps >= 1000000) { + EXPECT_LT( + clock_->TimeInMilliseconds() - max_allocation_change_time_ms, + kRampUpMaxDurationMs); *success_ = true; observation_complete_.Set(); } @@ -289,7 +302,9 @@ TEST_F(ProbingEndToEndTest, ProbeOnVideoEncoderReconfiguration) { } private: - const int kTimeoutMs = 3000; + const int kTimeoutMs = 10000; + const int kRampUpMaxDurationMs = 500; + test::SingleThreadedTaskQueueForTesting* const task_queue_; bool* const success_; SimulatedNetwork* send_simulated_network_;