Back to services

Snapcast

Synchronous multiroom audio server.

View alternatives to Snapcast
Suggest edit
Open source
Self-hostable
GPL-3.0
Recent reviews

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

BackendSystem
alsa / pulseLinux
oboe / openslAndroid
coreaudiomacOS
wasapiWindows
sdl2All platforms (e.g. LG webOS TVs)
fileAll 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 at https://<server>:1788 when 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/snapserver and /etc/default/snapclient.
  • The server configuration file is /etc/snapserver.conf. Specify audio sources with source in 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