Skip to content

Apply min and max bitrate options to loss based BWE#433

Open
zaki699-blip wants to merge 1 commit into
pion:mainfrom
zaki699-blip:fix-loss-bwe-min-max-bitrate
Open

Apply min and max bitrate options to loss based BWE#433
zaki699-blip wants to merge 1 commit into
pion:mainfrom
zaki699-blip:fix-loss-bwe-min-max-bitrate

Conversation

@zaki699-blip

Copy link
Copy Markdown

Description

SendSideBWEMinBitrate and SendSideBWEMaxBitrate are currently only applied to the delay-based controller (send_side_bwe.go passes send.minBitrate/send.maxBitrate into newDelayController, but newLossBasedBWE receives only the initial bitrate and hardcodes its bounds at 100 kbps / 100 Mbps).

Because the final estimate is effectively min(delayEstimate, lossEstimate) (getEstimate does e.bitrate = min(wantedRate, e.bitrate)), the hardcoded loss floor overrides the configured minimum in practice: under sustained loss the loss controller decays to exactly 100_000 bps and stays there, since it only recovers at 1.05× per 200 ms and only while measured loss stays below 2%.

We hit this in production with a media server distributing a high-bitrate live stream: every peer on a constrained link reported exactly 100 kbps despite SendSideBWEMinBitrate(500_000), making the estimates unusable for downstream decisions.

Change

Pass the configured min/max through to newLossBasedBWE so both controllers honor the same bounds. Two lines of plumbing plus regression tests:

  • sustained 100% loss never decays the loss estimate below the configured minimum
  • clean feedback never grows it above the configured maximum

No public API changes.

SendSideBWEMinBitrate and SendSideBWEMaxBitrate were only applied to
the delay-based controller. The loss-based controller hardcoded its
bounds at 100 kbps / 100 Mbps, and since the combined estimate is
min(delayEstimate, lossEstimate), sustained loss pinned the reported
estimate at exactly 100 kbps regardless of the configured minimum:
the loss controller only recovers at 1.05x per 200 ms and only while
loss stays under 2 percent.

Pass the configured min and max through to newLossBasedBWE so both
controllers honor the same bounds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant