Commit Graph

1357 Commits

Author SHA1 Message Date
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
David Zhao
e03f75d6a1 Implements source-specific permissions and client-driven metadata updates (#1590)
Closes #1565
2023-04-07 23:47:49 -07:00
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
cnderrauber
fb301e6e75 Add vp9 svc support by Dependency Descriptor (#1586)
* Add VP9 SVC support

* Fix preferred fps does not work

* Fix forwarder test
2023-04-06 21:51:33 +08:00
Paul Wells
6b0cb33c53 set participant node for redis router in signal service (#1584) 2023-04-05 16:08:25 -07:00
Paul Wells
234f7ea5cb read batched signal messages (#1583)
* batch signal messages

* update protcol
2023-04-05 14:41:52 -07:00
Paul Wells
5552062228 drain signal stream before closing (#1582)
* drain signal stream before closing

* update psrpc

* cleanup
2023-04-05 12:29:52 -07:00
Paul Wells
6636e37664 add prometheus psrpc metrics observer (#1571)
* add prometheus psrpc metrics observer

* record rpc error counts

* update psrpc

* update protocol
2023-04-05 03:50:43 -07:00
Paul Wells
5564bc531f write signal messages from media without blocking (#1580) 2023-04-05 03:42:59 -07:00
David Zhao
fc6a306031 Create a helper for retrieving a user's actual IP (#1579) 2023-04-04 19:32:49 -07:00
Raja Subramanian
793e61ac14 Use bandwidth requested from last allocation. (#1577)
* Use bandwidth requested from last allocation.

With overshoot/opportunistic forwarding, It is possible that
bitrate at target layers is 0. So, use bandwidth requested
from last allocation which shouold have a correct value.

Still need to think about using the latest bit rates to get
the requested bandwidth. It is possible that bitrates have
changed since last allocation. That was the idea behind using
the latest bitrates, but it could return 0. Accounting for it
runs into a few scenarios. Last allocation has number from
last allocation and is a good indicator of the need.

* race
2023-04-04 09:58:57 +05:30
cnderrauber
8cfba1308b Add test case for munged sdp (#1574)
* Add test case for munged sdp

* clean code
2023-04-04 09:28:47 +08:00
David Zhao
1cb6cc3ed7 Do not sample per participant to reduce memory usage (#1576) 2023-04-03 15:24:53 -07:00
Paul Wells
1b09fc9721 fix panic in rtpstats (#1570) 2023-04-01 12:39:13 -07:00
David Zhao
602f987ed7 Switch up ordering DTLS elliptic curves to reduce likelihood of filtering (#1568)
tl;dr. Pion-based traffic is impacted because TOR Snowflake uses Pion
https://github.com/pion/dtls/pull/474
2023-03-31 22:47:23 -07:00
Paul Wells
c45e23be3f store participant res sink in interface typed field (#1567) 2023-03-31 00:45:50 -07:00
David Zhao
82fd3e865e Fix deadlock caused by subscription manager test (#1563)
We held the lock if subscription length check fails
2023-03-30 17:10:32 -07:00
Raja Subramanian
59961c1992 Aggregate method for RTPDeltaInfo (#1562) 2023-03-30 13:34:52 +05:30
Paul Wells
aaab3b8ce8 fix signal client message buffer size (#1561)
* fix signal client message buffer size

* update psrpc dep
2023-03-29 16:34:45 -07:00
Raja Subramanian
de80f521de Increase sequence number cache to handle higb rate tracks. (#1560)
Hopefully temporary while we can find a better solution.
Adds 36 KB per SSRC. So, if a node can handle 10K SSRCs (roughly 10K
tracks), that will be 360 MB of extra memory.
2023-03-29 22:32:39 +05:30
Raja Subramanian
2c439b3063 Fix sequence number offset on packet drop (#1556) 2023-03-29 07:43:28 +05:30
Raja Subramanian
de86ccb3df Calculate stats duration. (#1554) 2023-03-28 07:18:31 +05:30
David Colburn
108b251045 egress updated webhook (#1555) 2023-03-27 16:34:44 -07:00
Raja Subramanian
f63962c2cc Pure code movement (#1552) 2023-03-26 23:13:17 +05:30
Raja Subramanian
afdae26972 Log timestamp jumps greater than 0.5 seconds. (#1551)
Would be good to check if this happens and if it correlates to any A/V
sync reports.
2023-03-26 12:52:50 +05:30
renovate[bot]
2fce780ce8 Update go deps (#1402)
* Update go deps

Generated by renovateBot

* use generics with Deque

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: David Zhao <dz@livekit.io>
2023-03-25 23:17:04 -07:00
davidliu
f05a3a047a add handling for react native and rust sdk client infos (#1544) 2023-03-25 01:27:37 +09:00
David Zhao
d8356e012e Give proper grace period when recorder is still in the room (#1547)
When a recorder is in the room, we would skip grace period due
to a bug with how LastLeftAt was set. This would cause RoomComposite
templates to exit immediately if the last participant in the room reconnects.
2023-03-23 23:57:11 -07:00
Raja Subramanian
d7750a60ec Unify the forwarder between dependency descriptor and no DD case. (#1543) 2023-03-23 17:23:14 +05:30
Raja Subramanian
db2e9f1f8b Use layer 2 for SVC always. (#1542)
This fixes the case of screen share forwarding. We should probably also
look at proper AddTrack. The problem was that
- AddTrack used two layers for screen share from JS sample app
- Track was published with rid = f. Given that and the track info,
  consistent layer mapping set the layer as 1.
- `getBufferLocked` always uses the highest layer for SVC
- Between the two, when down track was requesting PLI, there was
  no buffer at the requested layer and hence no PLI went out.

A few other notes
- Tried locking SVC to layer 0 (instead of layer 2), but that resulted
  in PLI layer lock spamming. It did not happen in v1.3.0 of the server
  though. Not sure what causes that. Need to investigate later.
  But, that does not happen when using layer 2 buffer as SVC buffer.
- When using layer 2 for SVC, the PLI throttle config will be using that
  of layer 2. Is that okay?
- `buffer` structure should maintain more stats about spatial layers for
  SVC case so that layer stats can be reported to analytics/scoring etc.
- In general, `buffer` may need some more hooks to make it SVC aware so
  that it can handle various spetial layer aware/specific bits.
2023-03-23 13:16:14 +05:30
David Colburn
191a9e8014 update core to 0.0.5 (#1540)
* update core

* sort imports

* fix typos

* redundant types
2023-03-22 16:53:23 -07:00
Raja Subramanian
0ea88e4025 Ensure sequence number continuity (#1539)
* Ensure sequence number continuity

When using Go SDK (livekit-cli or egress) as a client,
SFU sends blank frames when audio track is muted to ensure that
Pion OnTrack fires on GoSDK side. That resulted in a huge sequence
number/time stamp jump when the real stream started.

Ensure continuity by creating random sequence number/time stamp when
starting with a blank frames. And when sequence number/time stamp is
initialized using SetLastSnTs, continue sequence if it was already
initialized.

* remove debug
2023-03-22 23:08:26 +05:30
Raja Subramanian
23c03f6add Fix av1 forwarding. (#1538) 2023-03-22 15:35:24 +05:30
Raja Subramanian
e7c5872758 Dependent RTT/jitter control. (#1537) 2023-03-22 11:59:32 +05:30
Raja Subramanian
f782c8956d Extend range of GOOD scores. (#1536)
Empirically, the experience is not bad for a larger range.
So, triggering POOR too early causes confusion.
2023-03-22 11:36:30 +05:30
Raja Subramanian
c76c35474c Init RTT/jitter in snapshot, else get 0 some times (#1534) 2023-03-21 11:50:47 +05:30
cnderrauber
1a78dba3e0 Detect client short ice connection (#1532) 2023-03-21 09:50:43 +08:00
David Colburn
e8c7506d60 update deprecated egress client warning (#1533) 2023-03-20 13:46:47 -07:00
Raja Subramanian
65ad4b2c43 Doing a pass at demoting logs (#1531)
A few more candidates to think about demoting
- Publisher mute changes
- Forwarder -> layer lock/upgrade/downgrade/overshoot adjusting
- StreamAllocator
2023-03-20 12:22:08 +05:30
Raja Subramanian
f770f0cb67 Use pointer to struct in logging (#1530) 2023-03-19 21:57:35 +05:30
Raja Subramanian
aeefbb080e Account for time before measurement available in connection quality. (#1528) 2023-03-19 18:34:56 +05:30
Raja Subramanian
bbba3f8168 With opportunistic forwarding, no need to not remove layer 0 (#1529) 2023-03-19 18:19:15 +05:30
Raja Subramanian
7d857c9557 Discount upstream + processing jitter from down stream jitter. (#1527)
* Discount upstream + processing jitter from down stream jitter.

Jitter in RTCP Receiver Report from down stream tracks includes
jitter from up stream tracks and any processing in forwarding path.
As packets are forwarded without any buffering (i. e. no de-jittering)
in the SFU, any up stream jitter will carry forward.

While taking delta stats (which is used for connection quality and
reporting to analytics), discount the up stream + processing jitter so
that connection quality score of down stream track is not penalized
due to up stream + processing jitter.

NOTE: Not discounting it in RTP stats ToString/ToProto methods as
that information is useful to have for analysis/debugging.

* fix typo
2023-03-18 10:25:20 +05:30
Raja Subramanian
8635b0652f Start bit rate worker only for video tracks (#1523) 2023-03-15 17:40:09 +05:30
Raja Subramanian
ed2eaaabb2 Add layer mute notification (#1522)
* Layer mute

* clean up

* clean up

* set max temporal layer seen on down track add
2023-03-15 15:24:17 +05:30
Raja Subramanian
582adda97c Fix connection quality in constrained up stream (#1521)
A few things
1. Have to use expected layer in upstream distance to desired. Using
min(published, expected) means if expected is higher than published, it was not caught as a missed layer.
2. Forgot to remove layer transition update in one place. It was still constrained to screen share.
This caused quality to not pick up after constraint is released.
3. Switching to max layer cannot be marked on max published. Same as point #1 above. Otherwise,
dynacast would kick in and turn off highest layer.
2023-03-15 13:27:27 +05:30
Raja Subramanian
5bef98dc2a Switching to layer based quality for camera tracks also. (#1520)
There are cases where the layer bit rate configuration is such that
the expected bitrate difference is very high. For example,
setting up layer 2 (f) layer for 1.7 Mbps and layer 1 (h) for 180 kbps.
With bitrate based quality, a layer drop results in going to `POOR`
quality rating. With layer based, it will drop one level only.

Also, cleaning up the distance to desired calculation a bit.
2023-03-15 11:51:14 +05:30
Paul Wells
04150c044b count active signal sessions (#1519)
* count active signal sessions

* fix

* generate fake
2023-03-14 17:35:32 -07:00
David Colburn
b23a0e7f39 add active filter to ListEgress (#1517)
* add active filter to ListEgress

* update test

* missed a filter
2023-03-14 13:07:00 -07:00
Raja Subramanian
c2335968de Prevent evaluation over small wkndow. (#1516)
With push model (i. e. connection quality evaluation triggered
by reception of RTCP receiver report), it is possible that a report
is received quickly after a track is started (especially with video).
Those should not trigger a quality evaluation.

Set `lastStatsAt` in `Start` routine and ensure that start has been
called and enough time has passed since last stats time to avoid
small windows.
2023-03-14 16:27:39 +05:30