Commit Graph

162 Commits

Author SHA1 Message Date
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
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
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
David Zhao
318bee4f1e Improve video quality selection by using publisher feedback (#238) 2021-12-06 12:12:08 -08:00
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
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
David Colburn
f4c96449ae fix protocol reference 2021-11-24 15:57:07 -08:00
shishirng
5cdb1c4848 Send room name along in stat message (#205)
Signed-off-by: shishir gowda <shishir@livekit.io>
2021-11-23 15:51:16 -05:00
David Zhao
79cfc0d76a update protocol & pion versions 2021-11-19 21:25:08 -10:00
cnderrauber
b7f32dfffd Handle multiple codecs in renegotiation (#191)
* Handle multiple codecs in renegotiation

update pion to v3.1.9 for answer same order of codec as publisher.
register enable codecs in subscriber peerconnectin created.

add codec parameter to buffer.bind
buffer should use the codec of TrackRemote as it's codec mime.

sent h264blankframe when DownTrack closing
2021-11-17 21:18:43 +08:00
David Colburn
92838d75a8 Analytics events + stats (#187)
* events

* bump

* update incoming stats

* publisher stats

* outgoing rtcp

* stats

* remove unnecessary struct

* merge mediaTrack

* put comment back
2021-11-12 16:36:10 -06:00
David Zhao
90f3c43dc5 Fixed deadlock in pion with SRTP and DataChannel 2021-11-11 13:25:08 -08:00
Raja Subramanian
2ec5f2bd3d Fixing edge cases in picture id munging. (#180)
* Fixing edge cases in picture id munging.

Changes

1. Check the RTP sequence number order before VP8 temporal layer
   filtering and use that ordering result while doing temporal
   layer filtering.

    In a sequence like below
       o Packet 10 -> Picture ID 10
       o Packet 11 -> missing
       o Packet 12 -> Picture ID 11
     it is not known if packet 11 will belong to Picture ID 10 or
     Picture ID 11. The problem becomes a lot more tricky if there
     is a burst loss and there is a larger hole in the picture id
     space also as a result.

     So, in the event of a packet loss, forward even if the current
     packet belongs to a layer that can be dropped. More comments
     in code.

2. Use result of sequence number ordering check while doing VP8 picture id munging.

3. When adding to missing picture id cache, have to include picture ids including
   both ends. As a picture can span multiple packets and it is not known which
   picture the packet belongs to, have to include both ends also in missing
   picture id cache in the event of a gap.

4. As a picture can span multiple packets, it is not possible to have a simple
   map of missing picture ids as an entry cannot be deleted if an out-of-order
   picture id is received. There may be more missing packets belonging to that
   picture id that is yet to be received.

   So, have to use an ordered map and truncate the map if it grows too large.

   Picked this for ordered map - https://github.com/elliotchance/orderedmap.
   Has a simple API, had the highest number of stars of all the ones I checked.
   And there are benchmarks.
   The author also wrote a medium post at https://medium.com/swlh/an-ordered-map-in-go-436634692381

   Another one which I looked at is - https://github.com/wk8/go-ordered-map.
   The author of that wrote at https://morioh.com/p/990229f32171 and has a
   bunch of other options at the end of that post (but does not include the
   one I picked above). None of those have that many stars.

Testing:
--------
- Set max temporal layers to 0 so that temporal filtering happens and run for
an hour on sample app.

* do not let padding packets through VP8

* Correct comment

* fix comment

* Review comments from Jie

* golang naming convention
2021-11-11 19:03:33 +05:30
Raja Subramanian
3ff3e91165 Update pion/rtp and pion/webrtc to the latest (#182)
* Update pion/rtp and pion/webrtc to the latest

* introduce additional delay to fix test reliability

Co-authored-by: David Zhao <david@davidzhao.com>
2021-11-10 14:12:14 -08:00
Mathew Kamkar
94aec3b98d Node updates stats with KeepAlive message to self (#177)
* node sends KeepAlive message to self

* use WriteRTCNodeMessage instead of participants[0]
2021-11-09 17:19:46 -08:00
cnderrauber
8b7a776af6 Remove unused files (#174)
* remove unsed files from ion-sfu

* remove comment code

* go mod tidy
2021-11-09 17:15:14 +08:00
cnderrauber
1e1aaeb86b Separate from ion-sfu (#171)
* Separate from ion-sfu

changes:
1. extract pkg/buffer, twcc, sfu, relay, stats, logger

2. to solve cycle import, move ion-sfu/pkg/logger to pkg/sfu/logger

3. replace pion/ion-sfu => ./
reason: will change import pion/ion-sfu/pkg/* to livekit-server/pkg/*
after this pr merged. Just not change any code in this pr, because it
will confused with the separate code from ion-sfu in review.

* Move code from ion-sfu to pkg/sfu

* fix build error for resovle conflict

Co-authored-by: cnderrauber <zengjie9004@gmail.com>
2021-11-09 12:03:16 +08:00
David Colburn
289ebd32ff Telemetry refactor (#172)
* telemetry refactor

* fix imports

* update protocol
2021-11-08 20:00:34 -06:00
David Zhao
aa9534b7fb Server-driven connection quality detection (#167) 2021-11-03 21:05:20 -07:00
Mathew Kamkar
05c4df4e23 Room logger with room name (#165)
* room with logger

* participant with room logger

* transport with room logger

* simplify room logger usage

* simplify logger

* update protocol

* more room logging, test fix
2021-11-02 14:02:45 -07:00
David Zhao
7442551ae5 Fix missing participant updates race (#163)
* Fix faulty participant update buffering.

* Fix bug with broadcasting out of order

* dedicated participant update worker, without locks

* use tracker to drop duplicate/out of date messages

* additional lock around filter logic
2021-10-31 15:20:46 -07:00
David Colburn
6d2f75fab6 update protocol 2021-10-26 14:31:39 -07:00
David Colburn
c680c2465d update protocol 2021-10-21 14:36:53 -07:00
Raja Subramanian
2d76c672e3 Use abs-send-time RTP header extension for video downstream (#149)
- Update ion-sfu to v1.20.14
- Enable `abs-send-time` for video tracks

Reference: ion-sfu PR - https://github.com/livekit/ion-sfu/pull/12

Testing:
--------
- Look at SDP offer in subscriber PC and ensure that abs-send-time is negotiated.
- Ensure that downstream packets have `abs-send-time` extension for video packets.

TODO:
-----
- Not yet setting this for audio tracks. Eventually we want to move
to TWCC. This is just a step along the way.
2021-10-19 23:46:04 +05:30
David Zhao
43079866a2 Update to Pion v3.1.5, fixed simulcast / non-simulcast mixing 2021-10-15 09:35:01 -07:00
David Zhao
81712f9502 revert to pion v3.1.0-beta.3
mixing of simulcast and non-simulcast tracks is broken
2021-10-15 00:31:57 -07:00
David Zhao
eba0c23375 Handle TrackInfo.Source attribute (#146)
* Support passing along Source attribute
2021-10-14 13:10:57 -07:00
Raja Subramanian
ac4db4575f LK-105 (Opus DTX) (#140)
* LK-105 (Opus DTX)

https://linear.app/livekit/issue/LK-105/allow-enabling-of-opus-dtx

Enable/Disable Opus DTX using SDP answer based on setting in
`AddTrack` request.

Testing:
--------
Chrome and Firefox work. Having audio problems with Safari
(maybe the Safari 15 issue as I am not getting media)

* Check that receiver has no tracks

* Skip non-audio transceivers

* A small clean up to not use pendin track outside lock and also append with spread

* Address comments from review by David

* Update pkg/rtc/participant.go

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

* Pull in tagged version of webrtc and lk protocol

Co-authored-by: David Zhao <david@davidzhao.com>
2021-10-13 11:22:33 +05:30
cnderrauber
8ff18e0326 forward fraction lost from subscriber to publisher (#142)
Co-authored-by: cnderrauber <zengjie9004@gmail.com>
2021-10-10 21:56:13 -07:00
David Colburn
2c9ef2f6bb Update recording service (#137)
* update recording service

* return empty for EndRecording

* update protocol
2021-10-08 13:44:41 -05:00
David Zhao
c745f0a318 Region aware routing (#135)
* Region aware routing

* update config, fix spacing on commented out lines
2021-10-06 21:40:04 -07:00
David Zhao
797d2607c4 Fix NACK handling in simulcast (fixed in ion-sfu) 2021-10-04 17:17:41 -07:00
Théo Monnom
939ed10ca6 Room Metadata Implementation (#126) 2021-10-02 22:08:29 -07:00
David Colburn
d83b7b543d update protocol 2021-09-22 13:48:37 -07:00
David Colburn
347bf0345a Recording webhooks (#125)
* dump

* update protocol

* const

* regenerate wire

* message bus nil check

* nil message bus if no redis

* start and stop rec service
2021-09-21 23:46:25 -05:00
David Zhao
3ed3afad2c Recognize Go client in parsing 2021-09-17 16:25:47 -07:00
David Zhao
ff47301820 Implements protocol 3 speaker updates (#120)
* Disallow AddTrack from participants that don't have the permission

* Support protocol 3 speaker updates, client info

* update protocol

* Disallow AddTrack from participants that don't have the permission

* increase wait time for GH to pass
2021-09-17 11:47:13 -07:00
Mathew Kamkar
700a879c0b Redis Router graceful stop (#116)
* prestop and hasparticipants in interface

* add prestop function to existing routers

* fakerouter prestop

* update protocol version

* read lock

* redis router graceful stop

* test fix

* force stop
2021-09-15 13:07:44 -07:00
David Zhao
976e61f10c more generous sleep workaround in test client, better logging 2021-09-11 23:18:20 -07:00
David Zhao
614ede2edc Supports client protocol 3 - subscriber as primary (#110)
* use subscriber connection as primary whenever possible

* backwards compat for data messages

* bump protocol version
2021-09-09 00:53:15 -07:00
David Colburn
2a3fb5f0e7 move logging to protocol (#109) 2021-09-09 00:45:42 -07:00
David Colburn
e9ffbefa70 move recorder to msg bus (#108) 2021-09-02 17:06:48 -05:00
David Zhao
e82d50d717 Send explicit message to clients for mute/unmute. (#107)
* Send explicit message to clients for mute/unmute.

* documentation in config
2021-09-01 21:50:02 -07:00
David Colburn
397c5607a9 update sfu 2021-08-30 14:40:22 -07:00
David Colburn
69c1d4c295 Interfaces (#97)
* create interface

* move room manager to interface

* interfaces

* updates

* fix loop

* fix fakes

* remove node types
2021-08-28 18:28:08 -05:00
David Colburn
8a44fad307 protocol 0.8 (#95)
* protocol 0.8

* merge new selector
2021-08-27 13:16:33 -05:00
David Colburn
22a5d4ec74 update sfu 2021-08-25 13:48:41 -07:00
David Colburn
b95701c7da update protocol 2021-08-25 13:42:02 -07:00