Commit Graph

1261 Commits

Author SHA1 Message Date
Raja Subramanian
d1ce60192c Handle case of layer stop with out bitrate. (#1448)
Missed this in the last commit. Sorry.
The case of
- locking to a layer
- that layer stops
- re-allocation

This should trigger a key frame request to the max available layer.
So, have to set the request layer to max available.
2023-02-20 14:49:32 +05:30
Raja Subramanian
c51d083016 Handle edge case of no published layer (#1446)
* WIP commit

* set max published layer

* split target and request layer
2023-02-20 14:16:46 +05:30
Raja Subramanian
6b55742564 Use available layers in optimal allocation. (#1445)
Addressing edge case where a layer stopped before bitrate could be
measured. Purely bit rate based change deduction missed this as
the before and after did not have bit rates.

Use available layers to look for changes, especially currently
forwarding layer going away.

Also, simplifying bits. Only in the optimal allocation path,
these things are required. When congested, bitrate is always needed.
So, for optimal path, just look at available layer changes and adjust.

Don't need to look for bitrate based layer changes. Clean up that code.
2023-02-19 11:41:40 +05:30
Paul Wells
b35d64ae86 finish timed version migration (#1443)
* finish timed version migration

* update protocol dep
2023-02-18 12:08:08 -08:00
Raja Subramanian
bdc515774e Declare migration complete only after publish callback finishes. (#1442)
The following sequence caused early migration complete declaration
1. Audio track received
2. Audio track published callback in progress
3. Video track received, this clears the pending track
4. Audio track published callback finishes. This checks for pending
   tracks. As nothing is pending migration complete declared.
5. Due to the above, the remote video track is closed as not resuming.
   That causes an unsubscription.

Fix
- Wait till publish callback to finish to remove a track from pending
  fully.
- Introducing a new map as pending tracks is used in OnClose too. So,
  did not want to delay removing from it as a close could happen while
  publish callback is happening.

Also, moving the publish callback to a go routine (just like the recent
change for running those in a go routine for migrated muted tracks)
2023-02-18 12:08:43 +05:30
David Zhao
7a2d9b3d61 Ensure subscription logging is clear & without sampling (#1440) 2023-02-17 22:15:19 -08:00
Raja Subramanian
0dcd4e4856 Ensure temporal is not at -1 for non-simulcast streams (#1441) 2023-02-18 09:52:53 +05:30
David Colburn
6da9e85636 Remove deprecated ingress rpc (#1439)
* remove legacy ingress rpcs

* remove from io service
2023-02-17 11:40:38 -08:00
Raja Subramanian
67b259bda4 consistent logging (#1437) 2023-02-17 23:41:58 +05:30
Raja Subramanian
9bf80511a9 Check for valid layers and also log unexpected target (#1438) 2023-02-17 23:39:06 +05:30
Raja Subramanian
9f33ce0ecd Declare migration complete after track publish callback. (#1436) 2023-02-17 19:34:31 +05:30
Raja Subramanian
85a23bfffc Cleaning up availableLayers and exemptedLayers (#1407)
* WIP commit

* Send stream state paused only when it is paused due to bandwidth limitation.

When stream is resumed after a stream is paused, an active update is
sent. Note that this means if there are intervening events like
mute/unmute between pause and resume, resume will be sent.

* WIP commit

* fix compile

* WIP commit

* fixing tests

* clean up exempted layers

* clean up unused stuff

* correct comment

* Don't need ops queue as order is not important now

* static check

* kick off allocation when callbacks are set up, calling from receiver means callbacks may not be set up
2023-02-17 13:53:11 +05:30
Raja Subramanian
9f94fc8347 Callback support for migrate state change. (#1435)
This can be used to detect changes in migrate state and signal
migration completion to remote nodes.
2023-02-17 13:13:01 +05:30
cnderrauber
6d16f061de Suppress negotiation timout log if signal disconnect (#1433)
* Suppress negotiation timout log if signal disconnect

* solve comment
2023-02-17 15:40:35 +08:00
cnderrauber
30834791fa Fix data stats bitrate calculate (#1432) 2023-02-17 12:33:28 +08:00
David Zhao
c16eb66925 Fix race condition with unsubscribing from a republished track (#1429) 2023-02-16 15:11:23 -08:00
shishirng
8856ce6422 Bump up interval for sending telemetry stats to 30 seconds (#1430)
Signed-off-by: shishir gowda <shishir@livekit.io>
2023-02-16 15:53:58 -05:00
Raja Subramanian
14a94fe693 Fix panic when closing room (#1428) 2023-02-16 11:59:13 +05:30
Raja Subramanian
6cb46107c8 Delete signal de-duper. (#1427)
Not a good design. There is not an easy way to filter messages
before it hits media node. Without that, there is not a lot
of advantage.

And there are sequences that are not handled correctly in this
deleted implementation.

So, deleting code to prevent use.
2023-02-16 09:32:48 +05:30
David Colburn
10c53e0ebb Move psrpc to protocol (#1426)
* move psrpc to protocol

* update checks

* update protocol

* update protocol ref

* blank line
2023-02-15 16:47:38 -08:00
Dan McFaul
1848a21eda add configurable environment value (#1421)
* add configurable prometheus env label

* Update pkg/config/config.go

Co-authored-by: Mathew Kamkar <578302+matkam@users.noreply.github.com>

* Update cmd/server/main.go

Co-authored-by: Mathew Kamkar <578302+matkam@users.noreply.github.com>

* Update config-sample.yaml

Co-authored-by: Mathew Kamkar <578302+matkam@users.noreply.github.com>

* set config.Environment value to dev when in dev mode

* be more precise for config-sample

---------

Co-authored-by: Mathew Kamkar <578302+matkam@users.noreply.github.com>
2023-02-15 14:41:44 -07:00
cnderrauber
4367e93855 parallel writing for data packet broadcast (#1425) 2023-02-15 17:18:43 +08:00
David Zhao
4f6fda586c Do not unsubscribe from track if it's been republished (#1424)
thank you @boks1971 for the debugging
2023-02-14 23:12:08 -08:00
Raja Subramanian
610c37f51a Log switch point of feed SSRC for debugging. (#1423) 2023-02-15 12:34:40 +05:30
Paul Wells
24d8ad0da9 add compare function to timedversion (#1422)
* add compare function to timedversion

* cleanup
2023-02-14 21:05:55 -08:00
David Colburn
c133b9f2e3 fix panic when output is missing (#1420) 2023-02-14 10:23:46 -08:00
Raja Subramanian
3309c6fff0 Log feed SSRC (#1419) 2023-02-14 18:05:20 +05:30
Raja Subramanian
7857af4a66 Send unpublished callback unconditionally. (#1418)
Even if an add track has been queued and can be used immediately
when the previous incarnation unpublishes, send the unpublished
callback as the track was technically unpublished and republished.
The re-publish will pick the same track SID when the pending track
is queued as it will get the SID from an existing published track.
2023-02-14 13:17:54 +05:30
David Zhao
ea12e1477f Update to go-redis v9. Fixed Redis cluster support (#1415)
* Update to go-redis v9. Fixed Redis cluster support
2023-02-12 22:22:21 -08:00
cnderrauber
e6eabb3a03 Prevent force tcp when client left between ice and dtls (#1414) 2023-02-13 13:57:50 +08:00
Raja Subramanian
2006359a97 move SDP to Debugw (#1413) 2023-02-12 22:56:43 +05:30
Raja Subramanian
481b4abbe5 Adding a debug log for track unpublish (#1412) 2023-02-11 09:38:58 +05:30
Mathew Kamkar
937256d89e don't error when get tc stats fails (#1386) 2023-02-10 10:05:45 -08:00
Trey Hakanson
ce07914e44 Allow for strict ACKs to be disabled or subscriber peer connections (#1410) 2023-02-10 22:51:03 +05:30
David Zhao
3e08ff1043 version 1.3.4 (#1411) 2023-02-09 23:31:42 -08:00
David Zhao
9a7ea7a2fa Close previous request channels when during initial retry (#1409)
So we don't leave abandoned requests hanging on the media instance
2023-02-09 17:27:33 -08:00
Dan McFaul
ad7e075c18 exit after panic (#1392)
* let panics crash

* Revert "let panics crash"

This reverts commit 8027cccadd.

* catch and log panics then os.Exit

* Recover only recovers, caller can exit

* only exit on pacic, still need Recover calls in goroutines
2023-02-09 16:33:22 -07:00
David Colburn
d2f0496223 list egress by id (#1404)
* list egress by id

* update proto ref
2023-02-09 00:10:54 -08:00
Raja Subramanian
8a7478fd0e Send stream state paused only when it is paused due to bandwidth limitation. (#1391)
* WIP commit

* Send stream state paused only when it is paused due to bandwidth limitation.

When stream is resumed after a stream is paused, an active update is
sent. Note that this means if there are intervening events like
mute/unmute between pause and resume, resume will be sent.
2023-02-08 20:03:32 +05:30
Raja Subramanian
95bc5b9849 Trigger max layer switch when downgrading. (#1398)
When downgrading (could be due to overshoot or opportunistically
locking to a higher layer), need to check if the max layer notification
needs to be done so that dynacast has the right max layer for the
participant corresponding to this downtrack.
2023-02-08 18:54:54 +05:30
cnderrauber
a04e7ce647 Fix panic by CreateSenderReport before bind completed (#1397) 2023-02-08 17:02:19 +08:00
Raja Subramanian
4d8def2eb7 Ignore errors on closed connection. (#1396) 2023-02-08 13:41:04 +05:30
Raja Subramanian
a1338b149c Limit layer to num advertised. (#1395)
* Limit layer to num advertised.

Otherwise, this leads to invalid layer for non-simulcast tracks.

* need to subtrack 1

* fix test
2023-02-08 11:28:32 +05:30
cnderrauber
5161dba873 Filter mdns candidate if not mdns not enabled (#1393)
* Filter mdns candidate if not mdns not enabled

* log target
2023-02-08 10:27:24 +08:00
cnderrauber
2393a559c4 ensuare onPacket is not nil in rtcpreader callback (#1390) 2023-02-07 15:49:32 +08:00
cnderrauber
524e8985c6 silent frame for muted audio downtrack (#1389)
send silent frame for subscribe to a muted audio downtrack (opus)
write blank frames for red audio track
2023-02-07 15:29:38 +08:00
Raja Subramanian
9d32c6065d Include track priority in de-duper checks (#1388) 2023-02-07 11:57:29 +05:30
cnderrauber
470a6fc9f1 Revert "Send silent frame for muted audio downtrack (#1385)" (#1387)
This reverts commit 0e699d6ed0.
2023-02-07 14:10:39 +08:00
cnderrauber
0e699d6ed0 Send silent frame for muted audio downtrack (#1385)
* Send silent frame for muted audio downtrack

* Don't drop audio packets on pub muted

* don't inject blank audio frames for muted track
2023-02-07 13:12:50 +08:00
David Zhao
2851a8ac98 Improved robustness of subscription stack (#1382)
UpdateSubscription had a shortcoming where when it couldn't find the
participant, it ignored the request.

This PR further removes the reliance of current publisher state from
subscribers.
- SubscribeToTrack only takes in a trackID
- Introduced RoomTrackManager to maintain all published tracks to a room
- Added TrackUnpublished event to clearly indicate when a track has been removed
- SubscribeRequested event no longer include information about the publisher
2023-02-06 18:08:26 -08:00