Commit Graph

35 Commits

Author SHA1 Message Date
Raja Subramanian c823320528 Add a key frame seeder in up track. (#3524) 2025-03-12 22:11:27 +05:30
Raja Subramanian 05dfd30d5b Take RTT and jitter from receiver view while reporting track stats for (#3483)
* Take RTT and jitter from receiver view while reporting track stats for
down stream tracks.

* adjust jitter in aggregate
2025-03-03 18:48:37 +05:30
Raja Subramanian 83a839811c Transfer metadata cache over flow counter. (#3472)
* Transfer metadata cache over flow coutner.

Without that, logging was not getting sampled.

* sender
2025-02-27 11:21:11 +05:30
Raja Subramanian ca4526048c structured logging (#3461) 2025-02-24 11:47:35 +05:30
Raja Subramanian b3da3ff2cb Give more cache for RTX. (#3438)
- With probing the packet rate can get high suddenly and remote may not
  have sent receiver report as it might be sending for the non-spikey
  rate. That causes metadata cache overflows. So, give RTX more cahe.
- Don't need a large cache for primary as either reports come in
  regularly (or they are missing for a long time and having a biger
  cache is not the solution for that, so reduce primary cache size)
- Check for receiver report falling exactly back by (1 << 16). Had done
  that change in the inside for loop, but missed the top level check :-(
2025-02-15 22:43:28 +05:30
Raja Subramanian 9fd80c8919 Catch up if the diff is exactly (1 << 16) also. (#3433) 2025-02-14 12:50:52 +05:30
Raja Subramanian f160f6200a Do not log no packets in delta. (#3427)
Can happen a lot with dynacast layer turn off.
2025-02-13 11:25:57 +05:30
Raja Subramanian 7fef374b19 Split down stream snapshot into sender view and receiver view. (#3422)
Receiver view is used for connection quality.

Sender view is used for analytics. One thing that this introduces is
that sender view uses the packet loss information from receiver view as
true loss is available only in the RTCP Receiver Reports received from
the remote side. So, the time alignment is off, i. e. receiver report
happens periodically and it includes information till the time at which
it was sent from remote side, but sender could have sent more packets
after that time.

The split should ensure that analytics does not rely on remote side
sending proper receiver repoerts albeit at slight misalignment of loss
statistic for remotes that send RTCP RR (which should be majority of the
cases)
2025-02-11 16:05:00 +05:30
Raja Subramanian 7ff4082e4a Do not skip due to large RR interval. (#3398)
* Do not skip due to large RR interval.

With sequence number adjustment, it will report some packets missing
which is fine.

* do not seed if already initialized
2025-02-04 11:08:38 +05:30
Raja Subramanian f45e3613ac Correct reason for poor/lost score. (#3397)
No functional change, just logging reason was confusing.
Also, log no packets case. Seeing some instances in staging where there
are periods of no packets received. Trying to understand better.
2025-02-04 00:59:56 +05:30
Raja Subramanian 2f758d49ce Adjust receiver report sequence number to be within range of highest. (#3396) 2025-02-03 21:58:26 +05:30
Raja Subramanian 92e3f2e3d0 Starting on padding for RTX stream is accepted. (#3390) 2025-02-02 20:26:30 +05:30
Raja Subramanian 20b400faef Use signed check on rollback. (#3389) 2025-02-01 14:16:53 +05:30
Raja Subramanian adc2246353 Move sequence number adjustment to when out-of-order is detected (#3387)
initially.

Out-of-order reception is detected and dropped before this change. By
moving the adjustment to that point, potentially more reports can be
processed.
2025-01-31 11:56:48 +05:30
Raja Subramanian 2b5ee12f9b Reduce chances of metadata cache overflow. (#3369) 2025-01-27 18:14:57 +05:30
Raja Subramanian 043464828a Correct off-by-one lost count on a restart. (#3337)
* Correct off-by-one lost count on a restart.

* log sender snap shot ID

* metadata cache overflow count per snapshot
2025-01-16 23:41:41 +05:30
Raja Subramanian 53d300ba71 Use nano time for easier (and hopefully) faster checks/calculations. (#3323) 2025-01-12 00:56:46 +05:30
Raja Subramanian bfbc4fa81f Remove alloc in packet forwarding path. (#3305)
* Remove alloc in packet forwarding path.

Unlikely logger creation was doing allocs. Replace it with a function
like in rtpstats_receiver.go so that allocations do not happen
unnecessarily.

* variable rename

* one more place
2025-01-06 11:48:27 +05:30
Raja Subramanian cfe3178542 Reconcile RTP stats with RTX data. (#3252)
* RTX RTPStats

* WIP

* RTCP RTX handler

* reconcile rtx

* cache size

* clean up

* test

* clean up
2024-12-15 14:33:02 +05:30
Raja Subramanian d07d84f99f Sender side snap shot clean up and logging. (#3196)
* Sender side snap shot clean up and logging.

Seeing cases of sender snap shot packet loss much higher the actual
packets some times. Tracking a bit more to understand that better.
- Rename variables to indicate what is coming from feed side clearly
- Fixed an issue with wrong init of feed side loss in snapshot
- Just use the loss from receiver report as it can go back (receiver
  would subtract on receiving out-of-order packet).
- keep track sof reports in a snapshot (this is temporary for
  debugging/understanding it better and will be removed later)

* remove check
2024-11-23 10:40:10 +05:30
Raja Subramanian d5cc567140 Log more details of RTP stats snap shots. (#3190)
* Log more details of RTP stats snap shots.

Seeing cases of loss more than 100%. Logging snap shots to understand it
better.

* log message

* use delta to update packets lost from RR

* remove cast
2024-11-21 16:41:03 +05:30
Raja Subramanian a3f2ca56f9 TWCC based congestion control - v0 (#3165)
* file output

* wake under lock

* keep track of RTX bytes separately

* packet group

* Packet group of 50ms

* Minor refactoring

* rate calculator

* send bit rate

* WIP

* comment

* reduce packet infos size

* extended twcc seq num

* fix packet info

* WIP

* queuing delay

* refactor

* config

* callbacks

* fixes

* clean up

* remove debug file, fix rate calculation

* fmt

* fix probes

* format

* notes

* check loss

* tweak detection settings

* 24-bit wrap

* clean up a bit

* limit symbol list to number of packets

* fmt

* clean up

* lost

* fixes

* fmt

* rename

* fixes

* fmt

* use min/max

* hold on early warning of congestion

* make note about need for all optimal allocation on hold release

* estimate trend in congested state

* tweaks

* quantized

* fmt

* TrendDetector generics

* CTR trend

* tweaks

* config

* config

* comments

* clean up

* consistent naming

* pariticpant level setting

* log usage mode

* feedback
2024-11-11 10:24:47 +05:30
Raja Subramanian f3a13569ee Use int64 nanoseconds and reduce conversion in a few places (#3159) 2024-11-06 12:28:30 +05:30
Raja Subramanian d341ee1ce8 Maintain RTT marker for calculations. (#3139)
* Maintain RTT marker for calculations.

Restore the drift logging change.

* remove unnecessary cast
2024-10-25 11:50:59 +05:30
Raja Subramanian 542620b486 Revert "Adjust drift calculations for pass through. (#3129)" (#3138)
This reverts commit 7ab6e5df09.
2024-10-25 11:11:21 +05:30
Raja Subramanian 7ab6e5df09 Adjust drift calculations for pass through. (#3129)
No functional effect, but was logging more than expected drift in the
down stream direction. Reason is that when passing through, we could be
using an older report. But, the adjustment was applied to the monotonic
clock and not the RTP timestamp. So, it looked like more time had
elapsed for the same RTP clock elapsed and logging higher than expected
drift. Correcting it so that the log is not misleading/confusing.
2024-10-23 11:03:43 +05:30
Raja Subramanian d4e3c63406 Seed duplicate packets and bytes. (#3124)
Had missed this before. This could have cause retransmit packets/bytes
to be high.
2024-10-21 23:58:41 +05:30
Raja Subramanian 45b2804df8 Skip divide-by-0. (#3119)
Does not crash, but does a NaN. Avoid that.
2024-10-19 16:21:23 +05:30
Raja Subramanian a66fff1576 Use pointers in unlikely so that values get de-referenced at log time (#3101)
* Use pointers in unlikely so that values get de-referenced at log time
after they have been filled in.

* instantiate logger at log time
2024-10-15 23:45:40 +05:30
Raja Subramanian d052caa104 Use PPS mode rather than max to adjust packet loss weight. (#3095) 2024-10-14 20:16:19 +05:30
Raja Subramanian f154b236b5 Fix down stream packet loss reporting. (#3092)
* Fix down stream packet loss reporting.

* format
2024-10-14 11:08:10 +05:30
Raja Subramanian 5e22582c66 Make a lite version of sender stats to be used in relay down track. (#3069) 2024-10-06 13:01:08 +05:30
Raja Subramanian 2491ee7c7c Make lite version of RTPStatsReceiver called RTPStatsReceiverLite. (#3065)
* Make lite version of RTPStatsReceiver called RTPStatsReceiverLite.

Refactor around that.

Will probably make some more flavors to have lighter versions still.

* update deps

* use MarshalLogArray

* use util
2024-10-05 10:50:25 +05:30
Paul Wells 99f7be7c1c clean up redundant String calls in logs (#3064) 2024-10-03 08:08:46 -07:00
Raja Subramanian 8ac33a868c Splitting out rtp stats stuff into its own package. (#3060)
* Splitting out rtp stats stuff into its own package.

Going to be making some lighter versions of these.
Will be cleaner to have all of these grouped together.
So, as a first step, just making a package for it.

* tests
2024-10-03 15:51:24 +05:30