Commit Graph

2424 Commits

Author SHA1 Message Date
cnderrauber
99364f39d0 Keep negotiated codec parameters in Downtrack.Bind (#3271)
the context's codec parameters will be set to the binded codec after Bind
2024-12-19 16:16:09 +08:00
Raja Subramanian
02117a4d46 Panic fixes (#3270)
Also, do negotiated down track extensions after bind.
2024-12-19 11:52:43 +05:30
Raja Subramanian
2088870d95 check of 0 RTX payload in probe and use padding if 0 (#3269) 2024-12-19 09:18:32 +05:30
Raja Subramanian
edb426bba4 Log payload RTX. (#3268)
Seeing some instances where RTX is not getting set up.
2024-12-19 02:03:26 +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
cnderrauber
713e67cd52 Thottle the publisher data channel sending when subscriber is slow (#3255)
* Thottle the publisher data channel sending when subscriber is slow

Avoid the publisher overwhelm the sfu data channel buffer when
the subscriber has lower receive bitrates. It will drop message
if the subscriber is considered too slow to block the entire room.

* Enable nack in mediaengine and disable it in transceiver as need

pion doesn't support per transciver codec configuration, so the nack of this session will be disabled
forever once it is first disabled by a transceiver.
https://github.com/pion/webrtc/pull/2972
2024-12-18 10:51:34 +08:00
Raja Subramanian
28310b670f Update RTC config with congestion control config (#3262) 2024-12-18 00:18:13 +05:30
cnderrauber
b684da380e log frame number jump on dd structure updating (#3261) 2024-12-17 17:31:05 +08:00
Raja Subramanian
b3efdfcfe5 Up allocate to available headroom. (#3259)
There are cases where the probe result has enough headroom to up
allocate all deficient tracks. Mainly happens after a loss scenario
where the estimate is actually still high.

After boosting once, there was a check for the track to hit the desired
layer before boosting again. But, that is not really necessary. Can
boost target and forwarder should resolve to the latest target.
Removing that check in the forwarder.

Also, adding a gratuitous boost check in stream allocator periodic ping
when deficient to look for opportunities to boost.
2024-12-17 10:49:14 +05:30
Raja Subramanian
aef80d92d0 Handle REMB on RTX RTCP (#3257) 2024-12-16 17:37:03 +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
cfe3178542 Reconcile RTP stats with RTX data. (#3252)
* RTX RTPStats

* WIP

* RTCP RTX handler

* reconcile rtx

* cache size

* clean up

* test

* clean up
2024-12-15 14:33:02 +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
cnderrauber
6df339b77c Don't SetCodecPreferences for video transceiver (#3249)
The SetCodecPrefrences function will save codecs
to the transceiver and if the primary codec is not
support by the client, the saved codec will generate
rtx codec for the unsupported codec cause corrupted
sdp.
2024-12-13 21:12:30 +08:00
cnderrauber
5dd6858acf Don't wait rtp packet to fire track (#3246)
* Don't wait rtp packet to fire track

Create track from sdp instead of first rtp packet,
it is consistent with the browser behavior and
will accelerate the track publication.

* fix test
2024-12-13 15:06:14 +08:00
Raja Subramanian
789d0484e2 Add RTX to downstream (#3247)
* Add RTX to downstream

* test
2024-12-13 09:57:03 +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
d0f7eaeadb Use sens side bwe config directly. (#3241) 2024-12-10 10:01:44 +05:30
Denys Smirnov
dc6fe3aae5 Support SIP list filters. (#3240) 2024-12-09 22:57:47 +02:00
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
ceefa8d150 Reset next probe time. (#3226) 2024-12-02 11:37:02 +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
7f0c14306f One shot signalling mode fixes (#3223)
* set desired on synchronous track

* debug

* debug

* direction

* reuse

* clean up
2024-11-30 14:55:36 -08:00
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
cnderrauber
c76fb0bcf4 Disable close by dtls to fix migration (#3220)
Pion v4 imports new feature that will close
peerconnection on dtls.close to detects
remote peer closed quickly, it breaks the
session migration.
2024-11-30 09:20:45 +08:00
Raja Subramanian
44d26f0cb4 Probe controller refactor (#3221)
* WIP

* WIP

* WIP
2024-11-30 01:38:25 +05:30
Raja Subramanian
0a3ba87183 Simplify probe sleep calculations. (#3218)
* Simplify probe sleep calculations.

Splitting into buckets made it problematic around the boundaries and it
was ugly code too. Simplify and set up probes with sleep after each
probe to get the desired interval/rate.

* continue after pop
2024-11-29 13:10:49 +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
lukasIO
1c940af8c0 Add datastream packet type handling (#3210)
* Add datastream packet type handling

* point to main in protocol

* Revert "point to main in protocol"

This reverts commit 2cc6ed6520.

* Update protocol
2024-11-28 12:23:40 +01:00
cnderrauber
54f9f7de51 upgrade to pion/webrtc v4 (#3213) 2024-11-28 16:05:38 +08:00
Raja Subramanian
baf47db834 Publish data and signal bytes once every 30 seconds. (#3212)
For applications with heavy data usage, accumulating data bytes over 5
minutes and then calculating rate using a much shorter window (like 2 -
5 seconds) makes it looks like there is a massive rate spike.

While this change is not a fix, this should soften the impact.

Need a better way to handle different parts of the system operating at
different frequencies. Can use rate in the reporting window, but that
will miss the spikes. Maybe that is okay. For example, if the reporting
window is 5 minutes and there was a 100 Mbps spike for about 10 seconds
of it, it would get smoothed out.
2024-11-28 09:21:44 +05:30
Raja Subramanian
d599911405 Fix prober listener. (#3207)
This was stopping active probe and taking longer to recover.
Missed in the refactor.
2024-11-27 16:18:08 +05:30
Raja Subramanian
c0d20885db Log last switch time stamp (#3205) 2024-11-27 11:26:13 +05:30
Raja Subramanian
c328b767c9 Do not treat data publisher as publisher. (#3204) 2024-11-26 20:44:37 +05:30
Raja Subramanian
a28764479b Give rtp stats context to forwarder. (#3202) 2024-11-26 12:57:02 +05:30
Raja Subramanian
23285744ba Server side metrics (#3198)
* mbb WIP

* deps

* WIP

* WIP

* remove unused file

* Switch to enabled

* misc

* deps

* mediatransportutil update

* Typo

* Set ParticipantIdentity in metrics data packets

* use uint32 as JSON decoder does not unmarshal time.Duration
2024-11-25 13:10:48 +05:30
Raja Subramanian
d07d84f99f Sender side snap shot clean up and logging. (#3196)
* Sender side snap shot clean up and logging.

Seeing cases of sender snap shot packet loss much higher the actual
packets some times. Tracking a bit more to understand that better.
- Rename variables to indicate what is coming from feed side clearly
- Fixed an issue with wrong init of feed side loss in snapshot
- Just use the loss from receiver report as it can go back (receiver
  would subtract on receiving out-of-order packet).
- keep track sof reports in a snapshot (this is temporary for
  debugging/understanding it better and will be removed later)

* remove check
2024-11-23 10:40:10 +05:30