Broken output (wrong pitch, crackling) when using alsa with type multi
- PipeWire version (
pipewire --version
):
pipewire
Compiled with libpipewire 0.3.84
Linked with libpipewire 0.3.84
- Distribution and distribution version (
PRETTY_NAME
from/etc/os-release
):
Arch Linux
- Desktop Environment:
None
- Kernel version (
uname -r
):
Linux arch643 6.1.62-1-lts #1 SMP PREEMPT_DYNAMIC Thu, 09 Nov 2023 17:21:17 +0000 x86_64 GNU/Linux
Description of Problem:
Using this not uncommon ALSA configuration:
ctl.!default {
type hw
card PCH
}
pcm.!default {
type asym
playback.pcm "loop_and_internal"
capture.pcm "dsnoop:PCH,0"
}
pcm.internal {
type dmix
ipc_key 1024
slave.pcm "hw:PCH,0"
}
pcm.loop {
type dmix
ipc_key 1025
slave.pcm "hw:Loopback,0,0" # Loopback,1 for capture
}
pcm.loop_and_internal {
type plug
slave.pcm mdev
route_policy "duplicate"
}
pcm.mdev {
type multi
slaves.a.pcm pcm.internal
slaves.a.channels 2
slaves.b.pcm pcm.loop
slaves.b.channels 2
bindings.0.slave a
bindings.0.channel 0
bindings.1.slave a
bindings.1.channel 1
bindings.2.slave b
bindings.2.channel 0
bindings.3.slave b
bindings.3.channel 1
}
How Reproducible:
Steps to Reproduce:
- Use the above ALSA configuration, with the
snd-aloop
kernel module loaded, and device names/paths adjusted if needed. - Comment
alsa_monitor.enable()
in wireplumber configuration - Add this audio sink in pipewire configuration:
{ factory = adapter args = { factory.name = api.alsa.pcm.sink node.name = "alsa-dmix-internal" node.description = "PCM Internal" media.class = "Audio/Sink" api.alsa.path = "internal" } }
- Test with
pw-play <file.wav>
(should work without issue) - Change "internal" to "loop_and_internal"
- Test with
pw-play <file.wav>
again (wrong pitch and crackling)
Actual Results:
Audibly-wrong audio output as described above.
Expected Results:
Non audibly-wrong audio output.
Additional Info (as attachments):
-
pw-dump > pw-dump.log
: