Alternatives
Tech stack
No tech stack added yet. Sign in to suggest some
Introduction
Snapcast gets its name from Synchronous audio player. It is a multi-room audio solution with a client/server architecture. It is not a standalone player but an extension to existing audio players: the server, Snapserver, captures audio and distributes it to the clients, Snapclient. All clients continuously synchronize their time with the server, so they can play in perfect sync, much like a Sonos-style multi-room audio system. Multiple players can feed audio to the server at the same time, and clients can be grouped so that each group plays the same audio stream. The most common setup is to use it with MPD (Music Player Daemon) or Mopidy.
The project is open source under the GPL-3.0 license. The original repository, badaix/snapcast, has since moved to the snapcast/snapcast organization.
How It Works
- Snapserver reads PCM chunks from a configurable audio source. Each chunk is encoded and stamped with a local timestamp.
- Supported codecs are PCM (lossless, uncompressed), FLAC (lossless compression, the default), Vorbis (lossy), and Opus (lossy, low latency).
- The encoded data is sent to the clients over TCP. Clients continuously synchronize their time with the server. They decode the received data into a buffer, then play it at exactly the right moment according to the server's time, through the system's low-level audio API (such as ALSA).
- When a timing deviation occurs, the client corrects it by dropping or duplicating individual samples to speed up or slow down playback (one sample is about 0.02 ms at 48 kHz). The deviation is generally below 0.2 ms.
Supported Audio Sources
- pipe: reads from a named pipe (e.g.
/tmp/snapfifo) - alsa: captures from an ALSA device, including line-in, microphone, and alsa-loop
- librespot: launches librespot and reads its output (Spotify Connect)
- airplay: launches an AirPlay receiver and reads its output
- file: reads a PCM audio file
- process: launches a process and reads its stdout
- tcp: receives audio from a TCP socket, acting as either a client or a server
- pipewire: captures directly from PipeWire
- jack: receives audio from a Jack server
- meta: reads and mixes other audio sources
Client Audio Backends
| Backend | System |
|---|---|
| alsa / pulse | Linux |
| oboe / opensl | Android |
| coreaudio | macOS |
| wasapi | Windows |
| sdl2 | All platforms (e.g. LG webOS TVs) |
| file | All platforms (outputs to a file or stdout) |
The client also lets you select a sound card, list PCM devices, and resample with --sampleformat.
Control and Ecosystem
- JSON-RPC API: can be controlled over plain TCP, HTTP(S), or WebSocket, including setting volume, muting, renaming clients, assigning audio streams to clients, and managing groups.
- Snapweb: a web app bundled with the server, available at
http://<server>:1780, or athttps://<server>:1788when SSL is enabled. - Snapdroid: the official Android client, available from GitHub Releases and Google Play.
- Third-party integrations: smart home systems such as Home Assistant, Music Assistant, Domoticz, and FHEM; Snap.Net, a Windows tray tool; an ESP32 microcontroller client; snapmixer, a terminal volume control; and web interfaces such as HydraPlay and snapcastr.
Installation and Deployment
- Linux packages (recommended for beginners): packages are available for Debian, OpenWrt, Alpine Linux, Arch Linux, and Void Linux.
- Homebrew (macOS/Linux):
brew install snapcast - Building from source: official build guides are provided for Linux, FreeBSD, macOS, Android, OpenWrt, Buildroot, Raspberry Pi, webOS, and Windows (vcpkg).
Configuration
- Startup options are set in
/etc/default/snapserverand/etc/default/snapclient. - The server configuration file is
/etc/snapserver.conf. Specify audio sources withsourcein the[stream]section, for example:
[stream]
source = pipe:///tmp/snapfifo?name=Radio&sampleformat=48000:16:2&codec=flac
- To test, run
cat /dev/urandom > /tmp/snapfifo. All connected clients should play noise.
Target Users
- Home users and DIY enthusiasts who want to build their own whole-home synchronized audio system
- Hobbyists who turn a Raspberry Pi or old devices into wireless speakers
- Smart home users running systems such as Home Assistant
- Music lovers who already use MPD or Mopidy and want to add multi-room capability
Key Strengths
- High synchronization accuracy, with a typical deviation below 0.2 ms
- Free and open source, not tied to specific hardware, and a viable alternative to commercial solutions like Sonos
- A wide range of audio sources, working with Spotify (librespot), AirPlay, MPD, PipeWire, and more
- Cross-platform, running on everything from OpenWrt routers and ESP32 to Windows
- An open JSON-RPC control interface that makes integration and automation easy
Discover more
LMS
Access your self-hosted music using a web interface.
Audiobookshelf
Audiobook and podcast server. It streams all audio formats, keeps and syncs progress across devices. Comes with open-source apps for Android and iOS.
Gerbera
UPnP Media Server, which allows you to stream your digital media throughout your home network and listen to/watch it on a variety of UPnP compatible devices.
musikcube
Streaming audio server with Linux/macOS/Windows/Android clients.
µStreamer
Lightweight and very quick server to stream MJPEG video from any V4L2 device to the net.
Beets
Music library manager and MusicBrainz tagger (command-line and Web interface).