Audible distortions when pipewire use resampler
Version, Distribution, Desktop Environment: Pipewire 0.3.37, Manjaro, KDE
Description of Problem: Audible distortions during playback of sound when pipewire use resampler
How Reproducible: Play generated tone using e.g SOX with higher rate than set in pipewire config
Steps to Reproduce:
- Default pipewire config (48000) or set "default.clock.rate" and "default.clock.allowed-rates" to 44100
- Play tone using Audacity or SOX e.g.: play -V -r 96000 -n synth sin 4000 vol -10dB
Actual Results: Audible distortions
Expected Results: Clean sound
Additional Info Eg.
pw-dump -N > file (As Attachment Please):
Same results on internal sound card, external usb dac and bluetooth headphones.
When default.clock.rate and default.clock.allowed-rates is set either 44100 or 48000 or both, there is audible distortions when playback of audio file with higher rate (88.2k, 96k, 192k) Set default.clock.allowed-rates = [ 44100,48000,88200,96000,192000 ] results in clean sound without distortions because sounds are play in theirs original rate.
When I resample generated wav file with single tone or sine sweep using spa-resample i get similar audible distortions. e.g sin sweep 20-20k with 96k rate was generated in Audacity and resample to 44.1k with: spa-resample -q 10 -r 44100 When I use spa-resample and convert 384k, 192k and 96k to 48k, conversion is clean and without distortion. They show up when convert to 44.1K. Similarly, resample from 176.2K, 88.2K to 44.1K is clean, distortions show up when they are convert to 48k. Resampling between 48k and 44.1k is always clean in both ways.
When sound is play and there is resampling by pipewire there is also distortions during e.g. 96k to 48k. That is not the case when using spa-resample
This behavior appears also in Pipewire 0.3.35
I attached example spectrograms of wav files before and after conversion 96k to 44.1k using: spa-resample -q 10 -r 44100