This documents a working configuration that lets multiple applications share the
sound card via ALSA's dmix plugin, with apulse redirecting
PulseAudio-only apps to that same mixed device. No PulseAudio or PipeWire daemon
is involved.
apt install alsa-utils apulse
Versions in use here: alsa-utils 1.2.14-1, apulse 0.1.13-2+b3.
Sets the default PCM to a plug wrapper around a dmix
slave bound to hw:0,0. plug handles rate/format
conversion so apps that don't natively match 48 kHz / S16_LE still work.
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1024
ipc_perm 0666
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 48000
channels 2
format S16_LE
}
bindings {
0 0
1 1
}
}
ctl.!default {
type hw
card 0
}
ipc_perm 0666 lets multiple users share the dmix segment.ipc_key 1024 is arbitrary but must be consistent across users sharing the mix.hw:0,0 and card 0
(check with aplay -l)./etc/asound.conf instead of ~/.asoundrc.Added to the system-wide zshrc so every zsh user inherits it. This tells
apulse to send output through the dmix-backed default rather than
straight to hw:0,0 (which would block other apps).
export APULSE_PLAYBACK_DEVICE=plug:dmixer
Currently sits at /etc/zsh/zshrc:65.
/etc/bash.bashrc (or
/etc/profile.d/apulse.sh for a shell-agnostic drop-in).
# Native ALSA app — uses dmix automatically via the default PCM
aplay sound.wav
# PulseAudio-only app — wrap with apulse
apulse firefox
apulse some-electron-app
# Confirm card index
aplay -l
# Test the dmix path directly
aplay -D plug:dmixer /usr/share/sounds/alsa/Front_Center.wav
# Confirm env var is exported in a fresh shell
echo $APULSE_PLAYBACK_DEVICE # → plug:dmixer
alsa-utils and apulse.~/.asoundrc (or
/etc/asound.conf system-wide).export APULSE_PLAYBACK_DEVICE=plug:dmixer to
/etc/zsh/zshrc (and/or /etc/bash.bashrc).