Skip to content

Commit 8505a98

Browse files
perkjWebRTC LUCI CQ
authored andcommitted
Revert "Ignore allocated bitrate during initial exponential BWE."
This reverts commit 33cc835. Reason for revert: Perf bots showed that this cl cause a change in metrics. It looks like it is for the better, but we want this to be behind a field trial. Original change's description: > Ignore allocated bitrate during initial exponential BWE. > > The reason why we want to do this is because audio can allocate a needed bitrate before video when starting a call, which may lead to a race between the first probe result and updating the allocated bitrate. > That is the, initial probe will try to probe up to the max configured bitrate. > > ProbeController::SetFirstProbeToMaxBitrate will allow the first probe to > continue up to the max configured bitrate, regardless of of the max > allocated bitrate. > > Bug: webrtc:14928 > Change-Id: I6e0ae90e21a78466527f3464951e6033dc846470 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/346760 > Reviewed-by: Diep Bui <[email protected]> > Commit-Queue: Per Kjellander <[email protected]> > Reviewed-by: Erik Språng <[email protected]> > Reviewed-by: Per Kjellander <[email protected]> > Cr-Commit-Position: refs/heads/main@{#42049} (cherry picked from commit 501c4f3) Bug: chromium:335337923,webrtc:14928 Change-Id: I56ba58560b6857b6069552c02df822691f7af64d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347622 Bot-Commit: [email protected] <[email protected]> Commit-Queue: Per Kjellander <[email protected]> Reviewed-by: Diep Bui <[email protected]> Owners-Override: Per Kjellander <[email protected]> Cr-Original-Commit-Position: refs/heads/main@{#42081} Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/348722 Reviewed-by: Erik Språng <[email protected]> Cr-Commit-Position: refs/branch-heads/6422@{#2} Cr-Branched-From: b831eb8-refs/heads/main@{#42072}
1 parent 89e26b7 commit 8505a98

File tree

6 files changed

+11
-109
lines changed

6 files changed

+11
-109
lines changed

