Commit Graph

1813 Commits

Author SHA1 Message Date
David Zhao
12c6f1e12c Added Xiaomi 2201117TI to devices that does not support H.264 (#1728) 2023-05-22 21:38:56 -07:00
Raja Subramanian
cba37389da mediatransportutil to get wrap back fix (#1732) 2023-05-23 10:02:36 +05:30
renovate[bot]
ceac340ddc Update github.com/livekit/mediatransportutil digest to cc5a379 (#1731)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-22 13:41:27 -07:00
renovate[bot]
04bcd601f0 Update livekit deps (#1599)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-22 13:29:52 -07:00
Raja Subramanian
d9e682a0d2 Fix unwrap (#1729)
* Fix unwrap

An out-or-order packet wrapping back after a wrap around had already happened
 was not using proper cycle ounter to calculate unerapped value.

* update mediatransportutil
2023-05-22 18:46:56 +05:30
David Zhao
5260907ffe Disable active TCP (#1726)
Active TCP was added in pion/ice v2.3.4. This is causing a couple of issues for us.

Active TCP does not make sense for an SFU. Clients are expected to be behind NAT and we should not be dialing them. Instead, LiveKit exposes a TCP port so clients could dial in
Active TCP is causing all iOS clients to become disconnected immediately. This is impacting all version of libwebrtc-based iOS clients (tested from M104 to M111)
2023-05-19 23:00:06 -07:00
shishirng
3de51181ec Fix setting minscore - initialized to 0 (#1725)
Signed-off-by: shishir gowda <shishir@livekit.io>
2023-05-19 11:00:32 -04:00
Raja Subramanian
0bb89575eb Fix min TS before first sender report (#1724) 2023-05-19 12:43:19 +05:30
David Zhao
93d6651d60 Improve error message when WaitUntil fails. (#1723) 2023-05-18 14:10:40 -07:00
Paul Wells
5f3ea75a1e conditionally block on signal relay close (#1722) 2023-05-18 13:53:20 -07:00
Paul Wells
e03b7ef8de start signal relay sessions with the correct node (#1721)
* start signal relay sessions with the correct node

* enable signal relay in multiregion integration test
2023-05-18 12:39:02 -07:00
shishirng
2e93d386fe send min/median connection score along with avg (#1720)
* send min/median connection score along with avg
* guard against divide by zero for avg score calculation
* update median calculation

Signed-off-by: shishir gowda <shishir@livekit.io>
2023-05-18 13:50:54 -04:00
Raja Subramanian
1d3faefc5e More scoring tweaks (#1719)
1. Completely removing RTT and jitter from score calculation.
   Need to do more work there.
   a. Jitter is slow moving (RFC 3550 formula is designed that way).
      But, we still get high values at times. Ideally, that should
      penalise the score, but due to jitter buffer, effect may not be
      too bad.
   b. Need to smooth RTT. It is based on receiver report and if one
      sample causes a high number, score could be penalised
      (this was being used in down track direction only). One option
      is to smooth it like the jitter formula above and try using it.
      But, for now, disabling that also.

2. When receiving lesser number of packets (for example DTX), reduce the
   weight of packet loss with a quadratic relationship to packet loss
   ratio. Previously using a square root and it was potentially
   weighting it too high. For example, if only 5 packets were received
   due to DTX instead of 50, we were still giving 30% weight
   (sqrt(0.1)). Now, it gets 1% weight. So, if one of those 5 packets
   were lost (20% packet loss ratio), it still does not get much weight
   as the number of packets is low.,

3. Slightly slower decrease in score (in EWMA)

4. When using RED, increase packet loss weight thresholds to be able to
   take more loss before penalizing score.
2023-05-18 20:16:43 +05:30
David Colburn
c3d6ecca6e check egress status on UpdateStream failure (#1716) 2023-05-17 16:46:22 -07:00
Benjamin Pracht
f401c44a46 Move TURNServers back to livekit-server (#1715) 2023-05-17 15:24:17 -07:00
cnderrauber
1c88a03366 Don't add nack if it is already present in track codec (#1714) 2023-05-17 18:48:54 +08:00
Raja Subramanian
9395f0b1fb More time stamp dance. (#1712)
Two things
- Somehow the publisher RTCP sender report time stamp goes back some
  times. Log it differently. Also, use signed type for logging so
  that negative is easy to see.
- On down track, because of silence frame injection on mute, the RTCP
  sender report time stamp might be ahead of timestamp we will use
  on unmute. If so, ensure that next timestamp is also not before
  what was sent in RTCP sender report.
2023-05-16 21:48:10 +05:30
Raja Subramanian
c79e0ce06f Make signal close async. (#1711)
* Make signal close async.

Left notes about async close in code.

Also reducing retry config timeout
- Timeout to 7.5 seconds (making it 1/4th of current config)
- max retry to 4 seconds
- so, it can do 4 tries now in 7.5 seconds (with retries ending at 0.5
  seconds, 1.5 seconds, 3.5 seconds, 7.5 seconds). The change of max to
  4 seconds is not really needed, but it lined up with 7.5. So, made the
  change.

* update comments a bit
2023-05-16 14:08:17 +05:30
Raja Subramanian
61102533ae Monitor and log RTP time stmap drifts (#1710)
The PID controller seems to be working well. But, it is unclear where
it can be applied as some of the data shows significant jumps
(either caused by BT devices or possibly noise cancellation/cpu
constraint) and although PID controller is slowly pulling things
to expected sample rate, it could be a bit slow.
Unfortunately, cannot munge too much in a middle box.
However leaving the controller in there as it is doing its job
for cases where things slip slowly.

Changing things to log significant jumps (more than 200 ms away
from expected) at Infow level.

Also, recording drift and sample rate in RTP stats proto and string
representation.
2023-05-13 18:41:09 +05:30
Raja Subramanian
a085afc6ee Send quality stats to prometheus. (#1708) 2023-05-12 09:44:03 +05:30
Benjamin Pracht
4244542840 Adopt WebRTCConfig from mediatransportutil (#1707)
This also adds support for inline fields in ToCLIFlagNames
2023-05-10 20:00:34 -07:00
Raja Subramanian
b61fad339f Handle time stamp increment across mute. (#1705)
* Handle time stamp increment across mute.

Two cases handled
1. Starting on mute could inject blank frame/padding packets.
These time stamps are randomly generated. So, when the publisher
unmutes, the time stamp was jumping ahead by only 1. Make it so
that they jump ahead by elapsed time since starting the blank frames/
padding packets.
2. When generating blank frames at the end of a down track, if
the track was muted at that time, the blank frame time stamps
could have been off (i. e. would have been pointing to time
after the last forwarded frame). Here also use current time
to adjust time stamp. Maybe, this could help in some cases where
we are seeing unflushed video buffer?

* remove unnecessary check

* address feedback and also maintain first synthesized time stamp
2023-05-10 18:31:49 +05:30
David Zhao
c254e5713f v1.4.2 release notes (#1663) v1.4.2 2023-05-09 23:41:34 -07:00
Raja Subramanian
4419cd56b8 Switch to rate since first time. (#1704)
With short term measurements, the adjustment itself was causing
some oscillations and drift tend to settle at some small value
and oscillated around it due to push/pull affecting small window
measurement.
2023-05-10 11:01:51 +05:30
Raja Subramanian
678cd06241 Infow -> Debugw (#1703) 2023-05-10 10:26:36 +05:30
Russ d'Sa
2d380868dc Update README.md (#1691)
* Update README.md

* Update README.md
2023-05-09 20:58:43 -07:00
David Colburn
2ccee369a6 update notifier (#1702) 2023-05-09 20:52:22 -07:00
David Colburn
0a3c22993e Remove deprecated egress client (#1701)
* remove deprecated egress client

* don't copy mutex
2023-05-09 16:54:32 -07:00
Raja Subramanian
f543e3f8d0 Send left over RTCP packets. (#1699) 2023-05-09 18:46:30 +05:30
Raja Subramanian
cf2a078579 Apply time stamp adjustment only at the start of a frame. (#1698)
It was possible that the adjustment applied in the middle
of a frame resulting in the same frame having multiple time stamps.
That would have caused video to pause/jump.

Apply the offset only at the start of the frame so that all
packets of a frame get the same offset.
2023-05-09 12:39:11 +05:30
Raja Subramanian
0e582ec82a fix the negative sign scope (#1696) 2023-05-09 00:13:01 +05:30
Raja Subramanian
153f02091c Use measurement in window instead of since start. (#1695)
This captues chnages within a measurement window.
2023-05-08 19:51:23 +05:30
Raja Subramanian
ddcb8342ef Fix Dervivative equation wrong brackets (#1693) 2023-05-07 18:36:26 +05:30
Raja Subramanian
14a2d06bcd RTCP sender reports every three seconds. (#1692)
* RTCP sender reports every three seconds.

Ideally, we should be sending this based on data rate.
But, increasing frequency a little as a lost sender report
means the client may not have sender report for 10 seconds
and that could affect sync. We do receiver reports once a second.
Thought of setting this to that level too, but not making a big change
from existing rate.

Also, simplifying the RTCP send loop. Don't need to hold and
do the processing after collecting all reports.

* consistent use of GetSubscribedTracks
2023-05-07 10:09:30 +05:30
Raja Subramanian
3fb93135f5 Experimental flag to try time stamp adjustment to control drift. (#1687)
* Experimental flag to try time stamp adjustment to control drift.

There is a config to enable this.

Using a PID controller to try and keep the sample rate at expected
value. Need to be seen if this works well. Adjustment are limited
to 25 ms max at a time to ensure there are no large jumps.
And it is applied when doing RTCP sender report which happens
once in 5 seconds currently for both audio and video tracks.

A nice introduction to PID controllers - https://alphaville.github.io/qub/pid-101/#/
Implementation borrowed from - https://github.com/pms67/PID

A few things TODO
1. PID controller tuning is a process. Have picked values from test from
   that implementation above. May not be the best. Need to try.
2. Can potentially run this more often. Rather than running it only when
   running RTCP sender report (which is once in 5 seconds now), can
   potentially run it every second and limit the amount of change to
   something like 10 ms max.

* remove unused variable

* debug log a bit more
2023-05-06 11:52:57 +05:30
David Zhao
ae5d2c3261 Integrate fix for webhook delivery delays (#1690) 2023-05-05 23:11:22 -07:00
Danil Andreev
0250d9855a Correctly ignore .idea directory (#1686) 2023-05-05 22:40:12 -07:00
David Zhao
0586009e0d Do not send hidden participants after resume (#1689) 2023-05-05 22:38:17 -07:00
Raja Subramanian
25d6fd751f Cleaning up smoothed OWD calculation for sender report. (#1684)
* Keep track of expected RTP time stamp and control drift.

- Use monotonic clock in RTCP Sender Report and packet times
- Keep the time stamp close to expected time stamp on layer/SSRC
  switches

* clean up

* fix test compile

* more test compile failures

* anticipatory clean up

* further clean up

* add received sender report logging
2023-05-05 13:14:12 +05:30
renovate[bot]
e00ff50cd6 Update go deps (#1680)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-04 22:33:22 -07:00
Raja Subramanian
28a8a808f2 Do not add empty video layers in stats. (#1685) 2023-05-05 08:59:08 +05:30
Raja Subramanian
15078eb9f4 Keep track of expected RTP time stamp and control drift. (#1681)
* Keep track of expected RTP time stamp and control drift.

- Use monotonic clock in RTCP Sender Report and packet times
- Keep the time stamp close to expected time stamp on layer/SSRC
  switches

* clean up

* fix test compile

* more test compile failures
2023-05-04 13:00:57 +05:30
cnderrauber
298ebaee78 Suppress error log of setPrefferedCodec for simulcast codec track (#1682) 2023-05-04 15:14:20 +08:00
David Zhao
5fcd682fb0 Refactor participant metadata updates to avoid duplication (#1679)
* Refactor participant metadata updates to avoid duplication

* generated fakes
2023-05-03 13:50:45 -07:00
renovate[bot]
4bd20c77b7 Update module github.com/prometheus/client_golang to v1.15.1 (#1677)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-03 09:33:20 -07:00
renovate[bot]
0e9e7e994d Update go deps (#1672)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-03 00:08:12 -07:00
Benjamin Pracht
11749eace9 Add support for creating WHIP ingress (#1674) 2023-05-02 13:26:47 -07:00
Raja Subramanian
00217c7af1 Logging delta of receiver report (#1676) 2023-05-02 22:43:37 +05:30
Paul Wells
87e2b2366e reduce log level of signal close errors (#1675)
* reduce log level of signal close errors

* update psrpc

* cleanup

* cleanup
2023-05-02 08:31:12 -07:00
Raja Subramanian
3070e976c3 Log received sender report of audio for debugging (#1673)
* Log received sender report of audio for debugging

* log OWD also

* add some more bits
2023-05-02 00:22:33 +05:30