Integrated with OwnTone
Now that you have Icecast and DarkIce capturing your vinyl audio stream, let’s take it further by integrating OwnTone. OwnTone will let you stream your vinyl directly to your Apple HomePods using AirPlay 2, enabling seamless multiroom playback throughout your home.
What is OwnTone?
OwnTone (formerly forked-daapd) is an open-source media server that allows you to stream audio to AirPlay 2-compatible speakers like Apple HomePods. It integrates easily with Icecast streams and provides centralized management of your audio sources.
Installing OwnTone
Step 1: Install Dependencies
On your Raspberry Pi, run:
sudo apt-get install -y \ build-essential git autoconf automake libtool \ libasound2-dev libavahi-client-dev libconfuse-dev \ libsqlite3-dev libcurl4-openssl-dev libmxml-dev \ libavformat-dev libavcodec-dev libavutil-dev libswresample-dev \ libplist-dev libsodium-dev libssl-dev \ libgcrypt20-dev libevent-dev libjson-c-dev \ libprotobuf-c-dev protobuf-c-compiler \ libwebsockets-dev libspdlog-dev \ libunwind-dev libsystemd-dev libnatpmp-dev \ libinotifytools0-dev libunistring-dev \ gettext libiconv-hook-dev autopoint libtool-bin \ gperf flex bison libxml2-dev libavfilter-dev \ cmake pkg-config libasound2-dev \ libssl-dev libdbus-1-dev \ libpulse-dev libavahi-client-dev \ libudev-dev git gcc build-essential \ llvm-dev libclang-dev clang curl echo 'export LIBCLANG_PATH=/usr/lib/llvm-14/lib' >> ~/.profile source ~/.profile
Step 2: Install Rust and Build Librespot
Use default options when asked.
curl https://sh.rustup.rs -sSf | sh source $HOME/.cargo/env git clone https://github.com/librespot-org/librespot.git cd librespot cargo build --release
Step 3: Clone and Compile OwnTone
Clone the OwnTone repository:
cd ~ git clone https://github.com/owntone/owntone-server.git cd owntone-server autoreconf -i ./configure \ --enable-websockets \ --with-alsa \ --enable-mpd \ --enable-spotify \ --enable-airplay-2 make -j$(nproc)
Step 4: Create OwnTone User and Directories
Create the required user and directories:
sudo useradd -r owntone sudo usermod -aG audio owntone sudo mkdir -p /srv/music sudo chown owntone:audio /srv/music sudo mkdir -p /usr/local/var/cache/owntone sudo mkdir -p /usr/local/var/log/owntone sudo chown -R owntone:audio /usr/local/var/cache/owntone /usr/local/var/log/owntone sudo mkdir -p /var/lib/owntone /var/log/owntone sudo chown -R owntone:audio /var/lib/owntone /var/log/owntone
Configure OwnTone
Edit the OwnTone configuration file:
sudo mkdir -p /usr/local/etc/owntone sudo cp owntone.conf /usr/local/etc/owntone/ sudo nano /usr/local/etc/owntone/owntone.conf
Adjust the following configurations:
general { uid = "owntone" logfile = "/var/log/owntone.log" db_path = "/var/lib/owntone/songs3.db" } library { directories = { "/srv/music" } } audio { nickname = "VinylStreamer" output_device = "alsa" mixer_device = "default" } airplay { enabled = true }
Set Up OwnTone as a Service
Create a systemd service file:
sudo nano /etc/systemd/system/owntone.service
Add:
[Unit] Description=DAAP/DACP (iTunes), RSP and MPD server, supports AirPlay and Remote Requires=network.target local-fs.target avahi-daemon.socket After=network-online.target sound.target remote-fs.target pulseaudio.service [Service] ExecStart=/usr/local/sbin/owntone -f MemoryMax=256M MemorySwapMax=32M Restart=on-failure RestartSec=5 StartLimitBurst=10 StartLimitInterval=600 [Install] WantedBy=multi-user.target
Enable and start the service:
sudo systemctl daemon-reload sudo systemctl start owntone sudo systemctl enable owntone
Connect Your Vinyl Stream to OwnTone
To integrate your Icecast vinyl stream with OwnTone:
- Open OwnTone web interface at
http://raspberrypi.local:3689
. - Add your Icecast stream URL (
http://127.0.0.1:8000/vinyl.mp3
) as a new internet stream. - Select Apple HomePods or other AirPlay 2 devices as output speakers.
Enjoy Multiroom Vinyl Playback
Now, vinyl playback to your Apple HomePods should be seamless. Easily control playback from your devices or through OwnTone’s web interface.
Troubleshooting Tips
- Confirm OwnTone and Icecast are both running.
- Check OwnTone logs (
/var/log/owntone.log
) for detailed debugging. - Verify AirPlay 2 speakers are on the same network.
- Owntone defaults to Airplay 1 to setup speakers to use Airplay 2 you will have to configure them in owntone.conf
What’s Next?
With your OwnTone server operational, the core of your vinyl streaming setup is complete. Next, we’ll focus on security and best practices to protect your Raspberry Pi system.
Next post: April 11, 2024, Securing and Hardening your Raspberry Pi.
2 thoughts on “Multiroom Playback & AirPlay 2”