Anyone who has more than a passing familiarity with Linux audio knows about the pulseaudio daemon, and its long history of causing problems with Linux audio in the name of solving them. What it gave us was per-application volume control, but what it took away was reliability. The good news is that there is now a superior replacement for pulseaudio which also replaces JACK in the bargain, called pipewire.
The exact specifics of pipewire aren't in fact important to this article. What is important is that this document will tell you how to configure Devuan to use pipewire. I figured it out from a number of other guides.
It's worth noting that I probably haven't worked all the problems out yet, but this was enough to get the daemon working and perform testing of basic functionality. TODO: Figure out the pipewire-alsa configuration (supposed to be "cp /usr/share/doc/pipewire/examples/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d" but I haven't found the conf file.) TODO: Test JACK more than just running qjackctl.
Step 1: edit /etc/apt/sources.list and do an apt update
deb http://deb.devuan.org/merged chimaera main contrib non-free
deb http://deb.devuan.org/merged chimaera-updates main contrib non-free
deb http://deb.devuan.org/merged chimaera-security main contrib non-free
deb http://deb.devuan.org/merged chimaera-backports main contrib non-free
Step 2: install pipewire, pipewire-alsa, pipewire-jack, pipewire-pulse, and pipewire-v4l2 The versions of these packages you want are in chimaera-backports, I had to download the debs for these and install them manually with dpkg, along with libspa-0.2-modules and pipewire-bin. I still don't know why that is. Here's what I believe to be an inclusive list of relevant modules (output from aptitude search).
i A jackd2-firewire - JACK Audio Connection Kit (FFADO backend)
i A libpipewire-0.3-0 - libraries for the PipeWire multimedia server
i A libpipewire-0.3-common - libraries for the PipeWire multimedia server - common files
i A libpipewire-0.3-modules - libraries for the PipeWire multimedia server - modules
i A libwireplumber-0.4-0 - Shared libraries for WirePlumber
i A pipewire - audio and video processing engine multimedia server
i pipewire-alsa - PipeWire ALSA plugin
i A pipewire-bin - PipeWire multimedia server - programs
i pipewire-doc - libraries for the PipeWire multimedia server - documentation
i pipewire-jack - PipeWire JACK plugin
i pipewire-pulse - PipeWire PulseAudio daemon
i wireplumber - modular session / policy manager for PipeWire
i A libspa-0.2-modules - libraries for the PipeWire multimedia server Simple Plugin API - modules
There are currently two candidate versions in my combination of repositories. In order to install a specific version of a package, you add =version to the end of the filename when you run apt. The version I had to install to get things working is 0.3.63-1~bpo11+1. This doesn't apply to wireplumber, just all the pipewire stuff, so it looks something like this:
apt install wireplumber pipewire-doc=0.3.63-1~bpo11+1 pipewire-jack=0.3.63-1~bpo11+1 pipewire-pulse=0.3.63-1~bpo11+1
But you might have to specify the version for many more packages.
Step 3: edit /etc/profile or just ~/.profile to include:
# Ensure XDG_RUNTIME_DIR is set
unset XDG_RUNTIME_DIR
export XDG_RUNTIME_DIR=$(mktemp -d /tmp/$(id -u)-runtime-dir.XXX)
Step 4: create /etc/xdg/autostart/pipewire.desktop
[Desktop Entry]
Version=1.0
Name=Pipewire
Comment=Start Pipewire
Exec=/usr/local/libexec/pipewire-launcher
Terminal=false
Type=Application
X-KDE-autostart-phase=1
X-GNOME-Autostart-Phase=Desktop
I gave up on GNOME so I haven't tested that there. You might have to change X-GNOME-Autostart-Phase to something else, if you experience start delays (up to a couple of minutes, yikes.) You also want to remove (or move aside) pulseaudio.desktop from the same directory.
Step 5: Create /usr/local/libexec/pipewire-launcher (and probably mkdir /usr/local/libexec first)
#!/bin/sh
# We need to kill any existing pipewire instance to restore sound
pkill -u "${USER}" -fx /usr/bin/pipewire-pulse 1>/dev/null 2>&1
pkill -u "${USER}" -fx /usr/bin/pipewire-media-session 1>/dev/null 2>&1
pkill -u "${USER}" -fx /usr/bin/wireplumber 1>/dev/null 2>&1
pkill -u "${USER}" -fx /usr/bin/pipewire 1>/dev/null 2>&1
exec /usr/bin/pipewire &
sleep 1
# wait for pipewire to start before attempting to start related daemons
while [ "$(pgrep -f /usr/bin/pipewire)" = "" ]; do
sleep 1
done
[ -f "/usr/share/pipewire/pipewire-pulse.conf" ] && /usr/bin/pipewire-pulse &
if [ -x /usr/bin/wireplumber ]; then
exec /usr/bin/wireplumber &
elif [ -x /usr/bin/pipewire-media-session ]; then
exec /usr/bin/pipewire-media-session &
fi
Make it executable, without this the daemon will not launch. If it dies, you can just run this script any time. (It's been very reliable for me, but it's worth mentioning.)
chmod +x /usr/local/libexec/pipewire-launcher
Step 6: JACK
cp /usr/share/doc/pipewire/examples/ld.so.conf.d/pipewire-jack-*.conf /etc/ld.so.conf.d/
ldconfig
https://ubuntuhandbook.org/index.php/2022/04/pipewire-replace-pulseaudio-ubuntu-2204/
https://wiki.debian.org/PipeWire
https://wiki.gentoo.org/wiki/PipeWire
https://git.alpinelinux.org/aports/tree/community/pipewire/pipewire.desktop
https://wiki.archlinux.org/title/desktop_entries