Spotify Connect, Raspberry Pi, AirPlay & HomePod - because simple audio setups are boring
Source: Dev.to
My problem
AirPlay drains phone battery fast, but it’s the only option for playing Spotify on HomePod Mini. How can I AirPlay music to HomePod, but not from the phone… and still control it from the phone?
Solution
- Raspberry Pi & Spotify Connect – make the Pi the playing device and control it from the phone via Spotify Connect.
The tricky part is the actual execution: combining several solutions, using Linux named pipes, and ensuring everything works together.
General idea for Raspberry setup
Hardware & OS
Raspberry Pi 5 running the latest Raspbian (Debian 13 “Trixie”).
Goals
- Turn the Pi into a Spotify Connect device.
- Stream audio via AirPlay to the HomePod.
Key components
- Raspotify – provides Spotify Connect.
- Owntone – handles AirPlay.
- Linux named pipes – glue the two services together.
Note: Raspotify requires a Spotify Premium account.
Installing things
First, update the system (optional but recommended):
sudo apt update && sudo apt upgrade -y
Raspotify
Install Raspotify with the official script:
sudo apt-get -y install curl && \
curl -sL https://dtcooper.github.io/raspotify/install.sh | sh
Verify the service:
systemctl status raspotify
The device should now appear in Spotify Connect. Ensure your phone, Pi, and HomePod are on the same network.
Owntone
Add the Owntone repository and install:
wget -q -O - https://raw.githubusercontent.com/owntone/owntone-apt/refs/heads/master/repo/rpi/owntone.gpg \
| sudo gpg --dearmor --output /usr/share/keyrings/owntone-archive-keyring.gpg && \
sudo wget -q -O /etc/apt/sources.list.d/owntone.list \
https://raw.githubusercontent.com/owntone/owntone-apt/refs/heads/master/repo/rpi/owntone-trixie.list && \
sudo apt update && sudo apt install owntone -y
Open the web UI to confirm it’s running (e.g., http://<pi-ip>:3689).
Pipes
Create FIFO pipes for communication between Raspotify and Owntone:
sudo mkdir -p /srv/music && \
sudo mkfifo /srv/music/raspotify-pipe && \
sudo mkfifo /srv/music/raspotify-pipe.metadata
The .metadata pipe is a placeholder to silence Owntone warnings.
Configuration
Raspotify
Edit /etc/raspotify/conf:
sudo nano /etc/raspotify/conf
Set (and uncomment) the following:
LIBRESPOT_BACKEND=pipe
LIBRESPOT_DEVICE=/srv/music/raspotify-pipe
# Optional: change the displayed name
LIBRESPOT_NAME="Raspotify"
Save (Ctrl+X, Y, Enter).
Owntone
In the Owntone web UI, expand the simplified output control panel (bottom‑right). Locate your HomePod (AirPlay speaker) and click its icon to enable it. Adjust the volume here; the final output volume is the product of Owntone’s volume and the Spotify Connect device volume on your phone.
Restart both services to apply changes:
sudo systemctl restart raspotify owntone
Running everything
Open Spotify on your phone, select Raspotify as the Connect device, and enjoy playback through the HomePod.
Reminder: The Pi and your phone must be on the same Wi‑Fi network.
For more on Spotify Connect, see the official support page.
General troubleshooting
View live logs to diagnose issues:
journalctl -u owntone -f # for Owntone
# or
journalctl -u raspotify -f # for Raspotify
Look for error messages that indicate what needs fixing.
Summary
Once the two services are installed, configured, and linked via pipes, the setup is straightforward. Keep an eye on package updates, as steps may evolve over time. If you encounter problems, feel free to comment—happy streaming! 🎵