Commit Graph

39 Commits

Author SHA1 Message Date
David Zhao
3fe124c87f Log cleanup pass (#2285)
* Log cleanup pass

Demoted a bunch of logs to DEBUG, consolidated logs.

* use context logger and fix context var usage

* moved common error types, fixed tests
2023-12-02 15:07:31 -08:00
Raja Subramanian
d866b5110f Restrict scope of negotiation time out error logs (#2283)
* Restrict scope of negotiation time out error logs

1. Log "negotiation failed" only if signal channel was active
within half window of negotiation timeout. Negotiation timeout currently
is at 15 seconds. Signal pings are every 10 seconds.
2. In transport.go, do not report negotiation timed out and do not
callback negotiation failure if the peer connection state is not
connected. Goal of negotiation failure tracker is to take remedial
action when an in-session negotiation fails. Seeing a bunch of cases
of the case hitting even without ICE connection forming. Negotiation
timer is not intended for those cases.

* fix test
2023-12-02 12:44:37 +05:30
Raja Subramanian
68aebb0106 Do not mute when stream is paused. (#2069) 2023-09-13 19:59:24 +05:30
Raja Subramanian
83353d821c Make a config option to skip unmanaged tracks in bandwidth estimation (#2050)
* WIP commit

* Make a config option to skip unmanaged tracks in bandwidth estimation
2023-09-08 20:59:58 +05:30
Raja Subramanian
c122c20f49 Do not re-pause a paused track. (#2037) 2023-09-06 08:27:16 +05:30
Raja Subramanian
f0ca262bcf Prevent erroneous stream pause. (#2008) 2023-08-29 13:21:57 +05:30
David Zhao
eed8e85008 Demote more logs to debug (#1998) 2023-08-27 19:17:38 -07:00
Raja Subramanian
c0ea1b9ced Remove warning for probe rate being too high. (#1970)
Not super useful. It does happen a bunch of times especially at lower
end of estimate where the next layer up is high. We have to probe
anyway. Effects of large jumps have been mitigated by doing it for short
time.
2023-08-16 12:17:29 +05:30
Raja Subramanian
ce1fde451c Get next higher using bit rate. (#1960) 2023-08-11 17:22:56 +05:30
Raja Subramanian
9a8ea26e41 Small clean up, refactoring stringifying of trend samples (#1937) 2023-08-04 15:48:19 +05:30
Raja Subramanian
c1dfc9741c Stream allocator tweaks (#1936)
* Prevent re-allocation if possible

* log commitThreshold

* Collapse same values in the front
2023-08-04 13:47:54 +05:30
Raja Subramanian
11bdda0779 Temper stream allocator more (#1920)
* Temper stream allocator more

* gofmt

* AllowPause default
2023-07-31 12:45:21 +05:30
David Zhao
981fb7cac7 Adding license notices (#1913)
* Adding license notices

* remove from config
2023-07-27 16:43:19 -07:00
Raja Subramanian
ee1c23eb02 Move congestion controller channel observer params to config (#1910) 2023-07-27 11:48:22 +05:30
Raja Subramanian
9702d3b541 A couple of more opportunities in stream allocator. (#1906)
1. When re-allocating for a track in DEFICIENT state, try to use
   available headroom to accommodate change before trying to steal
   bits from other tracks.
2. If the changing track gives back bits (because of muting or
   moving to a lower layer subscription), use the returned bits
   to try and boost deficient track(s).
2023-07-26 15:35:07 +05:30
Raja Subramanian
0484a68342 Plug a couple of holes in stream transitions. (#1905)
* Plug a couple of holes in stream transitions.

1. Missed negative sign meant stealing bits from other tracks was not
   working.
2. When a track change (mute, unmute, subscription change) cannot be
   allocated, explicitly pause so that stream state update happens.

Refactor stream state update a bit to make it a bit cleaner.

* correct comment
2023-07-26 13:36:58 +05:30
Raja Subramanian
7e6aa00426 Remove unused fields left over from refactor (#1897) 2023-07-21 16:23:00 +05:30
Raja Subramanian
11e1eb00fa Attempt to avoid out-of-order max subscribed layer notifications. (#1882)
* Check for request layer lock only in the goroutine

* check before sending PLI

* max layer notifier worker

* test cleanup

* clean up

* do notification in the callback
2023-07-16 23:28:20 +05:30
Raja Subramanian
69a1e572be Attempt to reduce disruption due to probe. (#1839)
* Make congestion controller probe config

* Wait for enough estimate samples

* fixes

* format

* limit number of times a packet is ACKed

* ramp up probe duration

* go format

* correct comment

* restore default

* add float64 type to generated CLI
2023-06-30 11:09:46 +05:30
Raja Subramanian
2b0a470474 Less flapping in probe. (#1834)
- Increase max interval between probes to 2 minutes.
- Use a minimum probe rate of 200 kbps. This is to ensure that
the probe rate is decent and can produce a stronger signal.
2023-06-28 12:48:38 +05:30
Raja Subramanian
84994b39ab Make the samples string more readable. (#1810) 2023-06-21 11:35:38 +05:30
Raja Subramanian
2383234f6e Simplify sliding window collapse. (#1802)
* Simplify sliding window collapse.

Keep the same value collapsing simple.
Add it to sliding window as long as same value is received for longer
than collapse threshold.
But, add a prune with three conditions to process the siliding window
to ensure only valid samples are kept.

* flip the order of validity window and same value pruning

* increase collapse threshold to 0.5 seconds during non-probe
2023-06-17 18:56:38 +05:30
Raja Subramanian
395f403132 Small stream allocator tweaks. (#1800)
1. Probe end time needs to include the probe cluster running time also.
2. Apply collapse window only within the sliding window. This is to
   prevent cases of some old data declaring congestion. For example,
   an estimate could have fallen 15 seconds ago and there might have
   been a bunch of estimates at that fallen value. And the whole
   sliding window could have that value at some point. But, a further
   drop may trigger congestion detection. But, that might be acting too
   fast, i. e. on one instance of value fall. Change it so that we
   detect if there is a fall within the sliding window and apply
   collapse based on that.
2023-06-17 12:35:29 +05:30
Raja Subramanian
4805dec1f0 Create channel observer on probe reset. (#1783)
On a state change, it was possible an aborted probe was pending
finalize. When probe controller is reset, the probe channel
observer was not reset. Create a new non-probe channel observer
on state change to get a fresh start.

Also limit probe finalize wait to 10 seconds max. It is possible
that the estimate is very low and we have sent a bunch of probes.
Calculating wait based on that could lead to finalize waiting for
a long time (could be minutes).
2023-06-10 10:54:55 +05:30
Raja Subramanian
0e7bdeabcb Simplify probe done handling. (#1782)
* Simplify probe done handling.

Seeing a case where the channel abserver is not re-created after
an aborted probe. Simplifying probe done (no callbacks, making it
synchronous).

* log more
2023-06-10 02:07:28 +05:30
Raja Subramanian
22813cd2be Recreate channel observer irrespective of probe success/fail. (#1778) 2023-06-08 01:40:07 +05:30
Raja Subramanian
fdfd830394 Split probe controller from StreamAllocator. (#1751)
* Split probe controller from StreamAllocator.

With TWCC, there is a need to check for probe status
in a separate goroutine. So, probe specific stuff need
locking. Split out the probe controller to make that cleaner.

* remove defer
2023-05-29 14:41:44 +05:30
Raja Subramanian
ea57e4f2c1 Ignore receiver reports that have a sequence number before first packet. (#1745) 2023-05-28 10:05:35 +05:30
Raja Subramanian
8ed193b231 StreamAllocator - tracking more things (#1652)
* WIP commit

* Add a probe cluster mode

* better variable naming

* fix units

* WIP commit

* WIP commit

* WIP commit

* new file

* WIP commit

* Maintain history of a few things

* correct signal

* fix typo

* WIP commmit

* gofmt

* rate not sum

* adjust edges of rate monitor

* fmt

* remove debug
2023-04-25 07:31:22 +05:30
Raja Subramanian
93604d2415 A couple of stream allocator tweaks (#1628)
* A coupke of stream allocator tweaks

- Do not overshoot on catch up. It so happens that during probe
  the next higher layer is at some bit rate which is much lower
  than normal bit rate for that layer. But, by the time the probe
  ends, publisher has climbed up to normal bit rate.
  So, the probe goal although achieved is not enough.
  Allowing overshoot latches on the next layer which might be more
  than the channel capacity.
- Use a collapse window to record values in case of a only one
  or two changes in an evaluation window. Some times it happens
  that the estimate falls once or twice and stays there. By collapsing
  repeated values, it could be a long time before that fall in estimate
  is processed. Introduce a collapse window and record duplicate value
  if a value was not recorded for collapse window duration. This allows
  delayed processing of those isolated falls in estimate.

* minor clean up

* add a probe max rate

* fix max

* use max of committed, expected for max limiting

* have to probe at goal
2023-04-18 11:49:51 +05:30
Raja Subramanian
5b34d754e0 Safe access of sequencer (#1625)
* log some NACKs

* split out NACK tracker

* remove debug

* debug

* Sequencer safety

* Clean up
2023-04-17 13:02:24 +05:30
Raja Subramanian
5d187523fa Refactor NACK tracking in stream allocator (#1623)
* log some NACKs

* split out NACK tracker

* remove debug
2023-04-17 10:16:12 +05:30
Raja Subramanian
e75b73af52 Use last received if lower. (#1616)
When detecting congestion based on loss, it is possible that
the loss based signal triggers earlier and the estimate based
signal is lagging. In those cases, check against last received
estimate and if that is lower than loss based throttling, use that.

Without this, it was possible that the current usage high.
Loss based throttling may not dial things back far enough to pause
the stream. Ideally, congestion should hit again and it should be dialled
down further and eventually pause, but there are situations it never
dials back far enough to pause.
2023-04-15 13:07:47 +05:30
Raja Subramanian
d2bf8f0ba1 Support simulating subscriber bandwidth. (#1609)
* Support simualting subscriber bandwidth.

When non-zero, a full allocation is triggered.
Also, probes are stopped.

When set to zero, normal probing mechanism should catch up.

Adding `allowPause` override which can be a connection option.

* fix log

* allowPause in participant params
2023-04-13 13:59:24 +05:30
Raja Subramanian
c56e37f3fe Fix VP9 stutter in non-DD and some other misc changes (#1595)
* WIP commit

* WIP commit

* clean up

* remove todo

* fix test
2023-04-10 12:31:07 +05:30
Raja Subramanian
4969b57c09 Chaging VideoLayers -> VideoLayer (#1591)
There was mixed used. It is a struct. So, it is a singular.
Change all the places I could find. There may be more, but can be
changed when spotted.
2023-04-08 12:39:02 +05:30
Raja Subramanian
e32eaa451f Refactor video layer selector (#1588)
* WIP commit

* WIP commit

* fix test

* FPS for VP9

* WIP commit

* test changes

* WIP commit

* h264

* codec munger

* forwarder state

* clean up a bit

* dd interface

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* more TODO notes

* overshoot interface

* clean up

* clean up isTemporalSupported

* wait for key frame to resume

* clean up VP8 payload descriptor stuff

* temporal layer selector

* comment out vp9 and av1

* space

* fix test compile

* append bytes

* fix tests

* fix test
2023-04-08 10:57:57 +05:30
Raja Subramanian
2c439b3063 Fix sequence number offset on packet drop (#1556) 2023-03-29 07:43:28 +05:30
Raja Subramanian
f63962c2cc Pure code movement (#1552) 2023-03-26 23:13:17 +05:30