Skip to content

Repository files navigation

beatnik-pi

Turn a Raspberry Pi into a Snapcast server that accepts AirPlay & Spotify Connect streams (from any smartphone and Laptop / PC) and re‑distributes them to any Snapclients you add later. The server itself also runs the first Snapclient, giving you an instant master room.

The Hardware if have choosen here is to power some biger passive Speakers using Amp4 and some smaller passive Speakers using the miniAmp.

NOTE: This is a basic setup to stream music via airplay (1 & 2) and spotify connect. You ca add more streams follwing the snapcast docs here: https://github.com/badaix/snapcast

Architecture

Beatnik Architecture

Software Components

Component Version / Role
Raspberry Pi OS Lite/Debian Bookworm / operating system
Snapserver 0.31.0 / recives and distributes streams
Snapclient 0.31.0 / recives and plays streams
Shairport‑Sync 4.3.x  / handles airplay 1+2
Libresport x.x  / handles spotify connect
Device overlay HiFiBerry Amp4 Pro / hardware driver (swap for your own overlay if needed)
Beatnik Hardware API x.x / soundcard management & hardware control, works together with CamillaDSP
Docker x.x –Containerize & host controller

Hardware Example

Beatnik Pi Server

Part Notes Image
Pi 5 Raspberry Pi OS Lite 64‑bit Bookworm recommended Raspberry Pi 5
HiFiBerry Amp4 Pro Just Plug it on your GPIOs HifiBerry Amp4 Pro
Power Supply Amp4 is powered via DC and the pi via GPIO
3d Printed Custom Case Currently working on cases, check our subbredit r/beatnikAudio to see the progress.

Beantik Pi Client

Part Notes
Pi Zero 2 WH Raspberry Pi OS Lite 64‑bit Bookworm recommended
HifiBerry Mini Amp Just Plug it on your GPIOs
Power Supply Amp is powered via GPIO
3d Printed Custom Case Currently working on cases, check our subbredit r/beatnikAudio to see the progress.

1 · Flash OS & SSH into the Pi

  1. Download Raspberry Pi Imager.

  2. Select Raspberry Pi OS Lite (64‑bit, Bookworm).

  3. In OS customisation:

    • Enable SSH and add your credentials (eg. user: beatnik, pw: changeMe)
    • Hostname: beatnik-server
    • (Optional) enter Wi‑Fi credentials if you plan using Wi-Fi
  4. Flash the card, insert it, boot up the Pi.

SSh into the pi

ssh beatnik@beatnik-server.local
sudo apt update && sudo apt full-upgrade -y

2 · Activate Drivers (HIFI Berry Amp 4 example)

NOTE: If you're using a diffent soundcard (DAC/amp) check the soundcard folder in the docs

Based on hifi berry docs: https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/

sudo nano /boot/firmware/config.txt

Remove the line:

dtparam=audio=on

Add instead:

dtoverlay=hifiberry-amp4pro

Scorll down and find this line:

dtoverlay=vc4-kms-v3d

add "noaudio" and makesure it looks exactly like this:

dtoverlay=vc4-kms-v3d,noaudio

Reboot,

sudo reboot

SSH back in,then verify:

aplay -l   # must list "sndrpihifiberry"

3 · Install Snapcast 0.31

cd /tmp
wget https://github.com/badaix/snapcast/releases/download/v0.31.0/snapserver_0.31.0-1_arm64_bookworm.deb   https://github.com/badaix/snapcast/releases/download/v0.31.0/snapclient_0.31.0-1_arm64_bookworm.deb


sudo apt install ./snapserver_* ./snapclient_* -y

4 Install Streams (at least 1)

4.1 · Install Shairport‑Sync (AirPlay)

sudo apt install shairport-sync -y   # v4.3.x

Keep its systemd service disabled – Snapserver will spawn its own instance.

sudo systemctl disable shairport-sync.service

4.2 . librespot using raspotify (Spotify Connect - expermintal)

I had some issues with installing librespot on debian boowkworm. To install libresport withouht issues we will workaround using raspotify & afteerwards disable it.

Run the installation script:

sudo apt-get -y install curl && curl -sL https://dtcooper.github.io/raspotify/install.sh | sh

Disable raspotify: (snapcast will spawn its own instance)

