You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This fixes audio quality in a Jitsi meeting using Firefox. It uses a
delay-locked loop (DLL) to tell the resampler what rate it should use.
If the buffer is too full, it tells the resampler to resample to a lower
sample rate for playback, or to consume a higher sample rate for
capture. If the buffer is not full enough, it tells the resampler to do
the opposite. This ensures that buffer fill sizes are kept roughly
constant, resulting in very stable performance even over substantial
periods of time. This also allows using very large capture buffers
(1MiB by default), which ensures that pacat-simple-vchan will not
overrun its buffer unless something is very wrong. Without the DLL,
such large capture buffers could fill up and cause massive latency
spikes.
Because rate-matching adversely affects audio quality and increases
latency, this commit also adds support for driving the PipeWire
processing graph. When this module is driving the graph, no
rate-matching is done. Instead, the DLL is used to adjust the delay
between runs of the processing graph. Since most Qubes OS VMs have no
physical audio hardware connected to them, the only other driver is
likely to be the "dummy" driver that just uses a timer. It is strictly
preferable for this module to drive the graph instead, as this avoids
rate matching and can sometimes avoid resampling.
This was tested with PulseAudio in dom0 by me, and with both PulseAudio
and PipeWire in dom0 by Marek. I also tested a version that does not
drive the graph to ensure that this mode works fine, which it does.
Using PipeWire in the AudioVM might provide a means of reducing overall
system latency, especially since the current code needs rather large
capture and playback buffers (8KiB by default) to smooth out uneven
sample delivery and processing in the AudioVM. In the long term, I hope
to improve Xen’s scheduler to prioritize audio and other hard-realtime
tasks, which will allow the use of smaller buffers.
This also adds two new tunables:
- org.qubes-os.playback.target-buffer-fill (integer) sets the target
fill level of the playback vchan.
- org.qubes-os.record.target-buffer-fill (integer) sets the target
fill level of the recording vchan.
For consistency, org.qubes-os.record-buffer-size and
org.qubes-os.playback-buffer-size have been replaced by
org.qubes-os.record.buffer-size and org.qubes-os.playback.buffer-size,
respectively. As it is believed that nobody but me is using these,
backwards compatibility is not provided, but it is easy to add. The
sample configuration has been updated accordingly.
0 commit comments