Subject: Minimal audio for Raspberry Pi 5 and 500 (X11) - CHEAT SHEET

From: Ian Smith <[email-masked]>
Date: Sun, 12 Apr 2026 11:10:03 +0100

Why?  Because the Raspberry Pi 5/500 have no analogue audio, and the
digital (HDMI) outputs are not supported by ALSA's dmix facility, so
with ALSA you can only play one thing at a time, and get annoying error
messages if you attempt otherwise.

How?  Pipewire can handle this on behalf of ALSA; Alpine already has a
desktop solution for this, but there are deprecation warnings
everywhere, so I shall set up here as an openrc service (or two).

This is for Pi5/500 under X11 - the wiki has lots to say about Wayland,
but not my problem ;)  I used the pipewire AND openrc wiki pages, and
stepped over the Wayland stuff.  It uses xfce4-session here, but was
originally tested using FVWM.

--------- apologies for email formatting! -------------------------

1. ENVIRONMENT

$ doas rm -f /etc/xdg/autostart/pipewire.desktop
$ doas rc-update del lightdm
$ doas apk add slim
$ doas rc-update add slim
$ doas reboot

$ cat .xinitrc
#!/bin/sh

xrdb -merge $HOME/.Xresources

$HOME/.profile

if [ -z "$XDG_RUNTIME_DIR" ]
then
    XDG_RUNTIME_DIR="/tmp/$(id -u)-runtime-dir"
    mkdir -pm 0700 "$XDG_RUNTIME_DIR"
    export XDG_RUNTIME_DIR
fi

openrc -U default

xset mouse default
xset s off

exec xfce4-session

2. PACKAGES/CONFIG

$ doas apk add pipewire wireplumber
$ doas apk add pipewire-alsa pipewire-jack pipewire-pulse  # only ALSA
is essential
$ doas apk add pavucontrol xfce4-pulseaudio-plugin  # optional

$ rc-update add -U pipewire default        # sufficient for ALSA
$ rc-update add -U pipewire-pulse default  # only needed for pavucontrol

3. SUCCESS?

$ rc-status -Ua
Runlevel: default
 pipewire                                              [  started
00:25:30 (0) ] pipewire-pulse                                        [
started 00:25:30 (0) ] Runlevel: gui
Dynamic Runlevel: hotplugged
Dynamic Runlevel: needed/wanted
 wireplumber                                           [  started
00:25:30 (0) ] dbus                                                  [
started 00:25:30 (0) ] Dynamic Runlevel: manual

---

From: Ian Smith <[email-masked]>
Date: Tue, 5 May 2026 14:22:40 +0100

The profile line should of course be sourced, not executed!

. $HOME/.profile
 
Also the '#!/bin/sh' should be removed.  While you are at it, the whole
XDG_RUNTIME_DIR stanza should really be moved to .profile, so it is
set up once for _all_ logins.

Pardon me everybody!
--