sudo systemctl disable raspotify
sudo systemctl stop raspotify

5 · Configure Snapserver

sudo nano /etc/snapserver.conf

In the strream section add your streams as follows: (if you have trouble setting up your streams consult the sample snapserver.conf in this repo docs/sample-configs/sample-snapserver.conf)

5.1 Airplay 1 (uses port 5000)

More details here: https://github.com/badaix/snapcast/blob/develop/doc/configuration.md#airplay

[stream]
source = airplay:///usr/bin/shairport-sync?name=AirPlay&devicename=Beatnik-Airplay1&port=5000

5.2 Airplay 2 (uses port 7000)

More details here: https://github.com/badaix/snapcast/blob/develop/doc/configuration.md#airplay

[stream]
source = airplay:///shairport-sync?name=AirPlay2&devicename=Beatnik-Airplay2&port=7000

Find options for device names etc here: https://github.com/badaix/snapcast/blob/develop/doc/configuration.md

5.3 Spotify

[stream]
source = spotify:///librespot?name=Spotify&devicename=Beatnik-Spotify

6 · Point Snapclient at CamillaDSP (via ALSA Loopback)

Audio is processed by CamillaDSP before it reaches your amp (see step 9 & camilla-dsp.md), so Snapclient must send its audio into a virtual ALSA Loopback device instead of directly to your amp's sound card.

sudo usermod -aG audio snapclient   # grant ALSA access

# Create the virtual loopback cable Snapclient -> CamillaDSP
sudo modprobe snd-aloop
echo "snd-aloop" | sudo tee /etc/modules-load.d/snd-aloop.conf > /dev/null

sudo tee /etc/snapclient.conf >/dev/null <<'EOF'
[snapclient]
host         = localhost
sound_device = plughw:Loopback,0,0
# buffer       = 80            # optional client buffer (ms)
EOF

6.1 Find your amp's card number for CamillaDSP

CamillaDSP (not Snapclient) needs to know your amp's real soundcard, since it sits between the Loopback device and the amp. Check for your soundcard number:

 aplay -l 

Should list your soundcard like this:

