Streaming music on Spotify is a passion of mine, but the built-in speakers on my phone and laptop often fail to deliver high-quality sound. Although I typically use a HomePod to enjoy music from my iPhone and iPad, the absence of native Spotify support is a significant drawback, since the device only works with Apple products through AirPlay. Additionally, the HomePod is not listed among Spotify Connect-compatible devices, meaning it won’t connect directly with Android smartphones or computers running Windows or Linux.
Faced with these limitations, I set out to repurpose my HomePod into a Spotify Connect device using a Raspberry Pi single-board computer (SBC). This solution—though non-traditional—relies on outdated packages that specifically work with Raspberry Pi running Debian or Ubuntu. With little hope that Apple will soon partner with Spotify for better integration, I successfully transformed my HomePod into a more versatile Spotify speaker via a Raspberry Pi 4B. Here’s the process I followed.
Using Spotify on an iPhone, iPad, or Mac to stream music to HomePod via AirPlay is cumbersome. I typically access the Control Center to select AirPlay and change the sound output to HomePod, which is far from ideal. There’s the option to ask Siri to play a song through Spotify on my iPhone (running iOS 17.4 or higher), iPad (using iPadOS 17.4 or higher), or Mac (with macOS 10.14 Sonoma or higher), but this approach is fraught with complications due to Siri’s limited integration with third-party apps.
Additionally, using AirPlay for Spotify with the HomePod through third-party apps like AirMusic and AirStreamer on Android or Windows 11 means I constantly have to update those applications. Unfortunately, these solutions fall short of allowing the HomePod to work as a wireless speaker for seamless playback across various devices.
To create a more universal setup, I sought software that would make my HomePod accessible to all devices on my local network. I chose OwnTone—an audio media server compatible with Linux, FreeBSD, and macOS—for its ability to stream to AirPlay devices, Chromecast, Roku, and iTunes. It also supports local music libraries, podcasts, audiobooks, internet radio, and Spotify (with a Spotify Premium subscription).
Next, I introduced SpoCon, a Debian and Ubuntu package designed to transform a HomePod into a Spotify Connect device with a Raspberry Pi acting as a bridge. Both SpoCon and OwnTone are compatible with any SBC that meets the requirements of Debian 12, Ubuntu, or Raspbian. I utilized my Raspberry Pi 4B, which was already running several projects, to install these two servers.
To turn my HomePod into a functioning Spotify Connect device, the first step was to make it discoverable on the local network. I began by installing the SpoCon package on my Raspberry Pi with the Bookworm variant. Operating in a headless environment, I accessed Terminal via SSH for the installation. Working from a root account simplified the downloading and installation of necessary packages.
The installation process began with the following command:
“`bash
sudo apt-get install software-properties-common
“`
Then, I set up the PPA keys for SpoCon:
“`bash
curl -sL https://spocon.github.io/spocon/install.sh | sh
“`
Because Bookworm removed support for certain Java dependencies, I needed to edit the SpoCon package manually. I downloaded the SpoCon .deb package to the /home/pi directory using:
“`bash
sudo apt-get download spocon
“`
I created a temporary folder and unpacked the .deb package:
“`bash
sudo mkdir temp
sudo dpkg-deb -R spocon_1.6.3_arm64.deb temp
“`
Then, I edited the control file to adjust dependency values by appending the necessary Java version:
“`bash
sudo nano ./temp/DEBIAN/control
“`
The new dependency line should read:
“`bash
Depends: libasound2, adduser, openjdk-11-jre | openjdk-8-jre | openjdk-17-jre
“`
I saved the changes and repackaged the updated .deb package with:
“`bash
sudo dpkg-deb -b ./temp spocon_new.deb
“`
Subsequently, I installed the newly packed SpoCon package which automatically fetched additional required dependencies:
“`bash
sudo apt-get install -y ./spocon_new.deb
“`
I then created directories for SpoCon to communicate with the OwnTone server:
“`bash
sudo mkdir /srv/music
sudo mkfifo /srv/music/spotify; mkfifo /srv/music/spotify.metadata
“`
I granted access to the SpoCon user for these folders and modified the SpoCon configuration to ensure proper sharing of Spotify configuration details, making the HomePod appear as a Spotify Connect device:
“`bash
sudo nano /opt/spocon/config.toml
“`
I updated specific values in this configuration to identify the device correctly.
Next, I proceeded to install and configure the OwnTone server for audio streaming. The commands included fetching the OwnTone repository key and its source list compatible with Bookworm, followed by a package update and installation:
“`bash
sudo apt-get update && sudo apt-get install owntone
“`
Once both SpoCon and OwnTone services were restarted, I verified if the HomePod was recognized by accessing the OwnTone server URL on a device attached to the local network.
Lastly, streaming Spotify through the HomePod from any device became simple. However, while using Spotify on an iPhone or iPad concurrently with other devices can lead to connectivity issues, the delay typically settles with frequent use. Unfortunately, a downside of this setup is that the HomePod can be accessed by any Spotify Premium user on the same network, which might disrupt your playlist. To improve security, you can customize the SpoCon configuration file to limit access, ensuring only your account can use the HomePod as a Spotify Connect device.
This setup is straightforward and can be completed in just a few minutes, making it an enjoyable project for music lovers. For those interested, I encourage you to check out creating a custom Spotify recommender using Python or even building a digital jukebox with a Raspberry Pi.Apple