Commit Graph

479 Commits

Author SHA1 Message Date
Raja Subramanian
46446ef047 Send speaker update with inactive speaker when participant (#315)
* Send speaker update with inactive speaker when participant
leaves/unsubscribes

* Check that protocol version supports speaker updates
2022-01-04 22:37:13 +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
66a1ffe414 Allow cooperative allocation (#309) 2022-01-01 13:43:34 +05:30
David Zhao
d7d3ffdd13 Fix missed update when subscribers are subscribing to the same layer (#310) 2021-12-31 23:54:41 -08:00
Raja Subramanian
8d0fb179a0 Layer 0 and non-simulacst tracks also can be fully unsubscribed. (#308) 2021-12-31 14:04:22 +05:30
Raja Subramanian
fc95757c7d Do not pause if pause is not allowed (#307) 2021-12-31 09:58:13 +05:30
shishirng
007177d095 room_sid to room_id update in analytics proto (#306)
Signed-off-by: shishir gowda <shishir@livekit.io>
2021-12-30 15:26:14 -05:00
Raja Subramanian
98586c2490 A simple configuration for congestion control. (#305) 2021-12-31 00:26:29 +05:30
Raja Subramanian
107e7bbb39 Configurable bandwidth estimation side (#298)
* Fix tests

Add back adding track to publishedTracks for testing purposes.

* WIP branch

* Don't know why merge from `master` did not catch this change.

* WIP commit

* Hook up all the bits for TWCC to work

* Fix typo

* WIP commit

* Catch up to latest API

* Move RTP/RTCP info config

* Instantiate GCC/TWCC interceptor only when in use

* comment SSBWE parts

* RTCP feedback in publisher config
2021-12-30 20:09:03 +05:30
Artur Shellunts
6f84b36ccf Use RTT field in analytics stats (#304)
* Update protocol to v0.11.7

* Use RTT field in analytics stats

Instead of Delay
2021-12-30 13:13:40 +01:00
Raja Subramanian
07db1ba726 Some more files with types (#302) 2021-12-30 16:43:20 +05:30
Artur Shellunts
1b66fe1e23 Fix handling of PacketLost (#296)
They come accumulated already.
2021-12-30 11:06:00 +01:00
Raja Subramanian
03000f88cb Adaptive publishing improvements (#295)
* Adaptive publishing improvements

* fix tests

* proper comment sentence

* Address comments from David

* proper locking

* fix crash

* Do not start quality timer if not video
2021-12-30 09:50:53 +05:30
David Colburn
7b0db1f344 fix recording URL requests 2021-12-29 17:46:34 -08:00
Artur Shellunts
1fa194297f Implement calculating of RTT for down tracks (#300)
* Implement calculating of RTT for down tracks
* Fix code style issues
2021-12-29 19:58:41 +01:00
Artur Shellunts
b744a9c2ba Implement event loop for telemetry service (#297)
It allows all actions/events to run in the same go routine.
Therefore no synchronization primitives are needed inside
telemetry service implementation.
2021-12-29 19:51:12 +01:00
Artur Shellunts
828d490755 Imlement analytics per track statistics (#281)
New tests for telemetry + implementation of per track statistics
2021-12-29 19:29:24 +01:00
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
fe06b46e94 Include self in speaker updates (#301) 2021-12-29 22:07:35 +05:30
Raja Subramanian
dc385f5d24 Beginnings of typing for various ids. (#287)
* Beginnings of typing for various ids.

* trackSid/TrackSid -> trackID/TrackID

* update protocol

* Initial livekit.ParticipantID use
2021-12-29 14:46:32 +05:30
Artur Shellunts
2209edce20 Make TelemetryService testable (#276)
* Make TelemetryService testable

Timer is extracted for better testability of telemetryservice.

Divided TelemetryService to internal part that:
- contains business logic
- does not contain timer
- and therefore testable

and external part that:
- does not contain business logic
- contains timer to send analytics every 10 seconds for all participants.
- does not need tests

* Add Test_AnalyticsSentWhenParticipantLeaves

* Fix test
2021-12-28 12:54:56 +01:00
David Zhao
3108ef22ad Ability to set name on Participant (#293) 2021-12-28 00:12:04 -08:00
David Zhao
b747cdb822 Pass along mime type with TrackInfo (#292) 2021-12-27 23:43:30 -08:00
David Zhao
87a799bae2 Include unique id and timestamp with webhook events (#291)
Resolves #230
2021-12-27 23:33:06 -08:00
David Zhao
15cd98be22 Enable Room.List to filter by specific names (#290) 2021-12-27 23:32:29 -08:00
David Zhao
472f51cdba Fail IP lookup with STUN failure (#289)
Resolves #226
2021-12-27 16:43:13 -08:00
David Zhao
554baa54f6 Avoid locking while waiting for receiver read (#288)
A deadlock was observed in this section, when Read was waiting for data.
2021-12-27 13:35:30 -08:00
Raja Subramanian
a47153e50c Defer RTCP channel close till published tracks are closed (#286)
* Defer RTCP channel close till published tracks are closed

* Check for Close called before closing RTCP channel
2021-12-27 14:17: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
c49abf9f28 Increased layer tolerance to improve rendering quality (#283) 2021-12-22 13:05:43 -08:00
shishirng
e6543f3b9e Convert jitter from MicroSecs to MilliSecs (#282)
Signed-off-by: shishir gowda <shishir@livekit.io>
2021-12-22 12:37:45 -05:00
David Zhao
33a7df59bd Moved ConnectionQuality to PublishedTrack interface.
it wasn't needed for other MediaTrack implementations
2021-12-21 14:38:16 -08:00
shishirng
2e4ccd2577 Send client sdk type when participant joins in telemetry (#275)
Signed-off-by: shishir gowda <shishir@livekit.io>
2021-12-21 15:35:27 -05:00
David Colburn
8f28364842 remove WriteNodeRTC from interface 2021-12-20 16:00:37 -08:00
shishirng
ab73911c49 subtrack should check if track was muted by publisher (#273)
* subtrack should check if track was muted by publisher

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

* If all tracks are muted sub/pub then send excellent connection quality

Signed-off-by: shishir gowda <shishir@livekit.io>
2021-12-20 17:34:53 -05: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
Artur Shellunts
b0454b00a2 Count padding bytes in telemetry (#264)
Count padding bytes in telemetry outgoing total bytes
2021-12-20 12:04:50 +01: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
David Colburn
0b71a46239 missed some typos 2021-12-17 13:25:41 -08:00
David Colburn
faa870de3d Move callbacks out of messageRouter (#269)
* move callbacks out of messageRouter

* OCD

* more OCD

* fix forwarder test

* even more OCD

* maximum OCD

* package name collision, copy lock by value
2021-12-17 13:19:23 -08:00
cnderrauber
a06edd885e fix panic in forwarder (#268)
Co-authored-by: cnderrauber <zengjie9004@gmail.com>
2021-12-17 23:51:06 +08:00
Raja Subramanian
502c57d787 Fix forwarding status deduction (#267)
* Fix forwarding status deduction

- When muted OR when there are no available layers, declare optimal
- When target layer is the maximum it can achieve taking available
  layers into account even if they are not the maximum subscribed layer,
  it is still optimal as there is nothing better available.

* Fix and add more tests for forwarding status
2021-12-17 15:45:04 +05:30
Raja Subramanian
a8fe06e083 Delete unused method (#266) 2021-12-17 13:16:55 +05:30
Raja Subramanian
62feed3983 Clean up down track type as it is not used (#265) 2021-12-17 13:00:44 +05:30