Commit Graph

28 Commits

Author SHA1 Message Date
Raja Subramanian
fa01297d96 Slight sequencer tweaks. (#2184)
The buffer is not for padding packets. So, calculate
adjusted sequence numbers before comparing against size.

Also, it is possible that invalidated slot is accessed
due to not being able to exclude padding range. This was
causing time stamp reset to 0. Will remove the error log
after this goes out and the condition does not show up
for a few days.
2023-10-25 23:12:14 +05:30
Raja Subramanian
39edfab2b5 Fix extended TS calculated during retransmit. (#2164)
May have caused the large time stamp jump in sender reports.
2023-10-21 02:25:03 +05:30
Raja Subramanian
6c49d1a160 Logging a few bits at Infow (#2126)
Seeing sequencer errors with egress (related to dummy start).
So, logging a few bits at Infow to understand them better.
2023-10-05 11:16:31 +05:30
Raja Subramanian
9c2ad54146 Clean up debug logs (#2076) 2023-09-16 01:57:34 +05:30
Raja Subramanian
69177b8b6e Debug logs to check on sequencer missing offset. (#2071)
* Debug logs to check on sequencer missing offset.

* spelling

* close range on value decrement
2023-09-14 12:20:33 +05:30
Raja Subramanian
3f9f3adf91 Fix init. (#2067)
Stupid me.
2023-09-13 12:53:16 +05:30
Raja Subramanian
c09d8d0878 Split RTPStats into receiver and sender. (#2055)
* Split RTPStats into receiver and sender.

For receiver, short types are input and need to calculate extended type.

For sender (subscriber), it can operate only in extended type.
This makes the subscriber side a little simpler and should make it more
efficient as it can do simple comparisons in extended type space.

There was also an issue with subscriber using shorter type and
calculating extended type. When subscriber starts after the publisher
has already rolled over in sequence number OR timestamp, when
subsequent publisher side sender reports are used to adjust subscriber
time stamps, they were out of whack. Using extended type on subscriber
does not face that.

* fix test

* extended types from sequencer

* log
2023-09-11 07:33:39 +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
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
872b86da3b Delay retransmission after first send. (#1918)
* Delay retransmission after first send.

* test tweak

* english
2023-07-30 12:24:58 +05:30
David Zhao
981fb7cac7 Adding license notices (#1913)
* Adding license notices

* remove from config
2023-07-27 16:43:19 -07:00
Raja Subramanian
887f6580ec Cache marker in sequencer and use it while retransmit. (#1912)
With SVC codecs, input marker and fowarded marker could be different.
So, cache it in sequence and use it on retransmit.

@cndderrauber - this could have affected SVC under packet loss.
2023-07-27 17:08:14 +05:30
Raja Subramanian
69a1e572be Attempt to reduce disruption due to probe. (#1839)
* Make congestion controller probe config

* Wait for enough estimate samples

* fixes

* format

* limit number of times a packet is ACKed

* ramp up probe duration

* go format

* correct comment

* restore default

* add float64 type to generated CLI
2023-06-30 11:09:46 +05:30
Raja Subramanian
5b34d754e0 Safe access of sequencer (#1625)
* log some NACKs

* split out NACK tracker

* remove debug

* debug

* Sequencer safety

* Clean up
2023-04-17 13:02:24 +05:30
Raja Subramanian
e32eaa451f Refactor video layer selector (#1588)
* WIP commit

* WIP commit

* fix test

* FPS for VP9

* WIP commit

* test changes

* WIP commit

* h264

* codec munger

* forwarder state

* clean up a bit

* dd interface

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* more TODO notes

* overshoot interface

* clean up

* clean up isTemporalSupported

* wait for key frame to resume

* clean up VP8 payload descriptor stuff

* temporal layer selector

* comment out vp9 and av1

* space

* fix test compile

* append bytes

* fix tests

* fix test
2023-04-08 10:57:57 +05:30
Raja Subramanian
b9894ab014 Allocate packetMeta up front to reduce number of allocations. (#1108) 2022-10-20 14:31:19 +05:30
Raja Subramanian
08047eea60 Use pointers for packetMeta in sequencer to save memory. (#1100)
Padding packets do not need the full structure. They just
need a placeholder in the sequencer array. So, use pointers
(with padding slots filled by nil) to save some memory.

Also, don't need padding for audio (yet). As padding packets
are used only for probing and we do not probe using audio tracks (yet).
2022-10-19 09:37:32 +05:30
cnderrauber
aee97c68bc retransmit dd extension (#837) 2022-07-18 13:06:33 +08:00
Raja Subramanian
5a9459d0d5 Use the same wrap logic as bucket as it is more robust (#460)
Also rename n -> s for golang convention
2022-02-24 17:51:02 +05:30
Raja Subramanian
babbfb37aa Include NACK ratio in congestion control (#443)
* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* Clean up

* Remove debug

* Remove unneeded change

* fix test

* Remove incorrect comment

* WIP commit

* Reset probe after estimate trends down

* WIP commit

* variable name change

* WIP commit

* WIP commit

* out-of-order test

* WIP commit

* Clean up

* more strict probe NACKs
2022-02-18 14:21:30 +05:30
David Colburn
7bbd238188 clean up logs and imports (#400) 2022-02-03 14:20:19 -07:00
Raja Subramanian
9db2bd22df LK logger with context in SFU (#391)
* LK logger with context in SFU

* Move buff.SetLogger into sfu.WebRTCReceiver
2022-02-01 08:57:09 +05:30
David Colburn
5bea9debb7 Code cleanup (#353) 2022-01-19 02:13:06 -08:00
Raja Subramanian
1be3a3986d Recover VP8 MBit properly when unpacking from packetMeta (#255)
* Recover VP8 MBit properly when unpacking from packetMeta

* one liner for itob
2021-12-11 10:06:04 -08:00
Raja Subramanian
edafb0a118 VP8Munger tests (#229)
A bit of clean up of unused bits.
2021-12-03 21:57:49 +05:30
Raja Subramanian
6141567aef Unit tests for VP8 pack/unpack in packetMeta. (#228)
Deleting unused code.
2021-12-03 15:37:49 +05:30
cnderrauber
1e1aaeb86b Separate from ion-sfu (#171)
* Separate from ion-sfu

changes:
1. extract pkg/buffer, twcc, sfu, relay, stats, logger

2. to solve cycle import, move ion-sfu/pkg/logger to pkg/sfu/logger

3. replace pion/ion-sfu => ./
reason: will change import pion/ion-sfu/pkg/* to livekit-server/pkg/*
after this pr merged. Just not change any code in this pr, because it
will confused with the separate code from ion-sfu in review.

* Move code from ion-sfu to pkg/sfu

* fix build error for resovle conflict

Co-authored-by: cnderrauber <zengjie9004@gmail.com>
2021-11-09 12:03:16 +08:00