Commit Graph

635 Commits

Author SHA1 Message Date
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
857ff7fae7 Update pion/turn to fix TURN TLS termination with external LB
version v0.15.1
v0.15.1
2021-12-22 15:00:25 -08:00
David Zhao
7a54a810c9 Update pion/turn to fix TURN TLS termination with external LB 2021-12-22 14:56:18 -08:00
David Zhao
e626ad3eaa version v0.15.0 v0.15.0 2021-12-22 13:07:18 -08:00
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
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
David Zhao
c08d1e9d72 Improve test CI (#262)
* minimal change

* Better test format for GH CI

* Give server a bit longer to startup, to improve GH test
2021-12-14 17:15:08 -08:00
lukasIO
0d0a275101 Turn with external tls termination (#168)
* add TURN TCP port for plain tcp listener

* use externalTLS turn config option

* remove unused TCPPort config option
2021-12-14 13:36:02 -08:00
Artur Shellunts
0d229388ec Telemetry test (#258)
* Add first test for telemetry

- First test for telemetry package that tests totalBytes field in downstream stats.
- Add fake_analytics_service
2021-12-14 14:13:21 +01:00
Artur Shellunts
c7d728aded Rename files to match interfaces inside files (#256)
* Rename analytics.go to analyticsservice.go
* Rename service to telemetryservice
* Rename events.go to telemetryserviceevents.go
2021-12-14 09:47:51 +01:00
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
Raja Subramanian
1be3a3986d Recover VP8 MBit properly when unpacking from packetMeta (#255)
* Recover VP8 MBit properly when unpacking from packetMeta

* one liner for itob
2021-12-11 10:06:04 -08:00
David Zhao
8abd734d16 Use participant and room specific loggers (#252) 2021-12-10 15:51:05 -08:00
Mathew Kamkar
bd42a39117 Include node ID with Prometheus metrics (#251)
* include node id in prometheus metrics

* static prom init and nodeID

* update protocol dep
2021-12-10 15:49:14 -08:00
David Zhao
d342335d09 Split out SignalHandler to simplify testing (#250) 2021-12-10 13:12:45 -08:00
David Zhao
882f3bdde5 Allow subscription requests made from server APIs (#249) 2021-12-10 11:51:03 -08:00
shishirng
e7b50a79fe Send room info in events by default (#248)
Signed-off-by: shishir gowda <shishir@livekit.io>
2021-12-10 14:11:13 -05:00
Raja Subramanian
8c774f144e Tightening up stats and also counting primary/rtx/padding separately (#247)
* Tightening up stats and also counting primary/rtx/padding separately

* Fix tests

* annotate type stored in atomic.Value
2021-12-10 19:30:27 +05:30
David Zhao
bda2e9cc59 Update protocol to v0.11.0 2021-12-08 13:59:55 -08:00
David Zhao
2d93ccd668 Updated protocol from protocol/proto -> protocol/livekit (#242)
* Updated protocol from protocol/proto -> protocol/livekit

* separate MediaTrack from PublishedTrack
2021-12-08 13:58:38 -08:00
Raja Subramanian
7948fabce0 StreamAllocator tweaks (#240)
* WIP commit

* test padding only with a gap scenario

* Debug

* Fix video corruption, need buffer to include payload and translated header size

* Revert incorrect change

* Fix VP8 translation to return buffer with proper length

* Restore 7-bit mode

* WIP commit

* Clean up

* More clean up and tests compiling again

* Fix tests
2021-12-08 21:56:07 +05:30
shishirng
461f29c097 Allow participants to create new connection for publishing new tracks (#224)
* Allow participants to create new connection for publishing new tracks

new param 'publish=<name>' enables publishing new connection with publish
only grants. Also, identity is appended with '#<name>'

* Add integration test to duplicate publish only connection

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

* Reuse token in test and set subscribeGrant to false on publish param

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

* create auth token with grants

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

* Signal ice on negotiate in test client

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

* Update pkg/service/rtcservice.go

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

Co-authored-by: David Zhao <david@davidzhao.com>
2021-12-07 16:23:16 -05:00
Raja Subramanian
5dc0a43b29 Unit tests for sfu.Forwarder (#239) 2021-12-07 02:51:08 +05:30
David Zhao
318bee4f1e Improve video quality selection by using publisher feedback (#238) 2021-12-06 12:12:08 -08:00
Raja Subramanian
ff390820e1 Make VP8 packet translation thread-safe. (#237)
* Make VP8 packet translation thread-safe.

Was using one packet from pool for all VP8 translation which was not thread safe.
Grab packets from the pool when needed for VP8 translation and return to pool after done.
Do not grab packet from pool if the header size between incoming and translated matches.
That also saves copying the packet payload.

* Keep Get/Put in the same function.
2021-12-05 10:01:35 +05:30
Raja Subramanian
45690bc301 Use StreamStateChange with a single list (#235)
* Use StreamStateChange with a single list

Use enum for state change indication on associated track.

* update protocol version
2021-12-04 11:57:23 +05:30
David Colburn
c41384cd09 ActiveRecording (#234)
* ActiveRecording

* regenerate

* update to 0.10.3

* 1.17
2021-12-03 21:40:53 -08:00
David Zhao
c00d799ac6 Fixed permission handling with room deletion (#233) 2021-12-03 14:27:13 -08:00