**** List of PLAYBACK Hardware Devices ****
card 0: vc4hdmi [vc4-hdmi], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: DigiAMP [RPi DigiAMP+], device 0: Raspberry Pi DigiAMP+ HiFi pcm512x-hifi-0 [Raspberry Pi DigiAMP+ HiFi pcm512x-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

In this example our amp is card 1 (DigiAMP). Use that card name/number as the playback device in CamillaDSP's config — continue with camilla-dsp.md to finish wiring CamillaDSP's capture (hw:Loopback,1,0) to this playback device.


7 · Start the services

sudo systemctl enable --now snapserver snapclient

Reboot the pi:

sudo reboot

Check live logs:

journalctl -u snapserver -f 
journalctl -u snapclient -f   # “… Connected to … hw:0,0 …”

8 · Beatnik Controller UI (selhosted)

For more information check the controller repo here: https://github.com/byrdsandbytes/beatnik-controller

Prequesites

Docker & docker compose. If you have trouble setting up docker compose check our guide: DOCKER_INSTALLATION.md

8.1 Install using docker compose

Clone the repo:

git clone https://github.com/byrdsandbytes/beatnik-controller.git
cd beatnik-controller
docker compose up -d

This will build the Docker image and start the application in the background.

8.2 Access the Application

Open your web browser and navigate to http://localhost:8181, http://beatnik-server.local:8181 or http://your-hostname.local:8181. You should now see the Beatnik Controller interface.

8.4 (Optional find the classic snapwebclient UI here)

Open http://beatnik-server.local:1780

  • Streams – should list AirPlay
  • Clients – should list audiopi with live meters & volume

9 · Beatnik Hardware API

The Beatnik Hardware API is a small Node.js service that exposes hardware control & status (e.g. amp status) over HTTP. Full details are in the beatnik-hardware-api repo.

Soundcard management: The Hardware API takes over soundcard management (device selection & output routing) in combination with CamillaDSP (see step 5 & camilla-dsp.md). CamillaDSP handles the audio processing/EQ pipeline, while the Hardware API coordinates which soundcard/output it routes to, so install both together rather than configuring the soundcard manually afterwards.

Prerequisites

  • Node.js 22 — installed automatically via NVM by the setup script below (or manually, see the repo's guide, if you prefer)

9.1 Install (recommended: production setup script)

mkdir -p ~/beatnik-hardware-api
cd ~/beatnik-hardware-api
wget https://raw.githubusercontent.com/byrdsandbytes/beatnik-hardware-api/master/setup.sh
chmod +x setup.sh
./setup.sh

The script downloads the latest release artifact, installs Node.js 22 via NVM (if not already present), installs production dependencies, and installs/starts the beatnik-hardware.service systemd unit.

Prefer building from source instead? See Method 2: Manual Source Installation in the beatnik-hardware-api installation guide.

9.2 Check status

sudo systemctl status beatnik-hardware.service
curl http://localhost:3000/api/hardware/status

10 · Beatnik Bleno Service (optional)

The Beatnik Bleno service exposes Beatnik over Bluetooth Low Energy (BLE) for setup/control. Full details are in the beatnik-bleno repo.

Prerequisites

  • Node.js 22 — installed automatically via NVM by the setup script below (or manually, see the repo's guide, if you prefer)

10.1 Install (recommended: production setup script)

mkdir -p ~/beatnik-bleno
cd ~/beatnik-bleno
wget https://raw.githubusercontent.com/byrdsandbytes/beatnik-bleno/master/setup.sh
chmod +x setup.sh
./setup.sh

The script downloads the latest release artifact, installs Node.js 22 via NVM (if not already present), installs production dependencies, and installs/starts the beatnik-bleno.service systemd unit.

Prefer building from source instead? See Method 2: Manual Source Installation in the beatnik-bleno installation guide.

10.2 Check status

sudo systemctl status beatnik-bleno.service
sudo journalctl -u beatnik-bleno.service -f   # verify Bluetooth advertising and connections

11 · AirPlay test

  • macOS / appple music → AirPlay
  • iPhone / iPad → apple music → AirPlay Snapweb flips to playing and audio starts after ≈ 0.4 s.

12 · Add more rooms

On another Pi (e.g. Pi Zero 2 W + MiniAmp):

12.1 Flash & first boot

Imager settings

OS           : Raspberry Pi OS Lite (32‑bit, Bookworm)
Hostname     : pizero-mini          # must be unique
SSH          : enabled
Wi‑Fi        : your credentials
ssh pi@pizero-mini.local
sudo passwd pi
sudo apt update && sudo apt full-upgrade -y

(Depending on your RAM this could take a while)

12.2 Enable the MiniAmp overlay

sudo nano /boot/firmware/config.txt
# add:
dtoverlay=hifiberry-dac           # MiniAmp overlay

Reboot and confirm aplay -l shows sndrpihifiberry.

12.3 Install Snapclient 0.31

cd /tmp
wget https://github.com/badaix/snapcast/releases/download/v0.31.0/snapclient_0.31.0-1_arm64_bookworm.deb
sudo apt install ./snapclient_* -y

12.4 Create a snapclient config

sudo usermod -aG audio snapclient

sudo tee /etc/snapclient.conf >/dev/null <<'EOF'
[snapclient]
host         = beatnik-server.local   # hostname of beatnik server pi
sound_device = hw:0,0          # card index from `aplay -l`
buffer       = 120             # Wi‑Fi cushion (ms)
EOF

12.5 Enable & start the client

sudo systemctl enable --now snapclient
journalctl -u snapclient -f   # look for “Connected to beatnik-server.local:1704 …”

12.6 Join the group

  1. Open Snapweb → Clients on the main Pi.
  2. Drag pizero-mini onto the default group tile.
  3. Adjust its volume slider — it plays in sync immediately.

Repeat for as many extra Pis as you like. Just give each one a unique hostname and point host = beatnik-server.local (or your server’s IP) in /etc/snapclient.conf.


Happy listening! 🎈

Acknowledgments & Tech Stack

This project utilizes the following open-source software and hardware projects:

A special thanks to the countless community members, bloggers, and forum contributors who have written tutorials and guides explaining these technologies. This project wouldn't exist without that shared knowledge.

Thank you for making Beatnik possible.


About

Open Source Multiroom Audio Streamer based on Raspberry Pi, Snapcast & camillaDSP

Topics

Resources

Stars

474 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages