PulseAudio can automatically adjust sink latency. When this happens, the size of the buffer requested from sink inputs is changed as well.
We should handle these updates:
-
If the buffer size is larger than our target latency, we should increase our target latency, or the playback will break otherwise.
-
If the buffer size is smaller than our target latency and the network latency is small too, we can decrease our target latency.
We should add support for changing target latency dynamically. There are two sources of the target latency updates: we can measure network latency during RTCP and we can get sink latency updates from PulseAudio. Then we should use the maximum latency of these two.
In this issue, we should do the following:
- add support for changing target latency at runtime
- handle PulseAudio latency updates (we likely should implement update_sink_requested_latency callback)
PulseAudio can automatically adjust sink latency. When this happens, the size of the buffer requested from sink inputs is changed as well.
We should handle these updates:
If the buffer size is larger than our target latency, we should increase our target latency, or the playback will break otherwise.
If the buffer size is smaller than our target latency and the network latency is small too, we can decrease our target latency.
We should add support for changing target latency dynamically. There are two sources of the target latency updates: we can measure network latency during RTCP and we can get sink latency updates from PulseAudio. Then we should use the maximum latency of these two.
In this issue, we should do the following: