Commit Graph

1272 Commits

Author SHA1 Message Date
Benjamin Pracht
17ae1506f5 Chain twirpLogger and twirpRequestStatusHook properly for the Egress server (#1470) 2023-02-25 15:15:50 -07:00
Raja Subramanian
73399dd565 Encapsulate better. (#1466)
Only `logger` and `trackID` of `trackSubscription` is directly accessed
from outside. They are set at construction time. So, should be fine.
2023-02-24 09:34:03 +05:30
David Zhao
34fcf9e496 Additional case of subscribing to a closed track (#1465)
When the publisher stops publishing, the individual receivers would close
attached DownTracks first before notifying MediaTrackReceiver callbacks.

This means #1454 does not fix the issue entirely since there is still a window
when we can subscribe to a closing track.
2023-02-23 17:07:16 -08:00
David Colburn
3ac2a35c23 check nil video grants (#1463) 2023-02-23 11:30:59 -08:00
cnderrauber
dbb2cdf2b6 switch to tls if tcp ice dose not work well (#1458)
* switch to tls if tcp ice don't work well

* ignore tcp quality too bad
2023-02-23 14:07:50 +08:00
Raja Subramanian
cd0359c898 Reset subscription start timer on permission grant. (#1457)
If not, bind timeout could be reported on permission grant
as it could be using some old timer.
2023-02-23 09:39:33 +05:30
Raja Subramanian
15232560bc Send stream start on initial start (#1456)
A couple of other bits
1. Use request layer for sending PLI on bind and connected.
2. When adjusting for overshoot, do not adjust target unless current is
   at max. If not, it could get stuck in a lower layer in the following
   scenario
      a. Overshoot to layer 2
      b. Max layer is 1, start sending PLI
      c. Get key frame for layer 0, adjust for overshoot as we have
         something at a layer lower than max.
      d. Adjust for overshoot.
      e. Setting target to max means that current and target are equal
         and no further adjustment happens.
2023-02-23 09:35:12 +05:30
Haiyang Wang
15a9ad2b7a fix: unable to notify webhook when egress ending with status EgressStatus_EGRESS_LIMIT_REACHED (#1451) 2023-02-22 12:04:26 -08:00
David Zhao
e855620379 Prevent subscribing to track that's closing (#1454)
Due to the order of events in MediaTrackReceiver and friends, SubscribedTrack
will be closed before the track is removed from RoomTrackManager.

Because of this, when a track is unpublished, it's possible to be subscribed
to the track as it's closing.

By introducing a closing state, we'd prevent accidental subscription to
closing tracks.
2023-02-22 01:14:49 -08:00
cnderrauber
1b3d6fad54 update to utils parallel execute (#1450)
* log change

* remove identity field

* update to protocol parallel execute

* update protocol
2023-02-22 11:09:32 +08:00
Raja Subramanian
6f326be4f7 Do not overshoot when layer is locked. (#1449)
* Do not overshoot when layer is locked.

One more challenging case. When current layer is already locked,
should not set up for overshoot.

* set target to current
2023-02-20 16:41:58 +05:30
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