Format from ALSA PipeWire plugin does not propagate with Loopback device
When using the ALSA Loopback device with ALSA PipeWire plugin, the format does not propagate to the other side. The ALSA playback device is defined as:
pcm.audiosink {
type pipewire
playback_node "alsa_output./sys/devices/platform/snd_aloop.0/sound/card0.analog-mono"
rate 16000
format S16_LE
channels 1
period_bytes 4000
}
The playback_node
defined uses the Loopback device which is hw:0,0,1
.
On the other side arecord is used to capture the stream with the same desired format. If aplay is started first, arecord fails with wrong format (get FLOAT_LE
instead of S16_LE
). But, if arecord is started first and then aplay, the format is correct.
aplay -Daudiosink -fS16_LE -r16000 -c1 /dev/zero
arecord -Dhw:0,1,1 -r16000 -fS16_LE -c1