Pipewire takes unnecessary step to set card to default.clock.rate when it sets output to it instead of going for desired rate immediately
- PipeWire version (
pipewire --version
): 0.3.52 - Distribution and distribution version (
PRETTY_NAME
from/etc/os-release
): Arch Linux - Desktop Environment: KDE
- Kernel version (
uname -r
): 5.18.5
Description of Problem:
My soundcars are:
- VIA Technologies Inc. VT1720/24 [Envy24PT/HT] (Audiotrak Prodigy Advance HD2)
- card integrated that comes with integrated graphics from i5-4570 I use first card as analog output where I have my headphones connected and second one is connected via HDMI to the monitor that has build-in speakers.
My pipewire configuration is:
default.clock.rate = 44100
default.clock.allowed-rates = [ 32000 44100 48000 88200 96000 176400 192000 ]
This is because most of the time I play things sampled at 44.1 kHz (music). There are no issues with that.
When I play something that has audio sampled at rate different than 44.1 kHz (for example 48 kHz) everything starts correctly (pipewire sets VT1720/24 to 48 kHz). Then I switch audio output to HDMI and then back to VT1720/24. Here pipewire sets card to default.clock.rate
(44.1 Hz here) first and then back to 48 kHz which confuses playing applications (they all handle it differently).
I think that pipeware takes unnecessary step to set card to default.clock.rate
when it sets output to it instead of going for desired rate immediately.
I also observed the same behavior with 48000 set as default.clock.rate
and playing 44100 file. Pipewire sets VT1720/24 card to 48000 first after switching back from HDMI and then to 44100. So the issue doesn't depend on any particular sample rate. It seems connected to default.clock.rate
.
When playing sound is at the same sample rate as default.clock.rate
everything works well. Switching outputs is smooth and everything is played as expected.
How Reproducible:
100%
Steps to Reproduce:
- Play audio file (or video with audio) that has different sample rate than pipewire's default clock rate.
- Switch audio output to another sound card that outputs via HDMI.
- Switch audio output back to main sound card.
Actual Results:
I think that pipewire takes unnecessary step to set card to default.clock.rate
when it sets output to it instead of going for desired rate immediately.
Expected Results:
Pipewire sets desired sample rate immediately when it sets output to a card without intermediate step of setting to default.clock.rate
first.