* Refactor media track subscriptions
- To enable re-use of common bits
- Add max quality from other nodes
* Lock close handlers slice
* Reverting multiple on close handlers of downtrack, unclear if it is needed yet
* Make Logger a pointer
* audio level in MediaTrack like remote media track
* Cleanup
* Add a no subscribers callback
* Add method to update subscribed quality from another node
* loss proxying from remote node
* Address comments from David
* create subscriber node quality map
* Adaptive publishing improvements
* fix tests
* proper comment sentence
* Address comments from David
* proper locking
* fix crash
* Do not start quality timer if not video
* 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
* 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>
* 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
* 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
* 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
* WIP branch to hash out down stream allocator.
* Plug more bits of stream allocator
* update protocol
* remove SignalRequest_Simulcast (#154)
* Plug more bits of stream allocator
* Handle simulcast track available layers change
* WIP branch to hash out down stream allocator.
* Plug more bits of stream allocator
* Handle simulcast track available layers change
* Adopt signature of call to AdjustAllocation
* Move StreamAllocator to PCTransport and allocate only for subscriber.
* Move streamallocator to ion-sfu
* Start/Stop of streamallocator
* Use StreamAllocator for subscriber bandwidth management.
* Do not allocate in ADD_TRACK
* Set payload in constructor
* - Add some logging
- Protocol message to notify clients of paused/resumed streams
* named return
* oops correct sense of isPausing
* Update pkg/sfu/streamallocator.go
Committing David's suggestion.
Co-authored-by: David Zhao <david@davidzhao.com>
* - Log estimate changes/commits.
- Catch more than epsilon change oscillating for long time.
Co-authored-by: David Colburn <xero73@gmail.com>
Co-authored-by: David Zhao <david@davidzhao.com>
Small step on the way to making StreamAllocator prioritization of tracks.
With the new callback into StreamAllocator, the idea is to use the
max layer information to do track prioritization.
Testing:
--------
Sanity check that sample app works
* 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>