Commit Graph

2112 Commits

Author SHA1 Message Date
Raja Subramanian 7d035deef8 Clean up logging fields a bit (#2767) 2024-06-06 23:03:21 +05:30
Paul Wells d95b59de58 update protocol (#2764)
* update protocol

* deps
2024-06-05 23:50:54 -07:00
cnderrauber 908baeb942 initialize bucket size by publish bitrates (#2763) 2024-06-06 14:31:20 +08:00
Paul Wells f1886ece42 update protocol (#2760)
* update protocol

* deps
2024-06-05 19:46:34 -07:00
Raja Subramanian d3f9e8b8e5 Do not add tracker for invalid layers. (#2759)
Previously, the bit rate interval config was checked first. That would
have returned `!ok` for invalid layers. A recent change to prevent
duplicate tracker addition re-arranged the code and the tracker array
was accessed out-of-bounds.

Unclear why an invalid layer is passed in. Need to investigate that.
2024-06-05 23:06:22 +05:30
Raja Subramanian cfd3777f47 Use a safety net OnClose to remove track from peer connection. (#2758) 2024-06-05 21:54:22 +05:30
Raja Subramanian fdde44d926 Attach time stamp offset to publisher sender report. (#2757)
There are cases where the RTP time stamp does not increment acros
mute/unmute. Seems to happen fairly consistently with React Native
clients.

Something like the following happens
- Track is progressing
- Mute at `t = x`, assume RTP time stamp at the point is `y` and RTP clock
  rate is `z`.
- Through mute, more RTCP sender reports come in from publisher and the
  RTP time stamp in those reports are progressing at expected rate of
  `z` RTP clock ticks per second.
- Forwarding path uses those sender reports from publisher to build the
  sender report for subscribers.
- Unmute happens at `t = x + a` seconds.
- Ideally packets coming in after that, should have a time stamp of `y +
  (a * z)`, but they tend to have something a little bit more than `y`.
- RTCP sender reports also have a time stamp that goes back. SFU ignores
  these.
- Mean while the forwarding path has adjusted to the new RTP time stamp
  base and it has calculated a TS offset (from publisher -> subscriber).
  Effectively, that offset comes out close to `(a * z)`, i. e. jump
  corresponding to the mute interval.
- When it is time to send a RTCP sender report to subscriber, the old
  sender report from publisher is used (as intervening ones from
  publisher were rejected because time stamp is moving backwards).
  The problem is that the old report is used with new offset.
  So, it looks like time stamp jumped ahead by `a` seconds.

Address it by storing time stamp offset at the time of receiving the
publisher side sender report. And use that while sending subscriber side
sender report. There are very edge cases where this can
get mismatched, but should be rare. Hopefully, this should prevent
unnecessary jumps in time stamp in RTCP sender report to subscribers.
2024-06-05 13:02:33 +05:30
Raja Subramanian 49e1848d1d Move resync to TrackSender interface so that it can be called directly from up track (#2755) 2024-06-04 22:38:39 +05:30
Raja Subramanian 03bb468472 Log range map for debugging. (#2754)
* Log range map for debugging.

* log details on errors

* log details
2024-06-04 08:00:26 +05:30
Raja Subramanian 1e52b09e24 Reset tracker on expected layer increase. (#2753)
Was hitting the edge case mentioned in the (now deleted in this PR)
comments. It is fine to reset and let it declare available again.
Available layer handler will ignore repeats.
2024-06-03 13:58:58 +05:30
cnderrauber b90ade81da add log for unexpected jitter (#2752) 2024-06-03 15:12:53 +08:00
Raja Subramanian b7ea733492 Fix DD tracker addition. (#2751)
DD uses a wrapped tracker. Check only stream tracker manager field for
existing tracker.
2024-06-03 12:14:42 +05:30
Raja Subramanian e483cee662 Prevent tracker override. (#2750)
When relaying buffers are stopped and restarted. On a restart,
the buffer adds a tracker. But, the tracker is not destroyed till the
end. So, the old tracker and new tracker for the same layer stomp on
each other and declare layer unavailable (the old tracker is not getting
any packets).

Fix by not creating a new tracker if one exists already.
2024-06-03 11:55:59 +05:30
David Zhao b99650aaf6 Send NodeID with analytics events (#2749) 2024-06-02 09:09:55 -07:00
cnderrauber 526d3a017e ignore abnormal forward delay (#2748) 2024-05-31 10:23:37 +08:00
Raja Subramanian 3ad0a69c86 Stop probe on probe controller reset (#2744) 2024-05-29 18:26:22 +05:30
Raja Subramanian f9f761b223 Demote some less useful/noisy logs. (#2743) 2024-05-29 12:05:18 +05:30
Raja Subramanian 447793d077 Move RTT errors to Debugw. (#2742)
With the move to forwarding NTP timestamp as is, we get a bunch more of
this error logged as the remote is basing it off of previous report and
local (i. e. server-side) bases it off of a more recent report.

Anyhow, this code has been around for a long time and there is nothing
new to learn from those errors. Just log it at Debugw in case we can
learn something from it for specific projects or environments where
Debugw is okay.
2024-05-29 11:26:30 +05:30
Raja Subramanian d944faf078 Selectively log big jumps in timestamp on source switch. (#2741) 2024-05-29 10:51:17 +05:30
Paul Wells bc6dbd98c7 fix sip MatchTrunk call (#2740) 2024-05-28 19:04:06 -07:00
Raja Subramanian 9781d30611 Do not propagate RTCP if report is not processed. (#2739) 2024-05-28 19:29:54 +05:30
Denys Smirnov fa65712a0e Use camel case in SIP logs. (#2738) 2024-05-28 13:43:22 +03:00
cnderrauber 7ed1284b96 report average forward metrics (#2737)
* report average forward metrics

* unused parameter
2024-05-28 17:03:18 +08:00
Raja Subramanian d9910ead61 Add back TrafficStats used by cloud. (#2736) 2024-05-27 13:43:20 +05:30
cnderrauber 2288e402ac register forward metrics (#2735) 2024-05-27 15:47:01 +08:00
Raja Subramanian 991ad5a0ea Remove unused traffic load (#2734) 2024-05-27 10:53:23 +05:30
Raja Subramanian 721c36fbc0 Send telemetry events on track feature updates. (#2723)
* Send telemetry events on track feature updates.

* Do not process no change
2024-05-27 10:46:26 +05:30
Paul Wells 5e3b1e0f67 reduce participant lock scope (#2732) 2024-05-26 14:01:23 -07:00
Paul Wells 38470f378b add message bytes metric (#2731) 2024-05-26 14:01:13 -07:00
Raja Subramanian 8be2005e0f More detailed logging to understand old packets. (#2730) 2024-05-25 18:34:55 +05:30
cnderrauber e6aa36fdd6 Add forward stats (#2725)
* Add forward metrics

* ignore packets was not forwarded

* rename
2024-05-24 17:43:28 +08:00
Denys Smirnov a444f2477c Update protocol. Support SIP transports. (#2724) 2024-05-23 20:31:01 +03:00
Raja Subramanian 96cb829b84 Log more info when adjusting start timestamp. (#2722)
Seeing some large time stamp jump in relay down track once in a while.
Logging more details on time stamp switch to learn more.
2024-05-23 13:03:26 +05:30
Raja Subramanian ef6f205fcc Pass through timestamp in abs capture time (#2715) 2024-05-15 11:41:37 +05:30
Raja Subramanian 91520a36e0 Add a flag to pass through timestamp. (#2714)
* Add a flag to psss through timestamp.

Can make it a config later if needed.

* log both adjusted and non-adjusted
2024-05-13 15:11:28 +05:30
Théo Monnom 9887d32bd2 fix: connection reset without any closing handshake on clientside (#2709) 2024-05-11 13:39:17 +02:00
Benjamin Pracht eef3cf0f01 Redact egress object in CreateRoom request (#2710) 2024-05-10 10:05:53 -07:00
Raja Subramanian 80a4d021b9 Add simulate leave request close reason (#2713) 2024-05-10 20:02:25 +05:30
Raja Subramanian 66a3a8e028 cond broadcast always. (#2699)
With Read and ReadExtended waiting (they are two different goroutines),
use Broadcast always. In theory, they both should not be waiting at the
same time, but just being safe.
2024-05-10 12:32:28 +05:30
Paul Wells b54acb0bad ensure room is running before attempting to delete (#2705)
* ignore api errors when deleting room

* start room before deletion

* delete from db first

* load
2024-05-09 00:06:41 -07:00
Raja Subramanian 71b5ffed93 Less confusing variable name (#2706) 2024-05-08 16:10:49 +05:30
Paul Wells 9a5db132eb add room/participant name limit (#2704)
* add room/participant name limit

* defaults

* simplify

* omitempty

* handle 0 config

* fix race

* unlock

* tidy
2024-05-06 17:25:18 -07:00
Raja Subramanian 4d7586bda8 Simplify layer roll back. (#2702)
* Cache TS offset along with sender report.

* set offset after clearing

* simplify roll back
2024-05-04 15:00:19 +05:30
Antti Tapaninen 45ed030ce6 add missing strings.EqualFold for some mimeType comparisons (#2701) 2024-05-04 11:47:29 +05:30
Raja Subramanian 26c2f7cd9a Do not use LastTS for dummy offset. (#2700)
* Do not use LastTS for dummy offset.

LastTS could be random when using dummy start. That should not be used
in calculating offsets.

Also, do not push padding into sequence before init. Could have heppened
with dummy start.

* apply dummy offset before comparing to last

* refresh ref TS

* initialize codec munger on catch up forwarding
2024-05-03 18:56:01 +05:30
Raja Subramanian 674550ea16 Option to disable traffic load tracking. (#2698) 2024-05-02 19:09:12 +05:30
Raja Subramanian a2a8810734 log the correct new propagation delay (#2694) 2024-04-30 08:29:59 +05:30
cnderrauber cfa82c6ad4 increase protocol version to support optional publisher datachannel (#2693) 2024-04-28 15:09:24 +08:00
Raja Subramanian c8b289daa5 (Attempted) Simplify time stamp calculation on switches. (#2688)
* Simplify time stamp calculation on switches.

Trying to simplify time stamp calculation on restarts.
The additional checks take effect rarely and it not worth the extra
complication.

Also, doing the reference time stamp in extended range.
The challenge with that is when publisher migrates the extended
timestamp could change post migration (i. e. post migration would not
know about rollovers). To address that, maintain an offset that is
updated on resync.

* WIP

* Revert to resume threshold

* typo

* clean up
2024-04-28 12:13:52 +05:30
Paul Wells 18b3b7b421 use readCond in buffer read (#2691) 2024-04-27 04:04:01 -07:00