Commit Graph

310 Commits

Author SHA1 Message Date
Raja Subramanian
03ada9ba76 Proper RTCP report past mute. (#2588)
- When audio is muted, server injects silence frames which moves the
  time stamp forward and adjusts offset. That cannot be used against
  publisher side sender report. Use a pinned version.
- Ignore small changes to propagation delay even while checking for
  sharp increase. That is spamming a lot for small changes, i.e.
  existing delta is 100 micro seconds or so and the new one is 300 micro
  seconds. Also rename to `longTerm` from `smoothed` as it is a slow
  varying long term estimate of propagation delay delta. And slow down
  that adaptation more.
2024-03-19 11:59:24 +05:30
Raja Subramanian
4e96ad2e5b Missed clean up in the last PR (#2576)
* Missed clean up in the last PR

* Infow -> Debugw
2024-03-13 23:01:19 +05:30
Raja Subramanian
3e43f75143 Forward publisher sender report. (#2572)
* Forward publisher sender report.

Publisher side RTCP sernfer report is rebased to SFU time base
and used to send sender rerport to subscriber.

Will wait to merge till previous versions are out as this will require a
bunch of testing.

* - Add rebased report drift
- update protocol dep
- fix path change check, it has to check against delta of propagation
  delay and not propagation delay as the two side clocks could be way
  off.
2024-03-13 14:31:39 +05:30
Raja Subramanian
610d68a409 Clean up using publisher side clock rate. (#2568)
It is not used any more.
2024-03-11 12:25:07 +05:30
Raja Subramanian
50c48ff29d Ignore out-of-order receiver side sender reports. (#2567) 2024-03-11 11:30:01 +05:30
Raja Subramanian
93c7d1f4fb Adjust first packet time on down track resume. (#2566)
Allows subscriber sender report to line up better quicker.
2024-03-11 00:40:16 +05:30
Raja Subramanian
bdbc9dcbc7 Use start time stamp to calculate down stream sender report. (#2564)
* Use start time stamp to calculate down stream sender report.

With first packet time adjustment, using the first time stamp is more
accurate.

This still suffers if the up stream clock rate changes (happens in cases
like noise suppression which is not well understood). Will be looking at
pass through of sender report from publisher to subscriber.

* similar log strings

* avoid early sender reports

* log messages

* Reduce first packet adjustment threshold to 15 seconds
2024-03-10 23:18:54 +05:30
Raja Subramanian
a08b058abc Structured logging for sender report data. (#2563) 2024-03-10 01:29:37 +05:30
Raja Subramanian
0618cb39df Logging time and rtp diff for easier debugging (#2548) 2024-03-05 20:31:44 +05:30
Raja Subramanian
46257c1d24 Skip large RR intervals. (#2544) 2024-03-04 19:12:53 +05:30
Raja Subramanian
d40041d013 Use the correct snapshot id for PPS. (#2528)
* Use the correct snapshot id for PPS.

That caused connection quality to operate on small windows.

* remove debug
2024-02-29 22:48:36 +05:30
cnderrauber
a435368278 use dynamic bucket size (#2524) 2024-02-28 16:24:23 +08:00
David Colburn
098b12981f fix pli throttle locking (#2521)
* fix pli throttle locking

* UpdatePliAndTime still used in cloud
2024-02-27 20:22:38 -08:00
cnderrauber
90ab3fdf68 Reduce FrameIntegrityChecker's allocation (#2504) 2024-02-23 13:10:58 +08:00
Raja Subramanian
6895eff496 Buffer size config for video and audio. (#2498)
* Buffer size config for video and audio.

There was only one buffer size in config.
In upstream, config value was used for video.
Audio used a hard coded value of 200 packets.

But, in the down stream sequencer, the config value was used for both
video and audio. So, if video was set up for high bit rate (deep
buffers), audio sequencer ended up using a lot of memory too in
sequencer.

Split config to be able to control that and also not hard code audio.

Another optimisation here would be to not instantiate sequencer unkess
NACK is negotiated.

* deprecate packet_buffer_size
2024-02-21 22:58:56 +05:30
Raja Subramanian
4404b6796b Some optimisations in the forwarding path. (#2035)
* WIP commit

* WIP

* Fix tests

* clean up

* Release pool in pacer

* fix tests

* fix tests

* remove debug

* fix test
2024-02-20 10:32:35 +05:30
David Zhao
8371848747 Version 1.5.3 (#2489)
* Version 1.5.3

* add missing copyright notices

* update protocol for redis.tls YAML keys
2024-02-17 12:37:15 -08:00
Raja Subramanian
f7b6e915cb Fix return on dropping a padding packet. (#2479)
Had deleted an extra line while cleaning up.
2024-02-13 14:24:31 +05:30
Raja Subramanian
0bcd9a2f8b Remove some noisy logs (#2477) 2024-02-13 12:01:20 +05:30
Raja Subramanian
49fd332e91 Store first SR also as it can get reset (#2472) 2024-02-12 12:14:25 +05:30
Raja Subramanian
89a312d259 Ignore duplicate RID. (#2471)
Firefox on Windows 10 seems to be producing simulcast tracks with
duplicate RID. That causes a leak as only one buffer is processed.

Ignore duplicate rid.

NOTE: This is not perfect as the actual layer -> rid is indeterminable
at addition time. It would require looking at packets to determine the
video dimensions and match to rid/layer to figure out which one is
correct and which one is duplicate.

To simplify though, taking the first one and dropping later ones.
This could mean the correct resolution is not streamed, but that should
be okay. The leak is far more destructive.
2024-02-12 11:49:14 +05:30
cnderrauber
af0a8fbbbc add log for extpacket accumulated (#2454) 2024-02-06 21:38:36 +08:00
cnderrauber
be87a1b6f0 Support rtx for publisher (#2452)
* Support rtx for publisher

* remote log

* solve comment
2024-02-06 21:30:37 +08:00
Raja Subramanian
b7147efb87 Close published tracks on participant close (#2446) 2024-02-05 13:41:41 +05:30
Raja Subramanian
7c16ca6a0c Log feed Sender Report to better understand forwarded sender report (#2443)
anomalies.
2024-02-04 11:12:22 +05:30
Raja Subramanian
d0128b19cd Reset sender reports before measuring clock skew. (#2437) 2024-02-02 21:52:43 +05:30
Raja Subramanian
174e69c81d Restore min score to 30. (#2435)
Was at 20 when LOST was introduced, but was going to 20 even when under
not LOST conditions. When there are packets, want the min to be at 30.
Going down to 20 resulted in reporting LOST quality even when packets
were flowing (although they were experiencing heavy loss and quality
would have been very bad, yet they are not lost).

Also, sample warning about adding packet to bucket even more.
2024-02-02 08:52:52 +05:30
Raja Subramanian
ff69c2aa11 Add debug to understand VP9 freezes. (#2434)
* Add debug to understand VP9 freezes.

Have reports of VP9 freezing in some rooms.
Some data indicates that NACKs are received by SFU, but cannot get RTP
packet when that happens. It is possible that the NACKs are all from
dropped packets. Adding some debug to understand drops/NACKs better.

* enable DD debug

* comment out DD debug

* markers

* add back log about diff length mismatch

* add back key frame mismatch logging

* log skipped drops also
2024-01-31 15:33:39 +05:30
Raja Subramanian
a1ca41a4e1 Skip reporting skew for out-of-order reports (#2369) 2024-01-08 13:11:04 +05:30
Raja Subramanian
faff67162b Consolidate TrackInfo. (#2331)
* Consolidate TrackInfo.

TrackInfo was spread across a bit. Consolidating it.

* TODO comments

* test

* update TrackInfo on SSRC change

* further consolidation

* log mimes only

* update receivers on SSRC set

* clone proto on return

* feedback: break loop on mime match

* prevent data race
2023-12-21 09:56:54 +05:30
Raja Subramanian
1f335dd564 Convert to formatter string for lazy evaluation. (#2298) 2023-12-06 18:11:05 +05:30
Raja Subramanian
83efa9258e Bump up protocol for connection quality LOST. (#2297)
Also log trackID/trackInfo in layer mapping.
2023-12-06 16:59:05 +05:30
cnderrauber
e1cc9d6b3c Fix log marshal error (#2295) 2023-12-06 00:08:48 +08:00
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
2299a493de Throttle DD parse logs (#2281) 2023-12-01 12:42:12 +05:30
Raja Subramanian
2ee5aa7c98 Add optional supervisor disable. (#2277)
* Add optional supervisor disable.

Used `DisableSupervisor` so that default can be enabled and
it can be disabled explicity. But, open to defaulting to disable
(i. e. change param to `EnableSupervisor`).

* Move nil check to call site
2023-11-30 13:04:31 +05:30
cnderrauber
0f1c1ec224 clean dd log (#2275)
* clean dd log

* Implemented Raja's feedback

---------

Co-authored-by: David Zhao <dz@livekit.io>
2023-11-29 12:12:29 -08:00
Raja Subramanian
bfc4f19c74 Guard against bad quality in trackInfo (#2271) 2023-11-28 22:28:30 +05:30
Raja Subramanian
53542b09a0 Participant traffic load. (#2262)
* Participant traffic load.

Capturing information about participant traffic
- Upstream/Downstream
- Audio/Video/Data
- Packets/Bytes

This captures a notion of how much traffic load a participant is
generating.

Can be used to make allocation decisions.

* Clean up

* SIP patches

* reporter goroutine

* unlock

* move traffic stats from protocol

* check type
2023-11-26 23:05:00 +05:30
Raja Subramanian
8c3ec742e6 Use now for end time (#2248)
* Use now for end time

* less arithmetic
2023-11-17 12:00:47 +05:30
Raja Subramanian
c62382c76e Clean up restart a bit. (#2247) 2023-11-17 00:40:00 +05:30
Raja Subramanian
440f00bcac Declare audio inactive if stale. (#2229)
* Declare audio inactive if stale.

Stale samples were used to declare audio active.
Maintain last update time and declare inactive if samples are stale.

* correct comment

* spelling

* check level in test
2023-11-08 11:13:39 +05:30
Raja Subramanian
12a9d74acb Do not restart on receiver side. (#2224)
* Do not restart on receiver side.

Restart with wrap back causes issues in the forwarding path
as the subscriber assumes the extended type from receiver side does
not restart.

Restart was an attempt to include as many packets as possible, but
in practice is not super useful. So, taking it out. Can clean up
a bit more stuff, but want to run this first and check for any oddities.

* fix test
2023-11-06 10:41:56 +05:30
cnderrauber
f247b68ed6 Make sure dd selector uses correct keyframe to select packets (#2218)
* Make sure dd selector uses correct keyframe to select packets

* Fix test case

* remove unsed field
2023-11-03 17:49:02 +08:00
Raja Subramanian
0bdfdb0c49 Squelching DD reader error. (#2215)
Squelching Structure is nil error as it can happen on packets
received before a key frame is received.
2023-11-02 11:10:28 +05:30
Raja Subramanian
45346d7c76 Clean up condition that is not happening (#2207) 2023-11-01 15:17:09 +05:30
Raja Subramanian
c93a88bd9b Log starts on metadata cache overflow. (#2206) 2023-11-01 10:55:07 +05:30
cnderrauber
1f0ba21854 Fix svc: Drop frame is earlier than current keyframe (#2196)
* Fix svc: Drop frame is earlier than current keyframe

* Log detail of dependencydescriptor
2023-10-27 13:57:03 +08:00
Raja Subramanian
ce8f64176a Log correct time difference (#2192) 2023-10-26 15:34:49 +05:30
Raja Subramanian
490b9f4f4c No sync when starting from nothing (#2191)
When starting from scratch (like mute -> unmute), it is possible
that the check sync does not detect a broken chain. That results
in PLIs not being sent and the video frozen till a gratuitous key
frame arrives.

Unclear why there are not PLIs from client side. That is something else to
dig into.
2023-10-26 13:39:11 +05:30