Commit Graph
678 Commits
Author SHA1 Message Date
Mathew Kamkar cf63da2e64 prometheus livekit_room_total node_id label 2022-03-21 16:43:01 -07:00
Raja SubramanianandGitHub 641858832a Address edge case stream allocation (#544)
* Handle an edge in layer lock.

A very edge case
- Available layer: [0, 1, 2], but bitrate is not yet available.
We set it to layer 2 awaiting measurement.
- Measurement for layers 0 and 1 come through.
- Still no key frame for layer 2.
- Finalize layers runs and sees that bitrate is available for 0 and 1.
It finalizes layer 1.
- Layer 1 key frame comes (because we asked key frame of layer 2,
publisher sends key frame for all layers). Locks to layer 1.
- No more events happen to switch to layer 2.

Changes
-------
- Move bit rate measurement to StreamTrackerManager. Allows re-use
in relay.
- Make bit rate availability (from zero -> non-zero) an event
and let it flow through the stream allocation flow so that we
always have an event when bit rate measurement becomes available.
This gets rid of finalization which I was unhappy with it anyway as
it was polling every second.
- Removing REMB stuff from buffer. We do not use it.
It is incorrect anyway. REMB should be ay peer connection level.

* Fix test

* fix test

* Simplify allocate

* Simplify/clean up
2022-03-21 14:53:31 +05:30
David ZhaoandGitHub 5920672802 feat: unpublish tracks after publish permissions are revoked. (#545)
* feat: unpublish tracks after publish permissions are revoked.

Uses protocol 7 to indicate client support, otherwise it attempts to
mute the tracks.

Also sends back permissions objects of all participants, and cleaned up
our handling of various permissions attributes.

* fix static check
2022-03-21 00:20:48 -07:00
Raja SubramanianandGitHub 82e1c391a4 Fix time stamp jump on layer switch (#543) 2022-03-20 13:36:29 +05:30
Raja SubramanianandGitHub 1d03a5a3b6 Lock temporal layers to target for non-temporal layer codecs also (#542) 2022-03-20 11:11:49 +05:30
Raja SubramanianandGitHub 8c9c1fe837 Always do stats update and header extension processing (#540)
Also, use Errorw for tracking large gap to get a back trace.
2022-03-19 21:29:10 +05:30
David ZhaoandGitHub 2155405736 Handle non-primary peerconnection if/when it becomes disconnected (#537)
* Handle non-primary peerconnection if/when it becomes disconnected

* avoid storing nil
2022-03-19 00:31:45 -07:00
David ZhaoandGitHub f14c452f8c Telemetry and webhook improvements. (#535)
* Telemetry and webhook improvements.

* avoid blocking on telemetry channel - increase channel size and drop when full
* send ParticipantJoined webhook when fully joined (i.e. on ParticipantActive)
* send TrackPublished & TrackUnpublished webhooks
* increase number of parallel webhook workers to 50

* update protocol
2022-03-18 23:20:33 -07:00
Raja SubramanianandGitHub 5a9da8bee2 Do not double count NACK miss in sfu.DownTrack (#536) 2022-03-19 11:10:58 +05:30
Raja SubramanianandGitHub ed00146937 Fix packets/packetRate mismatch (#534)
This still does not address root cause of large loss, but at least
does not display crazy thing like packets = 0, but packet rate is 45/s.

Also, RLock in ToString() as there are bits of structure used in
stringification.
2022-03-19 01:06:52 +05:30
Raja SubramanianandGitHub 13083a143f More logs (#533) 2022-03-19 00:38:22 +05:30
Raja SubramanianandGitHub d738424173 Catch a few edge cases in stream allocator. (#532)
* Catch a few edge cases in stream allocator.

- More useful logging

* fire probe cluster done callback only when there is an active cluster
2022-03-18 20:42:15 +05:30
Raja SubramanianandGitHub 3ce4010e89 Fix bracket (#531) 2022-03-18 11:25:20 +05:30
Raja SubramanianandGitHub a709cc0ad7 Exempt layers in stream tracker (#530)
For now, exempt layer 0 from stream tracker declaring it stopped.
2022-03-18 11:17:48 +05:30
cnderrauberandGitHub 832f3fd124 filter unused candidate and refine log (#528)
* filter unused candidate and refine log

* fix test
2022-03-18 12:57:33 +08:00
Raja SubramanianandGitHub 64f82a6a73 Fix off by one packets expected (#529) 2022-03-18 10:03:09 +05:30
shishirngandGitHub 4fb5076807 Check cloudflare headers for real client ip first, default to X-Forwarder-For (#523)
Signed-off-by: shishir gowda <shishir@livekit.io>
2022-03-17 08:10:44 -04:00
c6a35d3ff1 fix keyFrameRequestGeneration not exit after close (#527)
* fix keyFrameRequestGeneration not exit after close

* change to bound check

* Refactor stop key frame requester into a function

* Remove redundant key frame requester stop

Co-authored-by: boks1971 <raja.gobi@tutanota.com>
2022-03-17 18:50:07 +08:00
Raja SubramanianandGitHub dc6b3369f4 Minor clean up of unused stuff (#525) 2022-03-17 10:19:51 +05:30
Mathew KamkarandGitHub cac6d22a72 store cpu load in node stats (#524)
* store cpu load in node stats

* num cpus uint32

* cpu load selector test

* dep update
2022-03-16 14:51:22 -07:00
Raja SubramanianandGitHub 33f9726b79 Key frames (#522)
* Key frames

- Keep track of key frame stats
- Split out PLI from down track used for purpose of layer locking.
This will give us a good picture of down stream issues forcing a PLI.
- Use key frame requester whenever there is a layer lock required.
Not just the first key frame. With the synchronous thing, the counter
was just ridiculously high like 150 or something because of all
the initial padding packets. Also, use RTT in key frame requester.

* send first PLI before waiting

* Turn off key frame requester when disabled

* simplify
2022-03-16 19:55:12 +05:30
cnderrauberandGitHub 82192f524e fix migration state (#520) 2022-03-16 17:58:25 +08:00
Raja SubramanianandGitHub f3368a567b Use overridden packet loss (#519) 2022-03-16 11:36:54 +05:30
cnderrauberandGitHub 37b76f41b7 set participant to active after subscriber data channel opened (#518) 2022-03-16 12:12:16 +08:00
David ZhaoandGitHub d498cccc05 Fixed panics with nil stats (#517) 2022-03-15 12:01:26 -07:00
Raja SubramanianandGitHub 4d1cc82c89 Remove unused with move to RTPStats (#516) 2022-03-15 23:01:37 +05:30
David ColburnandGitHub c0d9937125 use egress results channel (#512) 2022-03-15 08:49:46 -07:00
Raja SubramanianandGitHub ae85e55fd4 Using RTPStats across the board (#515)
* WIP commit

* Clean up
2022-03-15 17:47:19 +05:30
cnderrauberandGitHub 61ac44e5f7 Revert data track change (#513)
* Revert data track change

* clean code
2022-03-15 19:30:10 +08:00
Raja SubramanianandGitHub 9e8594a9b6 More unification of RTPStats (#510)
* WIP commit

* WIP commit

* Tests

* update protocol
2022-03-14 13:00:27 +05:30
Raja SubramanianandGitHub be02611ab7 Locks around data track (#508)
* WIP commit

* Fix migration, thank you Jie
2022-03-12 20:10:46 +05:30
Raja SubramanianandGitHub b0e470cd59 Return time since last PLI properly (#507) 2022-03-12 13:15:01 +05:30
Raja SubramanianandGitHub 4e24df4200 Move RTPStats -> OSS (#506) 2022-03-12 11:21:05 +05:30
Raja SubramanianandGitHub 80bd45f061 Some clean up (#505)
* WIP commit

* Refactor NTP time

* Clean up

* Update lk protocol
2022-03-11 22:40:49 +05:30
cnderrauberandGitHub a5fa54853f fix potential nil rtcp packets cause rtcpSendWorker exit (#504) 2022-03-11 15:40:24 +08:00
Raja SubramanianandGitHub b6975bf7cd Track source based stream tracker config (#503)
* Track source based stream tracker config

* SCREEN_SHARE_AUDIO is an audio source
2022-03-11 12:15:12 +05:30
e4c321de02 add interface filter config (#502)
* add interface filter config

* Update config-sample.yaml

Co-authored-by: David Zhao <david@davidzhao.com>

* better description

Co-authored-by: David Zhao <david@davidzhao.com>
2022-03-11 14:08:41 +08:00
shishirngandGitHub cd2a7c2447 Telemetry: send video layers in TrackPublishedUpdate event (#500)
Signed-off-by: shishir gowda <shishir@livekit.io>
2022-03-10 14:49:01 -05:00
shishirngandGitHub c34b907d58 Add checks to prevent bytes/packet counts from going -ve (#499)
Signed-off-by: shishir gowda <shishir@livekit.io>
2022-03-09 16:51:23 -05:00
shishirngandGitHub 57ecec73d7 Send participantInfo on participant left event to store identity (#498)
Signed-off-by: shishir gowda <shishir@livekit.io>
2022-03-09 14:35:01 -05:00
cnderrauberandGitHub d31c9f607e fix timing issue for clear receiver (#497) 2022-03-09 21:38:01 +08:00
Raja SubramanianandGitHub acbafa06f2 Log key frame and layer lock (#496) 2022-03-09 09:50:16 +05:30
cnderrauberandGitHub 184fc93c6a fix panic on close channel (#495) 2022-03-09 11:49:27 +08:00
Raja SubramanianandGitHub 5b0f171bef Log actual track IDs during subscription, not just the number of tracks (#493)
* Log actual track IDs instead of just number of tracks

* Log track ids
2022-03-08 19:51:57 +05:30
cnderrauberandGitHub 128199e634 don't send datatrack info to client (#492)
* don't send datatrack info to client
2022-03-08 17:05:26 +08:00
David ZhaoandGitHub d57f76fbef Use trackID consistently as log key (#491)
* Use trackID consistently as log key

* more useful logging for track published
2022-03-07 21:02:08 -08:00
cnderrauberandGitHub 7c0f789316 move CanPublishData check to DataTrack (#490)
* move CanPublishData check to DataTrack

* fix test
2022-03-08 12:02:18 +08:00
cnderrauberandGitHub 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
b20132367andGitHub e5ffd38054 Remove race for creating rtc room (#485) 2022-03-05 00:08:13 -08:00
David Colburn 67848a1dcb fix panic for StartEgress 2022-03-03 12:43:08 -08:00