api/transport/network_types.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ struct StreamsConfig {
4646
~StreamsConfig();
4747
Timestamp at_time = Timestamp::PlusInfinity();
4848
absl::optional<bool> requests_alr_probing;
49-
// If `initial_probe_to_max_bitrate` is set to true, the first probe
50-
// may probe up to the max configured bitrate and can ignore
51-
// max_total_allocated_bitrate.
52-
absl::optional<bool> initial_probe_to_max_bitrate;
5349
absl::optional<double> pacing_factor;
5450

5551
// TODO(srte): Use BitrateAllocationLimits here.

call/rtp_transport_controller_send.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,6 @@ void RtpTransportControllerSend::ReconfigureBandwidthEstimation(
262262
RTC_DCHECK_RUN_ON(&sequence_checker_);
263263
bwe_settings_ = settings;
264264

265-
bool allow_probe_without_media = bwe_settings_.allow_probe_without_media &&
266-
packet_router_.SupportsRtxPayloadPadding();
267-
streams_config_.initial_probe_to_max_bitrate = allow_probe_without_media;
268-
pacer_.SetAllowProbeWithoutMediaPacket(allow_probe_without_media);
269-
270265
if (controller_) {
271266
// Recreate the controller and handler.
272267
control_handler_ = nullptr;
@@ -280,6 +275,9 @@ void RtpTransportControllerSend::ReconfigureBandwidthEstimation(
280275
UpdateNetworkAvailability();
281276
}
282277
}
278+
pacer_.SetAllowProbeWithoutMediaPacket(
279+
bwe_settings_.allow_probe_without_media &&
280+
packet_router_.SupportsRtxPayloadPadding());
283281
}
284282

285283
void RtpTransportControllerSend::RegisterTargetTransferRateObserver(

modules/congestion_controller/goog_cc/goog_cc_network_control.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,6 @@ NetworkControlUpdate GoogCcNetworkController::OnProcessInterval(
218218
probe_controller_->EnablePeriodicAlrProbing(
219219
*initial_config_->stream_based_config.requests_alr_probing);
220220
}
221-
if (initial_config_->stream_based_config.initial_probe_to_max_bitrate) {
222-
probe_controller_->SetFirstProbeToMaxBitrate(
223-
*initial_config_->stream_based_config.initial_probe_to_max_bitrate);
224-
}
225221
absl::optional<DataRate> total_bitrate =
226222
initial_config_->stream_based_config.max_total_allocated_bitrate;
227223
if (total_bitrate) {

modules/congestion_controller/goog_cc/probe_controller.cc

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -272,22 +272,6 @@ std::vector<ProbeClusterConfig> ProbeController::OnNetworkAvailability(
272272
return std::vector<ProbeClusterConfig>();
273273
}
274274

275-
void ProbeController::UpdateState(State new_state) {
276-
switch (new_state) {
277-
case State::kInit:
278-
state_ = State::kInit;
279-
break;
280-
case State::kWaitingForProbingResult:
281-
state_ = State::kWaitingForProbingResult;
282-
break;
283-
case State::kProbingComplete:
284-
state_ = State::kProbingComplete;
285-
waiting_for_initial_probe_result_ = false;
286-
min_bitrate_to_probe_further_ = DataRate::PlusInfinity();
287-
break;
288-
}
289-
}
290-
291275
std::vector<ProbeClusterConfig> ProbeController::InitiateExponentialProbing(
292276
Timestamp at_time) {
293277
RTC_DCHECK(network_available_);
@@ -303,8 +287,6 @@ std::vector<ProbeClusterConfig> ProbeController::InitiateExponentialProbing(
303287
probes.push_back(config_.second_exponential_probe_scale.Value() *
304288
start_bitrate_);
305289
}
306-
waiting_for_initial_probe_result_ = true;
307-
308290
return InitiateProbing(at_time, probes, true);
309291
}
310292

@@ -325,7 +307,6 @@ std::vector<ProbeClusterConfig> ProbeController::SetEstimatedBitrate(
325307
if (config_.abort_further_probe_if_max_lower_than_current &&
326308
(bitrate > max_bitrate_ ||
327309
(!max_total_allocated_bitrate_.IsZero() &&
328-
!(waiting_for_initial_probe_result_ && first_probe_to_max_bitrate_) &&
329310
bitrate > 2 * max_total_allocated_bitrate_))) {
330311
// No need to continue probing.
331312
min_bitrate_to_probe_further_ = DataRate::PlusInfinity();
@@ -354,11 +335,6 @@ void ProbeController::EnablePeriodicAlrProbing(bool enable) {
354335
enable_periodic_alr_probing_ = enable;
355336
}
356337

357-
void ProbeController::SetFirstProbeToMaxBitrate(
358-
bool first_probe_to_max_bitrate) {
359-
first_probe_to_max_bitrate_ = first_probe_to_max_bitrate;
360-
}
361-
362338
void ProbeController::SetAlrStartTimeMs(
363339
absl::optional<int64_t> alr_start_time_ms) {
364340
if (alr_start_time_ms) {
@@ -415,7 +391,6 @@ void ProbeController::SetNetworkStateEstimate(
415391
void ProbeController::Reset(Timestamp at_time) {
416392
bandwidth_limited_cause_ = BandwidthLimitedCause::kDelayBasedLimited;
417393
state_ = State::kInit;
418-
waiting_for_initial_probe_result_ = false;
419394
min_bitrate_to_probe_further_ = DataRate::PlusInfinity();
420395
time_last_probing_initiated_ = Timestamp::Zero();
421396
estimated_bitrate_ = DataRate::Zero();
@@ -477,7 +452,8 @@ std::vector<ProbeClusterConfig> ProbeController::Process(Timestamp at_time) {
477452
kMaxWaitingTimeForProbingResult) {
478453
if (state_ == State::kWaitingForProbingResult) {
479454
RTC_LOG(LS_INFO) << "kWaitingForProbingResult: timeout";
480-
UpdateState(State::kProbingComplete);
455+
state_ = State::kProbingComplete;
456+
min_bitrate_to_probe_further_ = DataRate::PlusInfinity();
481457
}
482458
}
483459
if (estimated_bitrate_.IsZero() || state_ != State::kProbingComplete) {
@@ -504,14 +480,14 @@ std::vector<ProbeClusterConfig> ProbeController::InitiateProbing(
504480
: std::min(max_total_allocated_bitrate_, max_bitrate_);
505481
if (std::min(network_estimate, estimated_bitrate_) >
506482
config_.skip_if_estimate_larger_than_fraction_of_max * max_probe_rate) {
507-
UpdateState(State::kProbingComplete);
483+
state_ = State::kProbingComplete;
484+
min_bitrate_to_probe_further_ = DataRate::PlusInfinity();
508485
return {};
509486
}
510487
}
511488

512489
DataRate max_probe_bitrate = max_bitrate_;
513-
if (max_total_allocated_bitrate_ > DataRate::Zero() &&
514-
!waiting_for_initial_probe_result_) {
490+
if (max_total_allocated_bitrate_ > DataRate::Zero()) {
515491
// If a max allocated bitrate has been configured, allow probing up to 2x
516492
// that rate. This allows some overhead to account for bursty streams,
517493
// which otherwise would have to ramp up when the overshoot is already in
@@ -579,14 +555,15 @@ std::vector<ProbeClusterConfig> ProbeController::InitiateProbing(
579555
}
580556
time_last_probing_initiated_ = now;
581557
if (probe_further) {
582-
UpdateState(State::kWaitingForProbingResult);
558+
state_ = State::kWaitingForProbingResult;
583559
// Dont expect probe results to be larger than a fraction of the actual
584560
// probe rate.
585561
min_bitrate_to_probe_further_ =
586562
std::min(estimate_capped_bitrate, (*(bitrates_to_probe.end() - 1))) *
587563
config_.further_probe_threshold;
588564
} else {
589-
UpdateState(State::kProbingComplete);
565+
state_ = State::kProbingComplete;
566+
min_bitrate_to_probe_further_ = DataRate::PlusInfinity();
590567
}
591568
return pending_probes;
592569
}

modules/congestion_controller/goog_cc/probe_controller.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ class ProbeController {
121121
Timestamp at_time);
122122

123123
void EnablePeriodicAlrProbing(bool enable);
124-
// The first initial probe ignores allocated bitrate constraints and probe up
125-
// to max configured bitrate configured via SetBitrates.
126-
void SetFirstProbeToMaxBitrate(bool first_probe_to_max_bitrate);
127124

128125
void SetAlrStartTimeMs(absl::optional<int64_t> alr_start_time);
129126
void SetAlrEndedTimeMs(int64_t alr_end_time);
@@ -151,7 +148,6 @@ class ProbeController {
151148
kProbingComplete,
152149
};
153150

154-
void UpdateState(State new_state);
155151
ABSL_MUST_USE_RESULT std::vector<ProbeClusterConfig>
156152
InitiateExponentialProbing(Timestamp at_time);
157153
ABSL_MUST_USE_RESULT std::vector<ProbeClusterConfig> InitiateProbing(
@@ -162,8 +158,6 @@ class ProbeController {
162158
bool TimeForNetworkStateProbe(Timestamp at_time) const;
163159

164160
bool network_available_;
165-
bool waiting_for_initial_probe_result_ = false;
166-
bool first_probe_to_max_bitrate_ = false;
167161
BandwidthLimitedCause bandwidth_limited_cause_ =
168162
BandwidthLimitedCause::kDelayBasedLimited;
169163
State state_;

modules/congestion_controller/goog_cc/probe_controller_unittest.cc

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -327,32 +327,6 @@ TEST(ProbeControllerTest, TestExponentialProbing) {
327327
EXPECT_EQ(probes[0].target_data_rate.bps(), 2 * 1800);
328328
}
329329

330-
TEST(ProbeControllerTest, ExponentialProbingStopIfMaxBitrateLow) {
331-
ProbeControllerFixture fixture(
332-
"WebRTC-Bwe-ProbingConfiguration/abort_further:true/");
333-
std::unique_ptr<ProbeController> probe_controller =
334-
fixture.CreateController();
335-
ASSERT_THAT(
336-
probe_controller->OnNetworkAvailability({.network_available = true}),
337-
IsEmpty());
338-
auto probes = probe_controller->SetBitrates(
339-
kMinBitrate, kStartBitrate, kMaxBitrate, fixture.CurrentTime());
340-
ASSERT_THAT(probes, SizeIs(Gt(0)));
341-
342-
// Repeated probe normally is sent when estimated bitrate climbs above
343-
// 0.7 * 6 * kStartBitrate = 1260. But since max bitrate is low, expect
344-
// exponential probing to stop.
345-
probes = probe_controller->SetBitrates(kMinBitrate, kStartBitrate,
346-
/*max_bitrate=*/kStartBitrate,
347-
fixture.CurrentTime());
348-
EXPECT_THAT(probes, IsEmpty());
349-
350-
probes = probe_controller->SetEstimatedBitrate(
351-
DataRate::BitsPerSec(1800), BandwidthLimitedCause::kDelayBasedLimited,
352-
fixture.CurrentTime());
353-
EXPECT_THAT(probes, IsEmpty());
354-
}
355-
356330
TEST(ProbeControllerTest, ExponentialProbingStopIfMaxAllocatedBitrateLow) {
357331
ProbeControllerFixture fixture(
358332
"WebRTC-Bwe-ProbingConfiguration/abort_further:true/");
@@ -378,39 +352,6 @@ TEST(ProbeControllerTest, ExponentialProbingStopIfMaxAllocatedBitrateLow) {
378352
EXPECT_THAT(probes, IsEmpty());
379353
}
380354

381-
TEST(ProbeControllerTest,
382-
InitialProbingIgnoreLowMaxAllocatedbitrateIfSetFirstProbeToMaxBitrate) {
383-
ProbeControllerFixture fixture(
384-
"WebRTC-Bwe-ProbingConfiguration/abort_further:true/");
385-
std::unique_ptr<ProbeController> probe_controller =
386-
fixture.CreateController();
387-
ASSERT_THAT(
388-
probe_controller->OnNetworkAvailability({.network_available = true}),
389-
IsEmpty());
390-
auto probes = probe_controller->SetBitrates(
391-
kMinBitrate, kStartBitrate, kMaxBitrate, fixture.CurrentTime());
392-
ASSERT_THAT(probes, SizeIs(Gt(0)));
393-
probe_controller->SetFirstProbeToMaxBitrate(true);
394-
395-
// Repeated probe is sent when estimated bitrate climbs above
396-
// 0.7 * 6 * kStartBitrate = 1260. During the initial probe, we ignore the
397-
// allocation limit and probe up to the max.
398-
probes = probe_controller->OnMaxTotalAllocatedBitrate(kStartBitrate,
399-
fixture.CurrentTime());
400-
EXPECT_THAT(probes, IsEmpty());
401-
402-
probes = probe_controller->SetEstimatedBitrate(
403-
DataRate::BitsPerSec(1800), BandwidthLimitedCause::kDelayBasedLimited,
404-
fixture.CurrentTime());
405-
EXPECT_EQ(probes.size(), 1u);
406-
EXPECT_EQ(probes[0].target_data_rate.bps(), 2 * 1800);
407-
408-
probes = probe_controller->SetEstimatedBitrate(
409-
probes[0].target_data_rate, BandwidthLimitedCause::kDelayBasedLimited,
410-
fixture.CurrentTime());
411-
EXPECT_EQ(probes.size(), 1u);
412-
}
413-
414355
TEST(ProbeControllerTest, TestExponentialProbingTimeout) {
415356
ProbeControllerFixture fixture;
416357
std::unique_ptr<ProbeController> probe_controller =

0 commit comments

Comments
 (0)