Pulseaudio tunneling + zeroconf publishing causing very garbled audio with some outputs
If you are filing this issue with a regular release please try master as it might already be fixed.
Well its pretty close ;)
Version, Distribution, Desktop Environment:
Version 0.3.31 + the timerfd fixes from master, running on buildroot-git on a Raspberry Pi 4B. No desktop environment. Used by pulseadio (14.2) clients over the network. The buildroot is fully systemd, systemd-udev, systemd-logind and dbus enabled.
Description of Problem:
When using a HiFiBerry Digi+ SPDIF output hat on the Raspberry Pi and pulseaudio tunneling over the network with zeroconf publishing, audio comes out all garbled like the audio level is set way too high. Other outputs on the same Raspberry Pi works fine (usb-audio outputs).
The output works fine if used locally, say from mpg123 either via pipewire-pulse or directly to the device using direct alsa output. It only goes haywire with tunneling.
Looking at the zeroconf announcements, this output is advertised with a sample format of s24-32le while the working ones use s32le.
Setting up the tunnel manually using pactl on the client setting the format to s32le, instead of using zeroconf fixes the audio garbling.
So this seems to be a sample format mismatch of some kind. Should the sample format of the device be used on pulse tunnels?
This might also be a problem for other S24_LE devices but I have none others to test.
How Reproducible:
Always
Steps to Reproduce:
- Server (RPI): Enable network access in pipewire-pulse.conf
- Server (RPI): pactl load-module module-zeroconf-publish port=4713
- Client: Enable zeroconf discovery on a pulseaudio client
- Client: Select RPI digi+ output on client
- Client: Play some audio
Beware that out of the box pipewire on buildroot is a bit outdated and not really set up for audio or even user sessions. If someone needs to repro its probably easier to just use some other distro.
Actual Results:
Even the calmest music sounds like something Aphex Twin could have released.
Expected Results:
Good sounding audio.
pw-dump -N > file
(As Attachment Please):
Additional Info Eg. $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_digi], device 0: HifiBerry Digi HiFi wm8804-spdif-0 [HifiBerry Digi HiFi wm8804-spdif-0]
Subdevices: 0/1
Subdevice #0: subdevice #0