Commit Graph

603 Commits

Author SHA1 Message Date
shishirng 3e7fae96ea Add telemetry method to capture max video_quality (#457)
* Add telemetry method to capture max video_quality

Signed-off-by: shishir gowda <shishir@livekit.io>

* Telemetry fakes

Signed-off-by: shishir gowda <shishir@livekit.io>

* Update go mod dep

Signed-off-by: shishir gowda <shishir@livekit.io>
2022-02-22 19:08:49 -05:00
Raja Subramanian 870190624e Fix no-video with adaptive streaming (#456)
* Fix no-video with adaptive streaming

With a recent change to initialize max quality for subscriber
synchronously, a subsequent update at the same quality was
getting ignored. So, there was no message back to publisher
to start up video layers. Reproducible every time the subscriber
joined after all the layers of publishers was turned off.

While not pretty, for now, disable the check for quality match
on subscriber update. That disabling itself is fine as there is
another check for consolidated quality match before sending
a message to the publisher, but in general this area has shown
some shakiness and needs some work.

* Use notify function to set initial quality also
2022-02-22 10:34:18 -08:00
David Zhao a48cb6d0c4 Avoid deadlock during room close (#451)
* avoid deadlock during room closse

* better fix
2022-02-20 21:14:57 -08:00
Raja Subramanian 3f38172139 Types for ConnectionID, NodeID, ParticipantKey (#450)
* Types for ConnectionID, NodeID, ParticipantKey

* latest protocol version
2022-02-21 08:52:11 +05:30
Raja Subramanian f209e9319a Reset channel observer in resetState (#449)
* Reset channel observer in resetState

* Spelling fix
2022-02-20 20:52:17 +05:30
Raja Subramanian 1e459e91cc Stream priority (#448) 2022-02-19 13:17:55 +05:30
David Zhao c20fb237d5 Initialize subscriber quality to default layer (#444) 2022-02-18 09:21:24 -08:00
Raja Subramanian dd4cec7724 Deleting unused code in stream allocator (#447) 2022-02-18 21:10:52 +05:30
Raja Subramanian 92d47ec421 Resync uses SSRC change. Reset to 0 when a resync is needed. (#446) 2022-02-18 16:26:27 +05:30
Raja Subramanian babbfb37aa Include NACK ratio in congestion control (#443)
* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* Clean up

* Remove debug

* Remove unneeded change

* fix test

* Remove incorrect comment

* WIP commit

* Reset probe after estimate trends down

* WIP commit

* variable name change

* WIP commit

* WIP commit

* out-of-order test

* WIP commit

* Clean up

* more strict probe NACKs
2022-02-18 14:21:30 +05:30
shishirng 7fcb887eb8 use delta bytes in window to identify max layer (#442)
total_bytes is aggregate, when we switch from higher layer to lower
layer, it takes time for lower layers total_bytes to catch up to
stopped higher layers

Signed-off-by: shishir gowda <shishir@livekit.io>
2022-02-17 15:15:10 -05:00
Raja Subramanian d04f4d12d1 Throttle RTX under certain conditions to prevent RTX storm (#440)
* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* Clean up

* Remove debug

* Remove unneeded change

* fix test

* Remove incorrect comment

* WIP commit

* Reset probe after estimate trends down

* WIP commit

* variable name change

* Clean up

* Remove debug logs

* gofmt
2022-02-17 13:33:44 +05:30
Raja Subramanian 0bbed7f0bd Use padding for probing (#434)
* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* Clean up

* Remove debug

* Remove unneeded change

* fix test

* Remove incorrect comment

* Reset probe after estimate trends down
2022-02-17 11:03:23 +05:30
shishirng c534099e3a fix connection_scores not being sent to telemetry during delta calc (#439)
Signed-off-by: shishir gowda <shishir@livekit.io>
2022-02-16 19:31:59 -05:00
Raja Subramanian 7b086ecf4c Do not send RTCP if receiver is closed (#438) 2022-02-16 18:57:43 +05:30
Raja Subramanian d69ee14696 Make stream tracker very forgiving for layer 0. (#437)
With screen sharing in Chrome 97, static content sends one packet
a second. Layer 0 stream tracker was configured to expect 2 per second.
Make it very relaxed so that one packet in two seconds declares layer 0
active.
2022-02-16 18:28:41 +05:30
cnderrauber 32d8af6da0 repeat request pli until first keyframe received (#436) 2022-02-16 19:57:55 +08:00
Raja Subramanian c9cfb0d362 Need to return delta the new provisional layer takes. (#433) 2022-02-11 14:04:47 +05:30
Raja Subramanian f3a6f58006 Use correct publisher id in stream state update (#432) 2022-02-11 12:09:48 +05:30
Raja Subramanian a6338992e8 Stop forwarding on congestion (#429)
* WIP commit

* comment out debug stuff
2022-02-11 09:17:53 +05:30
shishirng 8680f6fd23 Send trackInfo object in TRACK_SUBSCRIBED event (#431)
Need track details in subscribed events

Signed-off-by: shishir gowda <shishir@livekit.io>
2022-02-10 16:48:16 -05:00
shishirng e96e8e7f97 Clean up closed tracks stats and handle -ve packet_lost (#430)
Signed-off-by: shishir gowda <shishir@livekit.io>
2022-02-10 11:21:17 -05:00
cnderrauber f3572d2654 tune speaker detector more sensitive (#427)
* tune speaker detector more sensitive
2022-02-10 16:39:59 +08:00
David Zhao aadfc97b0b Minor cleanup, updated docs to reflect Swift (#428) 2022-02-10 00:31:09 -08:00
shishirng 6f7e6c4556 Compute delta stats to send downstream (#426)
* Compute delta stats to send downstream

Signed-off-by: shishir gowda <shishir@livekit.io>

* Update tests: total_packets should be diff between 2 packets

First packet was 1, second was 4. diff should be 3

Signed-off-by: shishir gowda <shishir@livekit.io>

* If there are no videoLayers, do not sent in Stats

For audio and Downstream tracks, we do not  get layers

Signed-off-by: shishir gowda <shishir@livekit.io>

* Use prev Max layer for current delta and update layer info for next round
2022-02-09 20:45:53 -05:00
Raja Subramanian aff25afb70 NACKs with min/max intervals and exponential backoff retries (#425)
* NACKs with min/max intervals and exponential backoff retries

* simplify
2022-02-09 19:00:03 +05:30
Raja Subramanian f4f9df375f Ignore 0 RTT for nacker (#424)
- Propagate when a track is added
- Reduce scope of lock
2022-02-09 14:08:07 +05:30
Raja Subramanian 222b02aa73 RTT (#420)
* Consolidating PLI throttle

Use the throttler in `sfu.WebRTCReceiver`.

Does change shape of config object.

* Move PLIThrottleConfig to sfu.WebRTCReceiver

* fix test compile

* Cleaning up unused stuff

* improve readability

* RTT

- Calculate down track RTT using RTCP Receiver report
- Surface it back to the participant
- Participant updates all its published trackes
  (throttled to limit update to once in 5 seconds)
- That propagates to all the upstream sfu.Buffer and the nacker.
  So, we will have RTT throttled NACKs.

* rtt callback
2022-02-09 09:34:40 +05:30
shishirng 562546829b handle remote ip address in case of forwarding (#421)
Signed-off-by: shishir gowda <shishir@livekit.io>
2022-02-08 16:13:55 -05:00
Raja Subramanian 3117547d60 Consolidating PLI throttle (#419)
* Consolidating PLI throttle

Use the throttler in `sfu.WebRTCReceiver`.

Does change shape of config object.

* Move PLIThrottleConfig to sfu.WebRTCReceiver

* fix test compile

* Cleaning up unused stuff

* readability improvement
2022-02-08 22:50:43 +05:30
Raja Subramanian fee3009853 Use buffer channel for all RTCP messages (#418)
RTCP messages are going through two channel hops now.
Maybe we don't need that anymore now that the original
problem is diagnosed. But, pushing all RTCP via
the callbackOps channel for now to make it consistent.
2022-02-08 17:19:59 +05:30
Raja Subramanian e948ecb3a8 Duplicate packets should not update packet loss counter (#417) 2022-02-08 16:32:49 +05:30
Raja Subramanian d3ca4a37a8 Proper context for down track logger (#416)
It was having two participants (both publisher and subscriber).
Fix it by getting logger from susbcriber and adding track context.
2022-02-08 15:54:45 +05:30
Raja Subramanian bce3a9b10a Tigether scoping on connection stats lock. (#415) 2022-02-08 13:51:44 +05:30
cnderrauber 00b2a216c7 fix deadlock cause underlying buffer full (#413)
* fix deadlock cause underlying buffer full
2022-02-08 16:00:56 +08:00
Raja Subramanian 941cac8dfc set DTLS retransmit interval to 100 ms (#414) 2022-02-07 23:43:41 -08:00
Raja Subramanian 36289bbca7 FPS (#410)
* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* Clean up

* Clean up

* Store RTT in stats

* spelling mistake

* Make tests compile

* Fix test compilation error

* fix tests

* clone

* latest protocol
2022-02-08 12:53:14 +05:30
David Zhao a6eb4290d3 Generate telemetry stubs (#412) 2022-02-07 23:15:24 -08:00
shishirng 32b56e0fd6 Add ParticipantActive telemetry method (#411)
* Add ParticipantActive telemetry method

Signed-off-by: shishir gowda <shishir@livekit.io>

* fix test

Signed-off-by: shishir gowda <shishir@livekit.io>

* Update go mod

Signed-off-by: shishir gowda <shishir@livekit.io>
2022-02-07 17:23:39 -05:00
David Zhao 81521f80db Support for custom TURN servers (#409)
Closes #271
2022-02-05 23:15:58 -08:00
David Zhao e6c236357a Option to disable ICE-Lite to improve compatibility (#408) 2022-02-05 22:57:47 -08:00
Raja Subramanian 4a9b844781 Process RTX packets for TWCC (#406)
The SRTP replay detection was disabled recently.
But, they were effectively getting dropped in `sfu.bucket`.

Doing two things with RTX packets in this PR
1. Update stats - add to packet count and bytes
2. Process header extension - to process TWCC
2022-02-05 23:25:53 +05:30
Raja Subramanian 7f2a5ae036 latest DTLS to fix long delay connections (#405) 2022-02-05 13:14:06 +05:30
Raja Subramanian 9c3794144e Force DTLS role client for the simulated client side peer connection (#403)
* Force DTLE role client for the simulated client side peer connection
during migration.

Without that, with remote side being ice-lite (i. e. server offer
is subscriber peer connection), pion chooses the server DTLS role
and both side end up being servers.

* pion/webrtc -> 3.1.21

* remove local reference

* Use setup from previous answer

* more comments
2022-02-04 23:11:27 +05:30
Raja Subramanian 4388a68b7e Breaking up calc for easier reading. (#402)
* WIP commit

* fix test

* More clean up

* cast to right size

* use local variable

* set a default RTT

* Do not log RTX, although need to figure out source of RTX

* fix test
2022-02-04 14:18:25 +05:30
Raja Subramanian 05c8a6b2fd Cleaning/simplifying some buffer bits (#398)
* Cleaning/simplifying some buffer bits

1. NACKs are always inserted in order. So, get rid of
bunch of out-of-order handling in there and simplify.
2. For now, removing triggering a key frame from NACKs.
Let subs drive it.
3. Move to 16-bit sequence numbers except for receiver
report handling. Simplify bits about unwrapping sequence
number on all packets.
4. Remove unused code.

* remove unused field
2022-02-04 08:43:32 +05:30
David Zhao 6f6d55345b Use ParticipantInfo version to ensure consistency (#399)
* Use ParticipantInfo version to ensure consistency

Deprecating time.Time and avoid locking unnecessarily

* properly adjust ulimit. update protocol

* Save initial version from params

* get rid of metadata field, use grants copy

* fix test
2022-02-03 17:10:52 -08:00
David Colburn 7bbd238188 clean up logs and imports (#400) 2022-02-03 14:20:19 -07:00
David Zhao a8d43aab67 Uses IceLite only for protocol 6 clients (#397)
* Update to Pion v3.1.20, with fixes DTLS role ambiguity

* Gate ice-lite on protocol version

Co-authored-by: boks1971 <raja.gobi@tutanota.com>
2022-02-02 21:16:08 -08:00
Raja Subramanian ede39fe87f Disable SRTP replay protection (#396) 2022-02-02 16:31:07 +05:30