mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-05 04:06:37 -05:00
The rate matching filter assumes buffer level for cycle j+1 is
buffer(j+1) = buffer(j) + recv(j) - corr(j+1) * duration
but what we are actually doing is instead
buffer(j+1) = buffer(j) + recv(j) - corr(j-1) * duration
because the correction factor that is computed is not used for the next
cycle, but the one following that. Although the filter is still stable
in theory the extra lag causes oscillations to be damped less.
Fix by using the computed correction factor for the next cycle, as
there's no reason why we'd like to have more lag in rate matching.
This then changes c(j-1) -> c(j) in the assumptions, which turns out to
fix the situation. Fix the filter derivation to match. The filter
coefficients stay as they were, and they are actually exactly correct
also for short averaging times.
In practice, it is observed that ISO RX with quantum 4096 converges to
stable rate, whereas previously the matching retained small
oscillations.
|
||
|---|---|---|
| .. | ||
| aec | ||
| alsa | ||
| audioconvert | ||
| audiomixer | ||
| audiotestsrc | ||
| avb | ||
| bluez5 | ||
| control | ||
| ffmpeg | ||
| filter-graph | ||
| jack | ||
| libcamera | ||
| support | ||
| test | ||
| v4l2 | ||
| videoconvert | ||
| videotestsrc | ||
| volume | ||
| vulkan | ||
| meson.build | ||