Commit Graph

624 Commits

Author SHA1 Message Date
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
Raja Subramanian edafb0a118 VP8Munger tests (#229)
A bit of clean up of unused bits.
2021-12-03 21:57:49 +05:30
Raja Subramanian 6141567aef Unit tests for VP8 pack/unpack in packetMeta. (#228)
Deleting unused code.
2021-12-03 15:37:49 +05:30
Raja Subramanian ac650cd21d RTPMunger unit tests (#227) 2021-12-03 14:47:00 +05:30
Raja Subramanian 5eb58bcb41 Fixing a couple of bugs in StreamAllocator (#225)
* Debug

* More debug

* break -> return

* comment

* Clean up

* spelling fixed
2021-12-02 14:43:56 +05:30
cnderrauber 6510692f23 export structures for cloud (#220)
* export structures for cloud


Co-authored-by: cnderrauber <zengjie9004@gmail.com>
2021-12-02 13:57:22 +08:00
Eng Zer Jun e37afdca6f build: upgrade go directive in go.mod to 1.17 (#223)
* build: upgrade `go` directive in `go.mod` to 1.17

This commit enables support for module graph pruning and lazy module
loading for projects that are at Go 1.17 or higher.

Reference: https://go.dev/ref/mod#go-mod-file-go
Reference: https://go.dev/ref/mod#graph-pruning
Reference: https://go.dev/ref/mod#lazy-loading
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* ci: update GitHub Actions to use Go 1.17

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-12-01 14:39:21 -08:00
Artur Shellunts c0e0602716 Improve readme (#222)
Make it clear what keys are LIVEKIT_KEYS
2021-12-01 15:40:56 +01:00
Raja Subramanian 96a3f3e9a7 Minor clean up (#221) 2021-12-01 19:15:06 +05:30
David Zhao 50469b33a9 Fixed incorrect simulcast information (#218) 2021-11-30 21:22:16 -08:00
Raja Subramanian 57ee033d67 Split Forwarder into its own file to make sfu.DownTrack smaller. (#217) 2021-12-01 01:26:55 +05:30
Raja Subramanian 5e7f93c954 Stream allocator - v0.2 (#216)
* Use protocol friendly StreamedTracksUpdate

* WIP commit

* Stream allocator update

* subtract the requested bandwidth as delta from Allocate could be adding to bandwidth

* Calculate delta correctly

* correct comment

* Simplify eventCh per David's suggestion
2021-12-01 01:05:19 +05:30