Commit Graph

1632 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
Raja Subramanian
480edff4ac Adjust TS and cycles when adjusting start. (#1971)
* Adjust TS and cycles when adjusting start.

Chasing some AddPacket errors across relay.
Noticed that in one case the start/end sequence was flipped.
There is a known issue of it happening with resync.
Unclear if this instance was due to resync or not.
The start was close to the edge (64513). So, thought maybe
adjust at start and noticed that it needs to maybe increase
cycle count if start is wrapping back. In this case, the
start is 1000 before wrap point. So, may not be a wrap back
issue, but addressing what I found anyway.

* fix test
2023-08-16 13:52:01 +05:30
Raja Subramanian
c0ea1b9ced Remove warning for probe rate being too high. (#1970)
Not super useful. It does happen a bunch of times especially at lower
end of estimate where the next layer up is high. We have to probe
anyway. Effects of large jumps have been mitigated by doing it for short
time.
2023-08-16 12:17:29 +05:30
David Zhao
13b1b4808f Fix race condition causing new participants to have stale room metadata (#1969)
If room metadata is changed in between when a participant is joining and
when they've became active, that participant will not have the latest
room metadata.
2023-08-15 17:30:26 -07:00
Raja Subramanian
96fa2f896b Set 32-bit RTP timestamp properly after repair. (#1968) 2023-08-15 23:09:45 +05:30
Raja Subramanian
221be0cb45 mediatransportutil update (#1966) 2023-08-15 15:40:30 +05:30
Raja Subramanian
77c8e82473 log adjustment for first packet (#1965) 2023-08-14 23:50:01 +05:30
Raja Subramanian
ce1fde451c Get next higher using bit rate. (#1960) 2023-08-11 17:22:56 +05:30
Raja Subramanian
5c0a4beb61 Log more about layer offset. (#1959)
Seeing a good chunk of logs using default offset.
And it is concentrated heavily on few tracks.
Logging more to understand this better before
potentially demoting this log.
2023-08-11 13:03:10 +05:30
Raja Subramanian
114888e7c7 log next sequence number also, easier to check layer switches (#1957) 2023-08-11 10:50:11 +05:30
Raja Subramanian
51650ea301 Use refTS if ahead. (#1956)
As expectedTS is tied to first packet and first packet adjustment
may not have happened, refTS being ahead is not a bad thing.

In one example,
- first packet was late
- a layer switch happened around 110ms later
- in that time, 190ms worth of media was forwarded
- but first packet adjustment did not happen yet
- so at that layer switch, expected was behind
- choosing ref at that switch is the right thing
2023-08-11 10:17:13 +05:30
Raja Subramanian
19b84207a1 Use 32-bit ts for first packet adjustment. (#1955)
* Use 32-bit ts for first packet adjustment.

Otherwise, a new subscriber on a long running sees a huge difference
if the publisher side has rolled over.

As this happens only in the first two minutes of a track's lifecycle
it is fine to not consider rollover.

* log RTP in anachronous report
2023-08-11 09:43:12 +05:30
David Zhao
387faf2718 Demote removing subscribers for MIME (#1954) 2023-08-10 18:50:19 -07:00
Raja Subramanian
ae29d05ec9 Check RTPSender is valid (#1953)
On a quick Bind + Unbind, the go routine to get parameters running late
could encounter a nil sender. Check for it.
2023-08-10 23:02:10 +05:30
cnderrauber
42a8ab232d Never use dd tracker for non-svc codec (#1952) 2023-08-10 23:06:09 +08:00
Raja Subramanian
7802310830 Restrict resume behind check to publisher mute only. (#1951)
A publisher mute is when the reference can fall behind because
of replaceTrack(nil). On a subscriber mute, should not jump ahead
to expected because publisher could still be lagging and behind.

Also consolidate logging.
2023-08-10 13:48:39 +05:30
Raja Subramanian
f22d1e5a75 Fix nil pointer dereference (#1949) 2023-08-10 01:31:51 +05:30
Raja Subramanian
0e9ec9a21e Ignore lagging layer switches. (#1948) 2023-08-09 17:42:33 +05:30
Raja Subramanian
c14c58b4ae Layer switches at log info to better understand A/V sync issues. (#1947) 2023-08-09 11:28:48 +05:30
Raja Subramanian
9a96abc11f Intermediate signed type casting (#1944) 2023-08-08 23:44:03 +05:30
Paul Wells
f4a984d446 preallocate prometheus packet counters (#1942) 2023-08-08 01:06:14 -07:00
cnderrauber
80832a83db Fix panic when format DependencyDescriptor (#1941) 2023-08-08 10:02:53 +08:00