Depacketizer class converts sequence of network packets into stream of audio frames.
Among other things, it detects and logs late packets. If packet is missing when it's needed, depacketizer inserts zeros instead of it. If that missing packet arrives later when it's not needed anymore, depacketizer prints messages to log and drops packet.
There are two problems with these log messages:
they may be too frequent sometimes
they are not very informative
Solution
Rate-limit messages. Don't report every drop. Instead, report cumulative number of drops periodically. We have core::RateLimiter for this task. You can search code base to see how it is used.
Print additional simple statistics about drops:
dropped packet count during period
processed packed count during period
maximum delay of dropped packet
Delay is the difference of dropped packet timestamp and current depacketizer timestamp, converted to nanoseconds (SampleSpec has a method for it).
Testing
Run roc-recv and roc-send over Wi-Fi. Use loaded or noisy networks and set --sess-latency of roc-recv low enough to observe packet drops.
Problem
Depacketizer class converts sequence of network packets into stream of audio frames.
Among other things, it detects and logs late packets. If packet is missing when it's needed, depacketizer inserts zeros instead of it. If that missing packet arrives later when it's not needed anymore, depacketizer prints messages to log and drops packet.
There are two problems with these log messages:
Solution
Rate-limit messages. Don't report every drop. Instead, report cumulative number of drops periodically. We have core::RateLimiter for this task. You can search code base to see how it is used.
Print additional simple statistics about drops:
Delay is the difference of dropped packet timestamp and current depacketizer timestamp, converted to nanoseconds (SampleSpec has a method for it).
Testing
Run
roc-recv
and roc-send over Wi-Fi. Use loaded or noisy networks and set--sess-latency
ofroc-recv
low enough to observe packet drops.Docs: https://roc-streaming.org/toolkit/docs/tools/command_line_tools.html