Commit Graph

41 Commits

Author SHA1 Message Date
David Zhao 4b3856125c chore: pin GH commits and switch to golangci-lint (#4444)
* chore: pin GH commits

* switch to golangci-lint-action

* fix lint issues
2026-04-11 13:04:22 -07:00
Raja Subramanian 52c28a938d Log a bit more details of out-of-order TWCC feedback report. (#4343)
* Log a bit more details of out-of-order TWCC feedback report.

* Revert to mono.Now()
2026-03-05 11:55:13 +05:30
changgesi d7db7cb389 chore: fix a large number of spelling issues (#4147)
Signed-off-by: changgesi <changgesi@outlook.com>
2025-12-11 09:34:13 +05:30
Raja Subramanian f7291fdaa8 Do not send both asb-send-time and twcc. (#3890)
* Do not send both asb-send-time and twcc.

In single peer connection mode, both extensions are set on the media
engine and both would be negotiated. Unfortunately, pion/webrtc does
not yet support RTPSender.SetParameters() which would allow setting
specific header extensions for the sender. So, check for TWCC enabled
and use it. If not, do abs-send-time if that is enabled.

* check BWE type

* comment
2025-08-30 19:22:14 +05:30
Raja Subramanian 758e176250 Add a trend check before declaring joint queuing region. (#3701)
* Add a trend check before declaring joint queuing region.

Seeing cases where the propagated queuing delay drops from one group to
next. Both groups are above threhold. It also recovers majority of the
time. So, introducing a trend check before declaring that queuing delay
is in joint queuing region. It is set 0.8 by default which means the
queueing delay should be trending up strongly before being declared
joint queuing region.

* deps
2025-06-05 18:51:23 -07:00
Raja Subramanian b0abb0ae6e Add option to use different pacer with send side bwe. (#3552)
Seeing a lot of queuing delay based back offs. Trying a couple of things
1. Accept a bit more queuing.
2. An option to try a different pacer. Would like to try with pass
   through. That will produce some out-of-order packets. Remains to be
   seen if it will have a negative impact.
2025-03-25 12:57:42 +05:30
Raja Subramanian a4ccc7cc7f Run bandwidth estimation when congestion is relieved also (#3380) 2025-01-30 11:57:58 +05:30
Raja Subramanian 1b86b485a9 Fix (hopefully) state transition. (#3375)
My previous PR was trying to fix a premature transition from CONGESTED -> NONE state.
But, that introduced a bug which accelerated the transition from EARLY_WARNING -> CONGESTED state due to holding the `queuingRegion` state variable.

Fix by not holding `queuingRegion` in state and take result of
processing runs.

NOTE: This can still use some work to make the state machine cleaner.
Initially, I was passing around a bunch of variables which was uncouth.
Then moved things to state which made code easier to read and also log
different things, but it causes problems like the ones above. Will take
another look and think more about making it more robust.
2025-01-29 01:00:53 +05:30
Raja Subramanian 59be7c601b Declare congestion none only if both methods are in DQR. (#3372)
* Declare congestion none only if both emthods are in DQR.

* do not change congestion reason unless queuing region changes
2025-01-28 14:10:23 +05:30
Raja Subramanian 0c28e432a3 Log RTT as seen by congestion controller (#3354) 2025-01-22 00:08:11 +05:30
Raja Subramanian 7a7e312424 Log probes. (#3352) 2025-01-21 20:51:03 +05:30
Raja Subramanian ae8c8bc941 Turn off TWCC for Firefox (#3333)
* Debug FF TWCC

* - TURN off TWCC for Firefox. Seems to fail with VP9 send, i.e. there are
  no TWCC feedback packets when sending VP9.
- Relax thresholds for congestion as staging data is showing
  oscillations.
- Clean up some logging.

* debug log a few more signal messages

* revert config

* revert config

* clean up
2025-01-15 10:32:59 +05:30
Raja Subramanian 8e90ae03f5 Log min sequence number changes. (#3331)
Seeing some negative loss count (seems to be when interacting with
Firefox, but don't have definitive proof it does not happen with
others). Debug logging a bit to understand what could cause it.

Also, consolidating some common code to process packet feedback.
2025-01-14 15:30:11 +05:30
Raja Subramanian 0dde347615 Use contiguous groups to determine queuing region. (#3308) 2025-01-07 04:00:39 +05:30
Raja Subramanian 6e9964e80b TWCC tweaks (#3282)
* SSBWE experimentation

* dqr hysteresis

* fixes

* fmt

* more relaxed DQR

* pps proportional to duration

* clean up

* clean up

* don't need gratuitous up allocation
2024-12-21 23:08:38 +05:30
Raja Subramanian 92ae45cf07 Keep more state for easier logging/debuggability (#3280) 2024-12-21 09:33:04 +05:30
Raja Subramanian 86628de6e9 Lower down trend threshold (revert change in previous PR) and fix typos. (#3267)
* fix typo

* lower CTR threshold
2024-12-19 00:03:56 +05:30
Raja Subramanian b6e99e249b Better naming/logging for send side bwe (#3264)
* Better naming/logging for send side bwe

* Check BWE congestion state before doing optimal allocation.

It is possible that BWE declares congestion, but the estimated bandwidth
may still be enough to accommodate all tracks. So, stream allocator
would still not in DEFICIENT state. On a new track allocation, it will
get optimal allocation although BWE is in congested state.

Take BWE congestion state into consideration before doing any track
allocation.

* get congestion state from BWE rather than caching it in stream allocator

* get states from update

* log contributing groups only when they are small in number

* get oldest group always

* notify only when estimate is dropping

* require stronger CTR down trend

* maintain min/max group

* relax thresholds to declare congestion a bit
2024-12-18 21:38:13 +05:30
Raja Subramanian 45b0b0312f Remove spammy log (#3263) 2024-12-18 13:34:20 +05:30
Raja Subramanian 192ecbfc88 Dampen oscillations in loss based congestion detection when using TWCC. (#3256)
* Rework congestion detection state machine

* WIP

* fmt

* clean up

* revert config
2024-12-16 15:26:23 +05:30
Raja Subramanian 699cd9c26c BWE minor tweaks (#3254)
- Clear probe id in downtracks when aborting probe
- a bit of clean up
2024-12-16 08:04:24 +05:30
Raja Subramanian be65d24333 Add method to check for probe goal reached (#3253)
* Check for early probe end

* use old packets for probing

* fmt
2024-12-15 23:34:07 +05:30
Raja Subramanian 34ccc2a578 Remote BWE tweaks (#3251) 2024-12-14 15:39:19 +05:30
Raja Subramanian 8cfea87ad0 Use RTX channel for bandwidth probing (#3250) 2024-12-14 11:51:58 +05:30
Raja Subramanian 79eda6b72b Send side BWE: tighter contributing groups (#3245)
* WIP

* clean up

* debug

* epm log

* debug

* fmt

* clean up

* default no SSBWE

* clean up
2024-12-12 14:22:31 +05:30
Raja Subramanian 4b16017d09 Send side BWE - fixes (#3244)
* WIP

* no worker

* fixes

* use congested packet groups

* oldest group

* markers

* WIP

* WIP

* WIP

* WIP

* WIP

* clean up

* fmt

* consolidate

* store last packet only for bwe extension cases
2024-12-11 21:31:26 +05:30
Raja Subramanian c172ba13e6 Cleaning up unused stream allocator experiments. (#3237)
Not sure if we will ever use it. Can bring it back if needed.
2024-12-08 13:00:58 +05:30
Raja Subramanian 7c5a558a48 Try up-allocation on neutral trend. (#3235)
* Try up-allocation on neutral trend.

Some probes end up with neutral trend due to getting much estimates of
same value. It is okay to try up-allocating in those cases. Otherwise,
the stream allocator some times gets stuck and does not up-allocate at
all as all probes end up neutral.

Changing the name of the signal to `NotCongesting` to signify it is
either neutral or clearing.

* wait 5 RTT for probe to finalize

* trend detector object encoder
2024-12-06 10:52:24 +05:30
Raja Subramanian 94488d434d TWCC probing (#3234)
* WIP

* WIP

* WIP

* make it compile

* typo

* clean up

* fmt

* fixes
2024-12-06 00:13:36 +05:30
Raja Subramanian d862917249 Record probe information in send side BWE module. (#3231)
Still not doing anythingw with it, but just making a small PR to record
that information for future use.
2024-12-04 14:31:00 +05:30
Raja Subramanian f9ee48f24b Tri-state probe signal. (#3229)
Need tri-state to indicate inconslusive, congeting and clearing.
Currently, no special treatment for inconclusive, but for future use.
2024-12-03 10:52:43 +05:30
Raja Subramanian 2dcb5c928a Freeze update on congested probe. (#3228)
Reverting back to pre-refactor behaviour. Was trying to avoid doing
special treatment when in probe, but REMB values are hard to predict
and the NACKs as well.

So, freeze updates when congesting in probe till the probe is done.
Otherwise, further changes while probe is finalising sometimes causes an
invalid signal and tracks are not up allocated.
2024-12-02 23:06:06 +05:30
Raja Subramanian 12b3da0a40 Bit more clean up around probe controller refactor (#3227)
* Bit more clean up around probe controller refactor

* consistent order
2024-12-02 13:36:27 +05:30
Raja Subramanian 156114fcaf Clean up remote BWE a bit. (#3225)
* Clean up remote BWE a bit.

- Had forgotten to start worker, fix that
- ensure correct type of channel observer (probe OR non-probe) based on
  probe state.
- introduce congested hangover state to see better state transitions.
  Does not really affect operation, but state transitions are clearer.

* prevent 0 ticker
2024-12-02 11:09:21 +05:30
Raja Subramanian 3c42ccbb64 Keep congestion state only in BWE. (#3224) 2024-12-02 09:42:51 +05:30
Raja Subramanian 8bb29c3a7b Fixes from probe controller refactor (#3222)
* Fixes from probe controller refactor

* fmt

* static check
2024-11-30 13:34:01 +05:30
Raja Subramanian 44d26f0cb4 Probe controller refactor (#3221)
* WIP

* WIP

* WIP
2024-11-30 01:38:25 +05:30
Raja Subramanian 427ed23478 Move probe observer to pacer (#3214)
* Probe ID pass

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* clean up

* typo

* populate desired bytes

* correct num probes calculation

* debug log

* remove unused constant

* log channel observer

* debug

* clear isInProbe flag on end

* clear probe flag on reset

* re-arrange
2024-11-29 09:19:48 +05:30
Raja Subramanian cd718c84f6 Misc/minor clean up. (#3183)
Cosmetic. While thinking through how to structure probing better,
noticing small things here and there. Cleaning up and making some small
PRs along the way.
2024-11-17 12:14:46 +05:30
Raja Subramanian aa2ce22655 Stringer interface (#3181) 2024-11-16 10:14:37 +05:30
Raja Subramanian 6509cdb5ea StreamAllocator (congestion controller) refactor (#3180)
* refactor WIP

* WIP

* compiling

* runlock

* fixes

* fmt

* stringer and unlikely logger

* clean up
2024-11-16 03:06:37 +05:30