audio: add PipeWire+BT audio-bridge, mopidy (Qobuz+local), librespot (Spotify Connect)
- audio-bridge: alpine + pipewire + pipewire-pulse + wireplumber + bluez + dbus + tini Routes audio from librespot/mopidy/phone-BT to USB DAC (Q5K) via ALSA. Privileged + host network for bluetoothd HCI access. - mopidy: built from python:3.12-slim-bookworm + pip (no ghcr.io dep). Qobuz (auth from developer.qobuz.com) + local files. PA bridge to audio-bridge. - librespot: built from rust:1.85.1 on RPi (cross-compile too slow under qemu). Spotify Connect target named 'Klubhaus'. PA bridge to audio-bridge. Both mopidy and librespot build locally to avoid ghcr.io auth/rate-limit issues. PEQ stays on Q5K side (Qudelix app, 20 bands) for source-independent EQ.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# Audio bridge: PipeWire + PulseAudio bridge + BlueZ
|
||||
# Routes audio from librespot / mopidy / phone-Bluetooth to USB DAC (Qudelix 5K)
|
||||
# Cross-built for linux/arm64 on x86_64 build host via buildx + qemu.
|
||||
|
||||
FROM alpine:3.20
|
||||
|
||||
# PipeWire = audio router, handles ALSA sink + bluetooth A2DP sink + PA bridge.
|
||||
# wireplumber = PipeWire session manager (loads bluetooth modules on demand).
|
||||
# bluez = Bluetooth stack (needed for "bluetooth target" — phone → Pi audio).
|
||||
RUN apk add --no-cache \
|
||||
pipewire \
|
||||
pipewire-pulse \
|
||||
wireplumber \
|
||||
bluez \
|
||||
alsa-utils \
|
||||
alsa-plugins-pulse \
|
||||
dbus \
|
||||
tini
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
# D-Bus socket dir for bluetoothd / wireplumber / pipewire
|
||||
VOLUME ["/run/dbus", "/run/user/0"]
|
||||
|
||||
ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
# audio-bridge entrypoint
|
||||
# Starts DBus, BlueZ, WirePlumber, then PipeWire. PA clients (librespot, mopidy)
|
||||
# connect via pipewire-pulse bridge on TCP localhost:4713.
|
||||
|
||||
set -e
|
||||
|
||||
mkdir -p /run/dbus /run/user/0
|
||||
chmod 0755 /run/dbus
|
||||
chmod 0700 /run/user/0
|
||||
|
||||
# System DBus (needed by bluetoothd, wireplumber, pipewire)
|
||||
dbus-daemon --system --fork
|
||||
sleep 0.5
|
||||
|
||||
# BlueZ (Bluetooth stack). --compat = legacy mode for older audio devices.
|
||||
# Disabled if no /dev/bluetooth/rfkill — wireplumber will skip BT modules.
|
||||
if [ -d /sys/class/bluetooth ]; then
|
||||
bluetoothd --compat --nodetach &
|
||||
sleep 0.5
|
||||
echo "[audio-bridge] bluetoothd started"
|
||||
else
|
||||
echo "[audio-bridge] no bluetooth hardware — skipping bluetoothd"
|
||||
fi
|
||||
|
||||
# PipeWire runtime env
|
||||
export XDG_RUNTIME_DIR=/run/user/0
|
||||
export DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
|
||||
|
||||
# WirePlumber first (it manages PipeWire session/policy, loads BT modules)
|
||||
wireplumber &
|
||||
sleep 1
|
||||
|
||||
# PipeWire last. The pipewire-pulse package auto-loads the PA bridge module
|
||||
# so PA clients (librespot, mopidy) can connect via TCP localhost:4713.
|
||||
exec pipewire
|
||||
Reference in New Issue
Block a user