Commit Graph
1022 Commits
Author SHA1 Message Date
shishirngandGitHub 20681abcdc handle data race between updateState and OnStateChange (#727)
Signed-off-by: shishir gowda <shishir@livekit.io>
2022-05-27 12:54:19 -04:00
Raja SubramanianandGitHub a1c7332943 Use a shadow for receivers for safe range (#725)
* Use a shadow for receivers for safe range

* RLock layerSSRCs

* access max subscribed quality inside lock

* Fix go vet errors

* use defer
2022-05-27 22:11:34 +05:30
Dan McFaulandGitHub aa0df2813f deleting nonRtc rooms and fixing race when deleting rooms (#721) 2022-05-27 09:45:22 -06:00
f958fbcc1c simulcast codecs support (#720)
simulcast codecs support 

Co-authored-by: David Zhao <dz@livekit.io>
2022-05-27 19:55:50 +08:00
Raja SubramanianandGitHub 3054f3eea3 Protect TrackInfo (#724)
* Protext TrackInfo

Also making a copy rather than changing params.

* prevent recursive lock

* Remove double lock

* Rework early return a little bit
2022-05-27 13:32:45 +05:30
cnderrauberandGitHub 5f9cdfbd90 fix repeated AddSubscriber of MediaTrackSubscription (#723) 2022-05-27 15:42:17 +08:00
David ZhaoandGitHub 74f0388f14 Update YAML dependency (#718) 2022-05-26 22:29:13 -07:00
Raja SubramanianandGitHub d77a8ad916 Use proper type cast (#719) 2022-05-26 13:58:46 +05:30
Raja SubramanianandGitHub 77b8e9eecb Fix a couple of more races (#717)
* Use grants clone

* Fix a couple of more races

Use a shadow copy of down tracks in DownTrackSpreader.
Read always uses the shadow.
On Add/Delete of down track, make a new copy.
Copying is done only on add/delete.
If somebody is holding reference to a shadow, it will be in tact as Add/Delete create a new slice.

With this, not seeing any more races in test. So, enabling CI tests with `-race`.

Also fixing another race reported in #603

There are a couple of more races in that bug report that needs to be
chased down.

* Use env suggested in https://lifesaver.codes/answer/runtime-race-detector-sigabrt-or-sigsegv-on-macos-monterey-49138

* staticcheck, did not fail locally, but reported by CI

* use API to get down tracks
2022-05-25 16:14:07 +05:30
Raja SubramanianandGitHub 73db950ea4 Use grants clone (#716) 2022-05-25 15:29:23 +05:30
Raja SubramanianandGitHub 08f047c157 Fix test race in grants (#715) 2022-05-25 12:31:31 +05:30
Raja SubramanianandGitHub 11fb079a4f Catching a few more races reported by go test -race ./... (#713)
* Fix a few more races

* Make sure room store on leave has correct count

* Revert logger change to reduce diff
2022-05-25 07:32:25 +05:30
Dan McFaulandGitHub 0589d757cd in some implementations of Store, particpant and their tracks may not yet have been persisted when a mute event is received, don't want to error in that case (#714) 2022-05-24 12:30:09 -06:00
Raja SubramanianandGitHub 9d0e4375f2 Use blank frames at frame rate (#710)
* Inject silence opus frames on mute.

If not, under certain circumstances, residual noise
seems to trigger comfort noise generation at the decoder
which is not all that comfortable.

* inject silence only when muting

* Add comment

* augment comment

* Delete blank line

* Adjust TS offset on blank frames

* Remove debug

* Do not modify `lastTS` as it affects timestamp on next switch.

* Trying more stuff for DTX

* - Use a go routine to send blank frames
- Use duration instead of number of frames and calculate number of
  frames

* augment comment

* Remove debug

* Return a chan from writeBlankFrameRTP

* Use a long duration for mute

* add comment

* Incorporate suggestion from Jie
2022-05-24 13:25:19 +05:30
Raja SubramanianandGitHub 33032f6c4b Fix some test races and other things found with go test -race (#711) 2022-05-24 10:16:36 +05:30
Raja SubramanianandGitHub a1e264bf34 Make a copy of available layers in forwarder. (#709)
Should be okay as that is usually only three elements max.

Stream tracker + manager send available layers. As stream trackers
run in different go routines, need to think some more about chances
of out-of-order operations. But, making a copy in forwarder so
that it is not referncing moving data.

Also, when setting up provisional allocation, make a copy
(that was the intention, i. e. a provisional allocation should have
stable data to work with).
2022-05-23 17:41:19 +05:30
David ZhaoandGitHub a933f1513f Add pprof endpoint when running in dev mode (#708) 2022-05-23 00:34:16 -07:00
Raja SubramanianandGitHub 96b095504b Fix some races reported by go -race (#706)
* Fix some races reported by go -race

* Avoid copy
2022-05-23 11:51:13 +05:30
RonnieandGitHub cc5b12709e fix link to deploy in README.md (#705) 2022-05-21 07:57:41 -07:00
David ZhaoandGitHub cdf1724d80 Batch subscriber updates to reduce noise (#703)
Improve scalability by batching subscriber updates on an interval.
When lots of subscribers join, the server ends up spending 20% CPU
sending each state change to everyone. There's a non-trivial amount of
overhead with each send operation.

For publishers, updates are sent right away.
2022-05-20 22:54:02 -07:00
Raja SubramanianandGitHub 8ef53037eb Lock stats worker maps (#704) 2022-05-21 10:36:49 +05:30
David ZhaoandGitHub 79296d0939 Fixed concurrent modification to map (#702)
Synchronizes access to stats worker maps. Previously it was accessed
from both OpsQueue goroutine and run() worker
2022-05-20 13:45:13 -07:00
Raja SubramanianandGitHub 547ab908f5 Coalesce track events into stream allocator. (#701) 2022-05-21 00:40:02 +05:30
Raja SubramanianandGitHub 8d0998ed1d Bump up stream allocator event queue size (#700)
This probably needs more work
- Maybe some events should not be queued
- Reduce number of events

Bump up the size any way so that the queue does not overflow
when subscribing to a lot of tracks.
2022-05-20 09:54:10 +05:30
Noah TyeandGitHub 6eebd43c87 update join slack link (#699) 2022-05-19 16:14:07 -07:00
David Zhao 62a23dd089 v1.0.1 v1.0.1 2022-05-19 10:44:11 -07:00
1d03843b3f Update README.md (#696)
* Update README.md

Community URL somehow expired, updating it here.

* fix static check

Co-authored-by: David Zhao <dz@livekit.io>
2022-05-18 21:01:21 -07:00
David ColburnandGitHub a8ff70f63a Update egress info (#694) 2022-05-18 11:30:25 -07:00
David ZhaoandGitHub 54bb0a29e8 Updated readme with renamed repo URL (#693) 2022-05-18 10:31:48 -07:00
Raja SubramanianandGitHub 012337c96a Fix sense of tranmission label (#692) 2022-05-18 12:52:05 +05:30
David Zhao bd5813e0ca Introduce a changelog v1.0.0 2022-05-17 22:57:47 -07:00
David Zhao 564127c8ee v1.0.0 🎆 2022-05-17 22:41:56 -07:00
David ZhaoandGitHub 0f7b9ae43e Update README with newly launched SDKs (#691) 2022-05-17 22:39:42 -07:00
David ZhaoandGitHub 0e506cf7ba Update to Pion 3.1.40 (#690) 2022-05-16 23:13:02 -07:00
Raja SubramanianandGitHub d828e0fbd8 Inject silence opus frames on mute (#682)
* Inject silence opus frames on mute.

If not, under certain circumstances, residual noise
seems to trigger comfort noise generation at the decoder
which is not all that comfortable.

* inject silence only when muting

* Add comment

* augment comment

* Delete blank line

* Adjust TS offset on blank frames

* Remove debug

* Do not modify `lastTS` as it affects timestamp on next switch.

* use duration to calculate number of blank frames

* log errors in blank frames write path
2022-05-15 11:29:40 +05:30
cnderrauberandGitHub fa53da18e7 update pion, export vp8munger header (#684)
* update pion, export vp8munger header

* fix test
2022-05-13 17:20:52 +08:00
Raja SubramanianandGitHub 710e06b7da Tweak screen share stream tracker. (#683)
* Tweak screen share stream tracker.

Screen share uses extremely low frame rate when content is static.
This leads to stream tracker changes and layer switches.
Use a longer measurement interval for screen share tracks.
Setting it to 4 seconds. The screen share frame rate is
approx. 1 fps and with two temporal layers, it should get
a frame every 2 seconds or so in every layer. But, that
does not work. Even three second measurement window was
reporting 0 rate. So, it is getting clumped. 4 seconds works
fine.

Also modifying the bit rate availability change to trigger
on a temporal layer becoming available or going away.

With these changes, on a local test, not seeing any unnecessary
PLIs from client and hence no unnecessary key frames from publisher.

* Fix test
2022-05-13 10:18:18 +05:30
IvanandGitHub 9eacad04c9 Improve list-nodes command output (#681)
tidied up list-nodes command output:

made the table narrower (to fit on the screen);
made numbers humanized;
added nodes state (useful with SHUTTING_DOWN state);
added retransmitted packets per second.
2022-05-11 09:57:44 -07:00
David ZhaoandGitHub a1caeeb8de Update WebRTC and DTLS with security fixes (#678)
* Update WebRTC and DTLS with security fixes.

* remove aggressive nomination settings (now default)

* fixed TURN issue
2022-05-10 18:27:16 -07:00
David ZhaoandGitHub 7eb3362d0a Keep track of retransmissions in NodeStats (#677) 2022-05-10 15:25:24 -07:00
Raja SubramanianandGitHub 9f37239af3 Send active speaker update on subscription. (#676)
Newly joining participant does not get information about
currently active speaker till there is a speaker state change.
This addresses it by sending a speaker update on subscription
if the subscribed to participant is actively speaking.
2022-05-10 12:31:26 +05:30
David ZhaoandGitHub bd7e3beda4 Improve frequency of stats update (#673)
* Improve frequency of stats update

Prometheus stats are updated as the data becomes available, instead of
aggregated along with telemetry batches. Node availability decisions can
now react much faster to these stats.

* use the same intervals for connection quality updates
2022-05-09 08:55:06 -07:00
Raja SubramanianandGitHub 16407ea180 Change state to JOINED before sending JoinResponse (#674)
* Send room metadata as long as participant is not disconnected

* Change state to JOINED before sending join response
2022-05-09 13:28:56 +05:30
Raja SubramanianandGitHub 081b97142f Variable collision killed stats workers (#670) 2022-05-06 23:42:40 +05:30
cnderrauberandGitHub 07b93e2e5b add support for av1 svc (#669)
* add support for av1 svc
2022-05-06 18:24:29 +08:00
cnderrauberandGitHub 7f38164ef6 fix twcc panic on packet lost (#668) 2022-05-05 17:04:02 +08:00
Raja SubramanianandGitHub 0d8848cfcd Do not count padding packets in stream tracker. (#667)
* Do not count padding packets in stream tracker.

There are cases where publisher uses padding only packets
in a layer to probe the channel. Treating those as valid
layer packets makes stream tracker declare that the layer
is active where in reality, it is not.

Also, removing check for out-of-order packets. Out-of-order
packets can happen and should be counted in bitrate calculation.

There is the extreme case of heavy loss which might skew it, but
that is an extreme case.

* Fix test
2022-05-05 13:09:59 +05:30
Raja SubramanianandGitHub c6f895db15 Prevent concurrent access of stats worker map (#666) 2022-05-04 23:00:20 +05:30
Raja SubramanianandGitHub 1665f51bd0 Stats of NACKs acked and number of repeated NACKs. (#664)
* Stats of NACKs acked and number of repeated NACKs.

Also making a change in delta stat to drop negative packet loss
counts to 0. Because of windowing it is a legitimate case.
The receiver could have seen a loss in window we are measuring
and in the subsequent window, the receiver could have gotten
a retransmission and reduced the packet loss count resulting
in a negative delta. When we report negative delta, it could
get dropped by analytics validator. That will be lost data.
Avoid that.

* Remove unused code

* Pick up latest protocol
2022-05-02 22:43:21 +05:30
Raja SubramanianandGitHub fe8c355a32 Support participant identity in permissions (#663)
* Support participant identity in permissions

It is harder for clients to update permissions by SID as remote
reconnecting means a new SID for that participant. Using participant
identity is a better option.

For now, participant SID is also supported. Internally, it will
get mapped to identity. Server code uses identity throughout after
doing any necessary conversion from SID -> Identity.

* Address comments
2022-05-02 12:35:20 +05:30