default.clock.rate results in wrong period_size for a frequency of 44100 Hz which leads to audio distortion at 44100 Hz and above
- PipeWire version (
pipewire --version
):
pipewire
Compiled with libpipewire 0.3.63
Linked with libpipewire 0.3.63
- Distribution and distribution version (
PRETTY_NAME
from/etc/os-release
):Arch Linux
- Desktop Environment:
sway/wayland
- Kernel version (
uname -r
):6.1.1-arch1-1
Description of Problem:
Inadequate period_size
when using default.clock.rate
How Reproducible:
Steps to Reproduce:
- In
/pipewire/pipewire.conf
set the following undercontext.properties
default.clock.allowed-rates = [ 44100 48000 96000 192000 ]
default.clock.quantum = 512
default.clock.min-quantum = 16
default.clock.max-quantum = 2048
default.clock.quantum-limit = 512
settings.check-quantum = false
settings.check-rate = false
- Restart the pipewire service
- Use
pw-play
to playback a file. You can Download file: https://pomf2.lain.la/f/4wg6xrw3.mp3 and then convert it to wav PCMffmpeg -i 4wg6xrw3.mp3 sample.wav
- During Playback of the sample file, query
hw_params
. Mine was under/proc/asound/DAC51080054/pcm0p/sub0/hw_params
- Write down the results. They were for me as follows:
access: MMAP_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 128
buffer_size: 2048
- In
/pipewire/pipewire.conf
, add a new line undercontext.properties
containing the following:default.clock.rate = 192000
- Restart the pipewire service and start playback.
- My results were:
access: MMAP_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 32
buffer_size: 2048
Actual Results:
period_size
is inadequately adjusted, leaving to severe audio distortion.
For some reason, this issue would cause MPV to crackle, because it for some reason takes only a period_size
of 8
from this.
Expected Results:
period_size
is adequately adjusted, to ensure proper playback.
Other programs are thereby not negatively affected
Additional Info (as attachments):
-
pw-dump > pw-dump.log
:
I need further information which one precisely is required. Of the one working, or the one not working? Playback is working, but distorted, due to faulty calibration. The finding was originally assumed to be caused by MPV, but the difference in period_size
is not normal. Ref: https://github.com/mpv-player/mpv/issues/11055