Commit Graph

2069 Commits

Author SHA1 Message Date
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
Raja Subramanian 55d5edcf73 Use range map in RTPMunger. (#2000)
* WIP commit

* Make lastSN 32-bit

* Remove unused TSCycles
2023-08-27 10:49:17 +05:30
Raja Subramanian 3c31ae5dc0 Use extended types for sequence number and time stamp in RTPStats. (#1999)
Reinstating this PR - https://github.com/livekit/livekit/pull/1548

Will use extended types in other places too over time.
2023-08-26 22:31:43 +05:30
Raja Subramanian 273defa75f Do not offer H.264 high profile in subscriber offer. (#1997)
* Do not offer H.264 high profile in subscriber offer.

Do not register H.264 high profile with media engine in subscriber
direction.

* add comments
2023-08-25 22:29:59 +05:30
boks1971 6491aacd34 Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-08-25 14:46:19 +05:30
Pingos 9d467e07d8 fix bug: p.pendingTracksLock.Unlock() when mid is empty (#1994) 2023-08-25 14:44:31 +05:30
Benjamin Pracht ce418dc6b3 Do not generate a stream key for URL pull ingress (#1993) 2023-08-24 12:50:05 -07:00
Raja Subramanian 8c99a9e307 Move GetAudioLevel interface. (#1992)
To allow use with RemoteParticipant/RemoteMediaTrack too.
2023-08-24 13:25:49 +05:30
Raja Subramanian 36dadbacb2 Drop padding only packets on publisher side. (#1990)
* Drop padding only packet on publisher side.

* add UT

* update deps

* remove debug

* add fast path short cut

* correct comment

* fix test

* fix for Linux
2023-08-24 09:09:42 +05:30
renovate[bot] 3733c4af6c Update github.com/ua-parser/uap-go digest to f8d2018 (#1972)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-23 13:05:33 -07:00
David Zhao adead8bb2b v1.4.5 (#1988) v1.4.5 2023-08-22 17:40:51 -07:00
Raja Subramanian 10893b9b33 Store referenceLayerSpatial in Forwarder state. (#1986)
When restoring state, reference layer could change before this change.
That meant the time stamp base would change and cause jumps.

But, the solution in this change to store the reference layer state
and restoring it has a different issue. It is possible that the reference is
layer 2 (HIGH) for example. On a migration when the down track has
to re-attach and resume to a moved up stream track, it is possible that
layer 2 is not published due to bandwidth constraint after publisher
migrates to new node. In that case, the stream cannot be resumed as
time stamp adjustment cannot be calculated.

An option is to set referenceSpatialLayer always at layer 0 (LOW).
But, that also has a couple of issues
- Browsers like FF have shown issues with layer mapping.
- Layer 0 is lowest bit rate. So, it will have RTCP at lower frequency.
  That could introduce a slight latency in stream start as we need
  RTCP sender report to calculate the time stamp.

Open to ideas on how to handle this better.
2023-08-22 00:03:37 +05:30
boks1971 6f92f9ea0e Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-08-21 20:02:18 +05:30
Raja Subramanian 28a60e1808 Need empty metadata object (#1985) 2023-08-21 19:47:18 +05:30
Raja Subramanian b1098cda41 Do not start RTPStats on a padding packet. (#1984) 2023-08-21 18:04:03 +05:30
Raja Subramanian 32af15dc80 Log RTP stream start time and more details when adjusting first packet time. (#1983)
Trying to understand first packet time jumps on migration.
2023-08-21 13:20:40 +05:30
boks1971 c0d4000cc3 Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-08-20 23:31:39 +05:30
David Zhao 75f5387ccd Allow data packet to be sent to participants by identity (#1982)
* Allow data packet to be sent to participants by identity

* update gomodules
2023-08-19 23:03:09 -07:00
Raja Subramanian 1078d96ff5 Fix log tag (#1981)
- Using "ts" collided with logger built-in tag and causes confusion
- Log a bit more to understand large jumps
2023-08-19 12:06:09 +05:30
boks1971 532b9b94ef Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-08-18 12:54:01 +05:30
Raja Subramanian 6049d268b3 Update deps (#1978)
* Update deps

* try Go 1.20

* revert as go.mod has go 1.18

* Move to Go 1.20
2023-08-18 12:36:52 +05:30
boks1971 8e09b38cd7 Merge remote-tracking branch 'origin/master' into raja_min_packets 2023-08-18 10:30:48 +05:30
Raja Subramanian ded2aec288 Demote noisy log (#1977) 2023-08-18 10:26:59 +05:30
Raja Subramanian ee88115097 Demote noisy logs (#1976) 2023-08-18 09:52:02 +05:30
Raja Subramanian 1a32439d7e Ensure older session does not clobeer newer session. (#1974) 2023-08-18 02:00:43 +05:30
Raja Subramanian 129b1df8e6 Use VP9 Key frame detection from Galene. (#1973)
* Use VP9 Key frame detection from Galene.

With ffmpeg generated VP9 file with single layer
and publishing via Go SDK, the key picture determination
outlined at https://datatracker.ietf.org/doc/html/draft-ietf-payload-vp9-16#page-13
under the F bit explanation does not work. It declares kay frame for
pretty much all frames. Unclear if ffmpeg generated bitstream has issues
or if that procedure in the above document does not work for single
layer case.

Using the bit stream explained here
https://storage.googleapis.com/downloads.webmproject.org/docs/vp9/vp9-bitstream-specification-v0.6-20160331-draft.pdf
(pages 28, 62, 63) implemented in Galene.
That is more expensive as it has to parse more, but works in all cases.

* Add AV1-TODo

* add some TODOs
2023-08-17 22:33:11 +05:30