Commit Graph

1688 Commits

Author SHA1 Message Date
boks1971 85a64de44b Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-09-08 23:49:59 +05:30
Raja Subramanian 492eb3bf18 Sequencer small optimisations (#2049)
* Sequencer small optimisations

1. Use range map to exclude padding only packets. Should take lesser
   space as we are not using slice to hold pointer to actual data.
2. Avoid `time.Now()` when adding each packet. Just use the arrival time
   as it should be close enough. `time.Now()` was showing up in
   profile.

* remove debug

* correct comment
2023-09-08 23:48:54 +05:30
boks1971 347cd8391f Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-09-08 21:17:30 +05:30
Raja Subramanian 83353d821c Make a config option to skip unmanaged tracks in bandwidth estimation (#2050)
* WIP commit

* Make a config option to skip unmanaged tracks in bandwidth estimation
2023-09-08 20:59:58 +05:30
boks1971 c431d7cc0c Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-09-07 22:27:25 +05:30
Raja Subramanian b95670f56b Removing one snapshot in down track. (#2047)
Profiling showed updating jitter going through the snapshot maps.
With the reduction of one, there should only be one snapshot
and hopefully that should gain some cycles back.
2023-09-07 22:22:00 +05:30
Raja Subramanian 3babb432c6 Missed an SN offset update in the previous round (#2044) 2023-09-07 15:58:42 +05:30
Raja Subramanian 6c94719487 Cache extended highest. (#2043)
* Cache extended highest.

Prevents calculating extended highest on every update to populate
PreExtendedHighest in the result.

* remove incorrect comment
2023-09-07 14:59:22 +05:30
Raja Subramanian 0fffaf3282 Some small optimisations (#2042)
* WIP commit

* WIP commit

* WIP commit

* Revert unintended delete
2023-09-07 13:25:09 +05:30
cnderrauber 75ffb25d77 Parse PortRange of UDPPort from cli flag (#2039) 2023-09-06 14:17:49 +08:00
Trey Hakanson b38b51dad8 Integrate updated TWCC responder (#2038)
Integrates the updated TWCC responder based on `pion/interceptor` from
https://github.com/livekit/mediatransportutil/pull/25
2023-09-06 08:37:52 +05:30
Raja Subramanian c122c20f49 Do not re-pause a paused track. (#2037) 2023-09-06 08:27:16 +05:30
cnderrauber 9b9298b927 Add batch i/o to improve throughput (#2033)
* Add batch i/o to improve throughput

* remove empty line

* Solve comments

* Change rtcconfig.UDPPort to PortRange

* Fix test
2023-09-06 10:18:20 +08:00
Raja Subramanian 1590b96686 Need to set reference layer when starting with dummy packets. (#2034)
Dummy packets are used at start to trigger Pion's OnTrack.
2023-09-05 12:00:00 +05:30
Raja Subramanian e922ae5f23 Filter out noisy error (#2032) 2023-09-04 22:01:07 +05:30
cnderrauber b85ff8f063 Support non-SVC AV1 track publishing (#2030) 2023-09-04 12:39:14 +08:00
boks1971 c4935791aa Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-09-03 10:00:56 +05:30
David Zhao d6ebc081d5 Use random NodeID instead of MAC based (#2029)
Makes it possible to run multiple instances of livekit-server locally.

Also enables Signal Relay by default as default signal proxy.
2023-09-02 17:36:55 -07:00
Raja Subramanian 6509bb0325 Add option to issue full reconnect on data channel error. (#2026)
* Add option to issue full reconnect on data channel error.

There are situations where send data packet fails because of "stream
closed". It is unclear when that happens. Seems to be after an
ICERestart after ICE failed and connection type switching to TURN
from ICE.

Once the failure happens, it is not recoverable. Potentially, it is
recoverable, but unclear where the problem lies. Attempts to reproduce
looking at the pattern of failures has been unsuccesful.

In the mean time, adding an option to issue full reconnect
when send data packet fails.

* typo
2023-09-01 17:59:25 +05:30
boks1971 4f01094550 Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-09-01 08:19:04 +05:30
Raja Subramanian b4efbe21a1 Log data channel close and errors. (#2025) 2023-08-31 23:44:11 +05:30
David Zhao d5808f96df Disconnect participant when signal proxy is closed (#2024)
When signal proxy is closed, we'd want to stop writing to it and sever
WS connection with the client. Client would go into a reconnect sequence
2023-08-31 09:39:45 -07:00
Raja Subramanian c7683fd383 Check for sctp.ErrStreamClosed (#2023) 2023-08-31 21:44:19 +05:30
boks1971 5ef475c4cb Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-08-31 14:32:54 +05:30
Raja Subramanian bc5b4d68af Do NACKs and reports always. (#2022)
* Do NACKs and reports always.

With padding packet drops, it is possible that a lot of packets
go by without RTCP RR.

Do NACKs and RTCP RR always.

* remove local variable
2023-08-31 12:41:25 +05:30
boks1971 b0aef0c661 Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-08-31 11:55:49 +05:30
Raja Subramanian 790954bbe9 Use RTCP SR to resync. (#2021)
Remove packet debug code that was added temporarily.
2023-08-31 11:45:42 +05:30
Raja Subramanian 6e3a20ebf4 Temporary packet debug (#2018) 2023-08-31 00:33:00 +05:30
Raja Subramanian da52167cd9 Adjust extended sequence number to account for dropped packets (#2017) 2023-08-30 23:08:53 +05:30
Raja Subramanian f9b613be41 Log resync data (#2016) 2023-08-30 22:18:27 +05:30
Raja Subramanian 9afb0873ae Do not process packets not processed by RTPStats. (#2015)
Seeing the case of a stream starting with padding packets
on migration. As publisher in that case is always sending packets.
it is possible that the new node gets padding packets at the start.
Processing them in buffer leads to trying to drop that padding packet
and adding an exclusion range. That fails because the extended
sequence number is not available for unprocessed packets.

It is okay to drop them as they will be dropped anyway.
But, they are useful for bandwidth estimation. So, headers are processed
even if the packet is RTPStats unprocessed.
2023-08-30 19:43:24 +05:30
boks1971 d9cf14cb4c Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-08-30 16:49:54 +05:30
Raja Subramanian 126872047d Handle duplicate padding packet in the up stream. (#2012)
* Handle duplicate padding packet in the up stream.

The following sequence would have produce incorrect results
- Sequence number 39 - regular packet - offset = 0
- Sequence number 40 - padding only - drop - offset = 1
- Sequence number 40 - padding only duplicate - was not dropped (this is
  the bug) - apply offet - sequence number becomes 39 and clashes with
  previous packet
- Sequence number 41 - regular packet - apply offset - goes through as 40.
- Sequence number 40 again - does not get dropped - will pass through as 39.

* fix duplicate dropping

* fix tests

* accept repeat last value as padding injection could cause that

* use exclusion ranges

* more UT and more specific errors
2023-08-30 16:46:39 +05:30
cnderrauber 5e481fe6bf Don't create new slice when return broadcast downtracks (#2013) 2023-08-30 15:31:01 +08:00
Raja Subramanian 33b48d986f Fix typo, have to check against start (#2011) 2023-08-29 21:45:58 +05:30
Raja Subramanian fdba70dab7 Use correct variables (#2010) 2023-08-29 21:13:07 +05:30
boks1971 213e6ea024 Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-08-29 17:09:31 +05:30
Raja Subramanian f0ca262bcf Prevent erroneous stream pause. (#2008) 2023-08-29 13:21:57 +05:30
Raja Subramanian 7dc8a7f80c Remove sender report warp logs. (#2007)
* Remove sender report warp logs.

They are not useful.
Also replacing drift report with proper protocol and reporting
both packet ad report drift.

Need to dig more into out-of-order sender report sending.
That requires some digging and understanding.

* record time of anachronous report

* more logging around out-of-order repair

* log time of out-of-order received sender report

* Update deps and place holder StartParticipantEgress
2023-08-29 00:30:24 +05:30
boks1971 0f95181ff0 Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-08-28 13:45:05 +05:30
David Zhao 64bcef28aa Address comments from #1998 (#2006) 2023-08-27 22:50:36 -07:00
Raja Subramanian 35f5629910 fix typo (#2005) 2023-08-28 08:24:18 +05:30
David Zhao eed8e85008 Demote more logs to debug (#1998) 2023-08-27 19:17:38 -07:00
boks1971 eb02770d01 Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-08-28 07:43:39 +05:30
Raja Subramanian 73b87f04df Fix out-of-order check after move to 64-bit extended sequence number. (#2004)
Also, clean up the RTCP RR handling a bit by removing redundant check.
2023-08-28 07:38:44 +05:30
boks1971 af3c55c4ac Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-08-27 21:52:31 +05:30
Raja Subramanian a48660fa77 Make extended sequence number 64-bit. (#2003) 2023-08-27 21:26:31 +05:30
Raja Subramanian 5a7d095a11 Change one of the tests to 16/64 bit combo (#2002) 2023-08-27 20:18:08 +05:30
Raja Subramanian 3b30f49ad5 Extended type for RTP timestamp. (#2001) 2023-08-27 17:28:44 +05:30
boks1971 1496c8f192 Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-08-27 11:07:03 +05:30