Commit Graph

112 Commits

Author SHA1 Message Date
cnderrauber
128199e634 don't send datatrack info to client (#492)
* don't send datatrack info to client
2022-03-08 17:05:26 +08:00
cnderrauber
608da4ba4b stats for pli and bitrate (#487)
* stats for pli and bitrate

* solve comments

* return 0 if no pli sent
2022-03-07 14:59:01 +08:00
David Zhao
7a5b5dbc69 Pass back serverRegion in when participant's joining (#479)
* Pass back serverRegion in when participant's joining

* fix tests

* protocol update
2022-03-02 13:36:19 -08:00
cnderrauber
913ef3a646 Datatrack for data channel (#476)
* data track
2022-03-01 15:48:20 +08:00
cnderrauber
c2d3e6e33e create data channel from sync state (#469)
* create data channel from sync state

* fix fake type
2022-02-25 18:32:02 +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
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
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
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
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 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
745939ec24 Smoother dynacast transition (#390) 2022-01-31 07:47:24 +05:30
Raja Subramanian
3bfdb2523e Catch some instances of traversing map outside lock (#388)
* one more place, do not range over map outside lock

* Catch one more location

* Catching a couple of more places
2022-01-29 20:14:36 +05:30
David Zhao
9747243ce2 Honor autoSubscribe when subscription permissions are granted later (#381)
* Ensure autosubscribe is honored when subscription permissions were granted later

* negotiate even if no media has been added

* don't double-negotiate
2022-01-28 09:55:10 -08:00
Raja Subramanian
f962fef2c8 Apply subscribed track settsings on add (#379) 2022-01-28 08:34:13 +05:30
David Colburn
e7e3fcac43 remove duplicate IsRecorder 2022-01-24 20:51:57 -07:00
David Colburn
627a93298e IsRecorder (#368)
* IsRecorder

* regenerate fakes
2022-01-24 18:22:10 -07:00
David Zhao
52fc53d325 Issue updated tokens to clients. (#365)
This ensures client reconnect attempts would be successful for long running rooms. It also fixes inaccurate permissions that were set incorrectly when full reconnections take place.
2022-01-23 23:15:49 -08:00
Raja Subramanian
6a46958870 Some receiver clean up (#364) 2022-01-23 08:22:39 +05:30
Raja Subramanian
d1848ab218 Rename UpdateSubscriptionPermissions -> SubscriptionPermission and other renaming (#363)
* Store subscription permission in DB

* Comment out subscription permission to DB

* WIP commit

* Clean up

* clean up

* Latest protocol
2022-01-22 12:16:15 +05:30
cnderrauber
2886ab1e39 RemoveSubscriber through pariticipant (#359) 2022-01-21 12:32:26 +08:00
Raja Subramanian
3d56b7c7f3 Adjustments to allow permissions migration. (#356)
* Adjustments to allow permissions migration.

* Fix tests
2022-01-21 09:43:59 +05:30
cnderrauber
0acb0a9d66 don't send black screen when Track be resumed (#352)
* don't send black screen when Track be resumed

* default flush
2022-01-19 18:14:38 +08:00
David Colburn
5bea9debb7 Code cleanup (#353) 2022-01-19 02:13:06 -08:00
Raja Subramanian
10714b3f6d Adjust interfaces to better work with cloud (#349)
* Adjust interfaces to better work with cloud

* force argument to quality update
2022-01-19 10:28:55 +05:30
Raja Subramanian
f662119ca4 Add roomID to logger util (#345) 2022-01-17 16:36:10 +05:30
Raja Subramanian
e67db84b3b Remove stubs (#331)
* WIP commit

* Use LocalParticipant interface

* Remove no-op local participant

* Remove localparticipant

* Remove no-op stubs

* Consolidate PublishedTrack into MediaTrack
2022-01-12 00:11:48 +05:30
David Zhao
c2ba26eee6 Handle SimulateScenario requests (#330)
* Handle SimulateScenario requests

* actually use sendLeave

* fix local test failures due to filehandle limit
2022-01-11 00:37:24 -08:00
Raja Subramanian
e82b8ea0a0 No op implementation to remove stubs in remote (#327)
* No op implementation to remove stubs in remote

* Place interface first
2022-01-10 19:17:58 +05:30
Raja Subramanian
f3d14f9b04 Rename state for consistency (#325) 2022-01-10 13:31:12 +05:30
Raja Subramanian
a9e0598210 uptrackmanager reuse (#318)
* WIP commit

* Remove the double lock

* Remove unused variable

* WIP commit

* Fix test

* WIP commit

* Split out MediaTrackReceiver

* Address comments from David
2022-01-09 10:45:49 +05:30
cnderrauber
8582ca4c9b Session migration (#319)
* migrate between nodes

* session migration

* bug fix

* use version instead of query parameter

* clean code

* clean

* merge master

* solve comments

* solve comment

* update go.mod

Co-authored-by: cnderrauber <zengjie9004@gmail.com>
2022-01-08 18:54:23 +08:00
Raja Subramanian
ecf9590d56 More abstractions (#316) 2022-01-07 01:46:15 +05:30
Raja Subramanian
5064f35c29 Refactor media track subscriptions (#314)
* Refactor media track subscriptions

- To enable re-use of common bits
- Add max quality from other nodes

* Lock close handlers slice

* Reverting multiple on close handlers of downtrack, unclear if it is needed yet

* Make Logger a pointer

* audio level in MediaTrack like remote media track

* Cleanup

* Add a no subscribers callback

* Add method to update subscribed quality from another node

* loss proxying from remote node

* Address comments from David

* create subscriber node quality map
2022-01-06 09:02:11 +05:30
boks1971
973420faf5 Revert "Refactor media track subscriptions"
This reverts commit 9ca85454ed.
2022-01-04 16:57:49 +05:30
boks1971
9ca85454ed Refactor media track subscriptions
- To enable re-use of common bits
- Add max quality from other nodes
2022-01-04 16:40:47 +05:30
Raja Subramanian
995c1e8676 type aliases -> type definitions (#312)
* type alias -> type definition

* participantSid -> participantID in a comment

* Update protocol
2022-01-03 12:43:58 +05:30
Raja Subramanian
3a9009ae12 type definition of room name (#311)
* WIP commit

* update protocol

* Fixing a test and catching one place where casting was missed

* Fix one more spot which need conversion from livekit.RoomName -> string

* do not covert list
2022-01-02 16:49:16 +05:30
Raja Subramanian
07db1ba726 Some more files with types (#302) 2021-12-30 16:43:20 +05:30
Raja Subramanian
9d78619ca3 Catching a few more files with types (#299)
* Use types in mediatrack.go

* A bunch more files get types

* One more file
2021-12-29 23:51:06 +05:30
Raja Subramanian
ee99a323d2 Publisher controlled flex permissions (#284)
* WIP commit

* Add some tests

* allowedSubscribers uses participant sid

* correct variable name

* correct another variable name

* Add ParticipantSid to SubscriptionPermissionUpdate message

* protocol v0.11.2

* WIP commit

* WIP commit

* fix tests

* Remove unused code

* Close uptrack manager

* Remove duplicate close

* move comment to the correct line where the loop could be long

* Fix disallowed list revocation, thank you Jie

* Remove unneeded interface method

* RemoveSubscriber in Participant

* Clean up disallowed subscriptions and handle permissions on new track addition

* add test for track addition after permission set

* Remove unnecessary check
2021-12-24 14:14:40 +05:30
Raja Subramanian
eae6eff6a3 Include participant_sid in UpdateSubscription. (#279)
* Include `participant_sid` in `UpdateSubscription`.

Prevents all publisher tracks to find a match.

* generate

* Update protocol version
2021-12-23 09:18:32 +05:30
Raja Subramanian
42a9b6657d Scoped speaker update (#280)
* Scoped speaker update

Include only participants a participant is subscribed to.

NOTE: Not doing this for active speaker changes for Protocol < 3.

* correct comment spelling
2021-12-23 09:13:49 +05:30
David Zhao
33a7df59bd Moved ConnectionQuality to PublishedTrack interface.
it wasn't needed for other MediaTrack implementations
2021-12-21 14:38:16 -08:00
David Zhao
b32ab0e54f Fix incorrect order of parameters passed to NewSubscribedTrack (#272)
* Fix incorrect order of parameters passed to NewSubscribedTrack

Switched to explicit values via a params struct
2021-12-20 14:02:33 -08:00
shishirng
0f728b0b72 Connection quality v1 (#260)
* audio connection quality mos for publisher stats

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

* Update tests

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

* Change ratings range, increase default rtt to 80

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

* Use stats worker to get total packets to find %lost in window

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

* Update go dep

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

* Increase interval of score cal to 5 seconds

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

* use lastSequenceNumber in reports to find total packets

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

* Account for delay while calculating scores

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

* Fix minor typo

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

* Add connection stats/score to subscribed audio tracks

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

* Cleanup

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

* Ignore duplicate LastSequenceNumbers in rtcp reports

Ignore if sequence number is less than what was recieved

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

* Move video track score calc to media/downtracks

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

* Deprecate SubscribeLossPercentage() as score calc is now handled downstream

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

* Initialize connection  score to excellent

score is calc at 5sec interval. Client fetches score before first
score is computed

* Update test cases for connection quality

Signed-off-by: shishir gowda <shishir@livekit.io>
2021-12-20 07:54:14 -05:00
Raja Subramanian
1dcc62b569 SubscribedQualityUpdate message (#270)
* WIP commit

* SubscribedQualityUpdate message to send list of currently subscribed
qualities for a simulcast video publisher

* Correct subscriberID

* goimports

* Do quality update on add/remove of subscribed track

* do not update quality when admin mute is active

* update quality on admin unmute

* Update protocol version

* Simplify max subscribed quality loop per David's suggestion
2021-12-19 12:41:40 +05:30
Raja Subramanian
e504b6678c Deficient state handling when a track needs a change (#261)
* WIP commit

* deficient handling

* Add missing ProvisionalAllocatePrepare

* adjust state on track removal

* Increase test timeout

* - Add comments about cooperative routines
- Take down transition if available in cooperative scheme
- Use layer comparison when taking down transition. Because of when the
  bitrate is measured, it is not always guaranteed bandwidthDelta is -ve
  when moving down.
- Do not add track to stream allocator till bind.

* make comment better

* a bit more clear comments

* Use OnBind on subscribed track
2021-12-16 10:58:34 +05:30
Raja Subramanian
e54ce4f674 Stream Allocator Try 3 (#257)
* Stream Allocator Try 3

Making an intermediate PR to do
- Special treatment for screen share tracks
- When allocating all tracks,
  o try to stream all tracks by starting with the lowest layer
  o multi-pass across tracks to get a more even distribution

Not yet done:
-------------
In deficient state,
o Allocate a specific track on a change
o Steal from other tracks

* Correct sense of managed track

* have to range to copy

* generate

* fix VideoLayers compare

* Use t.simulcasted
2021-12-14 12:48:09 +05:30
David Zhao
d342335d09 Split out SignalHandler to simplify testing (#250) 2021-12-10 13:12:45 -08:00