Commit Graph

807 Commits

Author SHA1 Message Date
David Zhao
5fcd682fb0 Refactor participant metadata updates to avoid duplication (#1679)
* Refactor participant metadata updates to avoid duplication

* generated fakes
2023-05-03 13:50:45 -07:00
Paul Wells
87e2b2366e reduce log level of signal close errors (#1675)
* reduce log level of signal close errors

* update psrpc

* cleanup

* cleanup
2023-05-02 08:31:12 -07:00
Raja Subramanian
35b8319b08 Remove disallowed subscriptions on close. (#1668)
With subscription manager, there is no need to tell a publisher
about a subscriber going away. Before subscription manager,
the up track manager of a participant (i. e. the publisher side)
was holding a list of pending subscriptions for its published tracks
and that had to be cleaned up if one of the subscriber goes away.
That is not the case any more.

Also set publisherID early so that subscription permission update has
the right publisherID. In fact, saw an empty ID in the logs and saw
that we still have the disallowed subscription handling which is not
necessary any more.
2023-04-29 09:18:07 +05:30
Benjamin Pracht
a08cd23b6d Adopt pion logging initialization moving to protocol (#1667) 2023-04-28 10:51:41 -07:00
Raja Subramanian
1148d38978 hopefully more stable tests (#1665)
* hopefully more stable tests

* do eventual checks as some callbacks happen in go routines.

Needs a bit more work to ensure that some conditions do not happen.
But, with goroutines, the amount of wait is always tricky.``
2023-04-28 17:02:31 +05:30
Raja Subramanian
3f3b02357c Check all transport connected for subscriber only properly. (#1661) 2023-04-27 23:06:15 +05:30
Raja Subramanian
c1c4e8aea0 Include packetsMissing field in string representation (#1659)
* Include packetsMissing field in string representation

* do not set stub directly
2023-04-27 14:39:05 +05:30
Paul Wells
f9f89cd7cf close signal with reliable message (#1658)
* close signal with reliable message

* update protocol
2023-04-26 22:59:39 -07:00
Paul Wells
11eedf4514 update participant to support signal broadcast skipping (#1657)
* update participant to support signal broadcast skipping

* cleanup

* lock

* feedback

* order

* update requireBroadcast in SetPermissions
2023-04-26 17:11:33 -07:00
David Zhao
b4ea4de5c0 Skip room updates to participants unless they are active 2023-04-24 15:24:50 -07:00
David Zhao
279b3604c3 Add back ServerRegion and ServerVersion (#1650)
clients are still dependent on them
2023-04-23 23:10:00 -07:00
David Zhao
3f64828a77 Send Room updates when participant counts change (#1647)
Reduces the number of unneeded generation with ProtoProxy
2023-04-22 21:08:59 -07:00
Paul Wells
745410bd69 only increment participant version after updates (#1646)
* only increment participant version after updates

* fix test util

* cleanup

* test uptrackmanager permission update version check
2023-04-22 17:48:10 -07:00
cnderrauber
09af509edb Add subscription limits (#1629)
* Add subscription limits

* Add limit to ParticipantParams

* Don't change desired of subscription when reaching limits

* Add subscription limits config

* Revert comment

* solve comments
2023-04-20 14:15:30 +08:00
cnderrauber
ab42aed360 Add flag to control candidate fallback when udp unstable (#1630)
* Add flag to control candidate fallback when udp unstable

* Don't close rtcpreader if downtrack will be resumed
2023-04-19 14:56:16 +08:00
cnderrauber
d9cd07c4b1 Return chosen codec for simulcast codecs (#1624)
* Return chosen codec for simulcast codecs

* Increase timeout for subscription test
2023-04-17 15:31:28 +08:00
cnderrauber
0ce3ba418f Update pion to parse multiple simulcast sdp correctly (#1621) 2023-04-17 10:41:07 +08:00
David Zhao
40ceddd18b Integrate QueuedNotifier, fixes out-of-order delivery (#1615) 2023-04-15 01:20:23 -07:00
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
David Zhao
f8a94c2125 Fixed timing-related failures with tests (#1608) 2023-04-12 21:01:57 -07:00
cnderrauber
c70a5c831f Refine transport fallback for client resuming (#1597)
* reset fallback after ice restart

* Configure ice for reconnect before send response
2023-04-10 15:12:05 +08:00
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
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
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
f63962c2cc Pure code movement (#1552) 2023-03-26 23:13:17 +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
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
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
cnderrauber
1a78dba3e0 Detect client short ice connection (#1532) 2023-03-21 09:50:43 +08: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
David Zhao
5ff72a99b9 Report publish & subscribe RTPStats as Telemetry events (#1506) 2023-03-10 10:28:54 -08:00
imcdd
1f4fd6aafe 1. Fix wrong atomic pkg from go1.19 std sync/atomic to go.uber.org/atomic (#1479)
2. Fix CI buildtest config '>=1.18' to '1.18',ensure compatibility with go1.18
2023-03-07 23:27:26 -08:00
cnderrauber
11ae7fdbb6 Don't switch candidate if signal closed when pc failed (#1498)
* Don't switch candidate if signal closed when pc failed

* change comment

* test case
2023-03-08 15:16:40 +08:00
cnderrauber
38deab8991 Send room update while client reconnecting (#1499) 2023-03-07 15:59:40 +08:00
cnderrauber
48cf30ba23 Send disconnected participant update for reconnecting user (#1495)
* Send disconnected participant update for reconnecting user

* clean code
2023-03-07 09:13:15 +08:00
Raja Subramanian
c3b9849328 Return high quality when there are no tracks. (#1493) 2023-03-06 09:08:02 +05:30
Raja Subramanian
9e327b1f3c Connection quality (#1490)
* Make connection quality not too optimistic.

With score normalization, the quality indicator showed good
under conditions which should have normally showed some badness.

So, a few things in this PR
- Do not normalize scores
- Pick the weakest link as the representative score (moving away from
  averaging)
- For down track direction, when reporting delta stats, take the number
  of packets sent actually. If there are holes in the feed (upstream
  packet loss), down tracks should not be penalised for that loss.

State of things in connection quality feature
- Audio uses rtcscore-go (with a change to accommodate RED codec). This
  follows the E-model.
- Camera uses rtcscore-go. No change here. NOTE: THe rtscore here is
  purely based on bits per pixel per frame (bpf). This has the following
  existing issues (no change, these were already there)
  o Does not take packet loss, jitter, rtt into account
  o Expected frame rate is not available. So, measured frame rate is
    used as expected frame rate also. If expected frame rate were available,
    the score could be reduced for lower frame rates.
- Screen share tracks: No change. This uses the very old simple loss
  based thresholding for scoring. As the bit rate varies a lot based on
  content and rtcscore video algorithm used for camera relies on
  bits per pixel per frame, this could produce a very low value
  (large width/height encoded in a small number of bits because of static content)
  and hence a low score. So, the old loss based thresholding is used.

* clean up

* update rtcscore pointer

* fix tests

* log lines reformat

* WIP commit

* WIP commit

* update mute of receiver

* WIP commit

* WIP commit

* start adding tests

* take min score if quality matches

* start adding bytes based scoring

* clean up

* more clean up

* Use Fuse

* log quality drop

* clean up debug log

* - Use number of windows for wait to make things simpler
- track no layer expected case
- always update transition
- always call updateScore
2023-03-05 12:55:04 +05:30
cnderrauber
4277699600 Add option to enable skip tcp ice if tcp rtt is high (#1484)
* Add option to switch tcp ice only if tcp works well

* solve comment

* rename and remove config change
2023-03-01 16:45:39 +08:00
cnderrauber
29fa61068e enable nack if red encoding disabled (#1477) 2023-02-28 12:44:25 +08:00
cnderrauber
c367c36d8f Add config for active red encoding (#1476) 2023-02-28 10:44:47 +08:00
David Zhao
8c43b7b48f Fix unsubscribed speakers stuck as speaking to clients (#1475)
When we unsubscribe from a speaker, SendSpeakerUpdates will drop updates
from that speaker. This has the side effect of dropping the "clearing"
message that we are sending as well.
2023-02-26 23:56:09 -08:00
David Zhao
ade26f7c9e Keep track of pending reconciles to avoid duplicate queueReconcile (#1474) 2023-02-26 23:45:32 -08:00
Raja Subramanian
73399dd565 Encapsulate better. (#1466)
Only `logger` and `trackID` of `trackSubscription` is directly accessed
from outside. They are set at construction time. So, should be fine.
2023-02-24 09:34:03 +05:30
David Zhao
34fcf9e496 Additional case of subscribing to a closed track (#1465)
When the publisher stops publishing, the individual receivers would close
attached DownTracks first before notifying MediaTrackReceiver callbacks.

This means #1454 does not fix the issue entirely since there is still a window
when we can subscribe to a closing track.
2023-02-23 17:07:16 -08:00