{"id":13392951,"url":"https://github.com/badaix/snapcast","last_synced_at":"2025-05-13T21:12:19.839Z","repository":{"id":25281015,"uuid":"28706706","full_name":"badaix/snapcast","owner":"badaix","description":"Synchronous multiroom audio player","archived":false,"fork":false,"pushed_at":"2025-05-06T13:26:51.000Z","size":23622,"stargazers_count":6640,"open_issues_count":101,"forks_count":474,"subscribers_count":137,"default_branch":"develop","last_synced_at":"2025-05-06T14:44:15.022Z","etag":null,"topics":["audio","audio-player","audio-streaming","lms","multiroom-audio","music","sonos","synchronous"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/badaix.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-01-02T07:26:32.000Z","updated_at":"2025-05-06T13:26:58.000Z","dependencies_parsed_at":"2024-01-17T10:14:16.410Z","dependency_job_id":"32e3008f-9469-43b0-bd27-4817c63d8a4c","html_url":"https://github.com/badaix/snapcast","commit_stats":{"total_commits":2718,"total_committers":109,"mean_commits":24.93577981651376,"dds":0.4289919058130979,"last_synced_commit":"a31238a2fbf63c55c57dded9bfbe82e868f48cef"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badaix%2Fsnapcast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badaix%2Fsnapcast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badaix%2Fsnapcast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badaix%2Fsnapcast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badaix","download_url":"https://codeload.github.com/badaix/snapcast/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254029008,"owners_count":22002284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","audio-player","audio-streaming","lms","multiroom-audio","music","sonos","synchronous"],"created_at":"2024-07-30T17:00:39.943Z","updated_at":"2025-05-13T21:12:14.825Z","avatar_url":"https://github.com/badaix.png","language":"C++","funding_links":["https://www.paypal.me/badaix"],"categories":["C++","Install from Source","\u003ca name=\"cpp\"\u003e\u003c/a\u003eC++","Multimedia","Software","Apps"],"sub_categories":["Media Server","Media Servers","Media Streaming - Audio Streaming","Tools"],"readme":"# Snapcast\n\n\u003cpicture\u003e\n \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"doc/Snapcast_800_dark.png\"\u003e\n \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"doc/Snapcast_800.png\"\u003e\n \u003cimg alt=\"Snapcast\" src=\"doc/Snapcast_800.png\"\u003e\n\u003c/picture\u003e\n\n**S**y**n**chronous **a**udio **p**layer\n\n[![CI](https://github.com/badaix/snapcast/actions/workflows/ci.yml/badge.svg)](https://github.com/badaix/snapcast/actions/workflows/ci.yml)\n[![Github Releases](https://img.shields.io/github/release/badaix/snapcast.svg)](https://github.com/badaix/snapcast/releases)\n[![GitHub Downloads](https://img.shields.io/github/downloads/badaix/snapcast/total)](https://github.com/badaix/snapcast/releases)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/badaix)\n\nSnapcast is a multiroom client-server audio player, where all clients are time synchronized with the server to play perfectly synced audio. It's not a standalone player, but an extension that turns your existing audio player into a Sonos-like multiroom solution.  \nAudio is captured by the server and routed to the connected clients. Several players can feed audio to the server in parallel and clients can be grouped to play the same audio stream.  \nOne of the most generic ways to use Snapcast is in conjunction with the music player daemon ([MPD](http://www.musicpd.org/)) or [Mopidy](https://www.mopidy.com/).\n\n![Overview](doc/Overview.png)\n\n## How does it work\n\nThe Snapserver reads PCM chunks from configurable stream sources:\n\n- **Named pipe**, e.g. `/tmp/snapfifo`\n- **ALSA** to capture line-in, microphone, alsa-loop (to capture audio from other players)\n- **TCP**\n- **stdout** of a process\n- Many more\n\nThe chunks are encoded and tagged with the local time. Supported codecs are:\n\n- **PCM** lossless uncompressed\n- **FLAC** lossless compressed [default]\n- **Vorbis** lossy compression\n- **Opus** lossy low-latency compression\n\nThe encoded chunks are sent via a TCP connection to the Snapclients.\nEach client does continuous time synchronization with the server, so that the client is always aware of the local server time.\nEvery received chunk is first decoded and added to the client's chunk-buffer. Knowing the server's time, the chunk is played out using a system dependend low level audio API (e.g. ALSA) at the appropriate time. Time deviations are corrected by playing faster/slower, which is done by removing/duplicating single samples (a sample at 48kHz has a duration of ~0.02ms).\n\nTypically the deviation is below 0.2ms.\n\nFor more information on the binary protocol, please see the [documentation](doc/binary_protocol.md).\n\n## Installation\n\nYou can either install Snapcast from a prebuilt package (recommended for new users), or build and install snapcast from source.\n\n### Install Linux packages (recommended for beginners)\n\nSnapcast packages are available for several Linux distributions:\n\n- [Debian](doc/install.md#debian)\n- [OpenWrt](doc/install.md#openwrt)\n- [Alpine Linux](doc/install.md#alpine-linux)\n- [Archlinux](doc/install.md#archlinux)\n- [Void Linux](doc/install.md#void-linux)\n\n### Install using Homebrew\n\nOn macOS and Linux, snapcast can be installed using [Homebrew](https://brew.sh):\n\n```bash\nbrew install snapcast\n```\n\n### Installation from source\n\nPlease follow this [guide](doc/build.md) to build Snapcast for\n\n- [Linux](doc/build.md#linux-native)\n- [FreeBSD](doc/build.md#freebsd-native)\n- [macOS](doc/build.md#macos-native)\n- [Android](doc/build.md#android-cross-compile)\n- [OpenWrt](doc/build.md#openwrtlede-cross-compile)\n- [Buildroot](doc/build.md#buildroot-cross-compile)\n- [Raspberry Pi](doc/build.md#raspberry-pi-cross-compile)\n- [Windows](doc/build.md#windows-vcpkg)\n\n## Configuration\n\nAfter installation, Snapserver and Snapclient are started with the command line arguments that are configured in `/etc/default/snapserver` and `/etc/default/snapclient`.\nAllowed options are listed in the man pages (`man snapserver`, `man snapclient`) or by invoking the snapserver or snapclient with the `-h` option.\n\n### Server\n\nThe server configuration is done in `/etc/snapserver.conf`. Different audio sources can by configured in the `[stream]` section with a list of `source` options, e.g.:\n\n```ini\n[stream]\nsource = pipe:///tmp/snapfifo?name=Radio\u0026sampleformat=48000:16:2\u0026codec=flac\nsource = file:///home/user/Musik/Some%20wave%20file.wav?name=File\n```\n\nAvailable stream sources are:\n\n- [pipe](doc/configuration.md#pipe): read audio from a named pipe\n- [alsa](doc/configuration.md#alsa): read audio from an alsa device\n- [librespot](doc/configuration.md#librespot): launches librespot and reads audio from stdout\n- [airplay](doc/configuration.md#airplay): launches airplay and read audio from stdout\n- [file](doc/configuration.md#file): read PCM audio from a file\n- [process](doc/configuration.md#process): launches a process and reads audio from stdout\n- [tcp](doc/configuration.md#tcp-server): receives audio from a TCP socket, can act as client or server\n- [meta](doc/configuration.md#meta): read and mix audio from other stream sources\n\n### Client\n\nThe client will use as audio backend the system's low level audio API to have the best possible control and most precise timing to achieve perfectly synced playback.\n\nAvailable audio backends are configured using the `--player` command line parameter:\n\n| Backend   | OS      | Description  | Parameters |\n| --------- | ------- | ------------ | ---------- |\n| alsa      | Linux   | ALSA | `buffer_time=\u003ctotal buffer size [ms]\u003e` (default 80, min 10)\u003cbr\u003e`fragments=\u003cnumber of buffers\u003e` (default 4, min 2) |\n| pulse     | Linux   | PulseAudio | `buffer_time=\u003cbuffer size [ms]\u003e` (default 100, min 10)\u003cbr\u003e`server=\u003cPulseAudio server\u003e` - default not-set: use the default server\u003cbr\u003e`property=\u003ckey\u003e=\u003cvalue\u003e` set PA property, can be used multiple times (default `media.role=music`)  |\n| oboe      | Android | Oboe, using OpenSL ES on Android 4.1 and AAudio on 8.1 | |\n| opensl    | Android | OpenSL ES | |\n| coreaudio | macOS   | Core Audio | |\n| wasapi    | Windows | Windows Audio Session API | |\n| file      | All     | Write audio to file | `filename=\u003cfilename\u003e` (`\u003cfilename\u003e` = `stdout`, `stderr`, `null` or a filename)\u003cbr\u003e`mode=[w\\|a]` (`w`: write (discarding the content), `a`: append (keeping the content) |\n\nParameters are appended to the player name, e.g. `--player alsa:buffer_time=100`. Use `--player \u003cname\u003e:?` to get a list of available options.  \nFor some audio backends you can configure the PCM device using the `-s` or `--soundcard` parameter, the device is chosen by index or name. Available PCM devices can be listed with `-l` or `--list`  \nIf you are running MPD and Shairport-sync into a soundcard that only supports 48000 sample rate, you can use `--sampleformat \u003carg\u003e` and the snapclient will resample the audio from shairport-sync, for example, which is 44100 (i.e.  `--sampleformat 48000:16:*`)\n\n## Test\n\nYou can test your installation by copying random data into the server's fifo file\n\n```shell\ncat /dev/urandom \u003e /tmp/snapfifo\n```\n\nAll connected clients should play random noise now. You might raise the client's volume with \"alsamixer\".\nIt's also possible to let the server play a WAV file. Simply configure a `file` stream in `/etc/snapserver.conf`, and restart the server:\n\n```ini\n[stream]\nsource = file:///home/user/Musik/Some%20wave%20file.wav?name=test\n```\n\nWhen you are using a Raspberry Pi, you might have to change your audio output to the 3.5mm jack:\n\n``` shell\n# The last number is the audio output with 1 being the 3.5 jack, 2 being HDMI and 0 being auto.\namixer cset numid=3 1\n```\n\nTo setup WiFi on a Raspberry Pi, you can follow this [guide](https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md)\n\n## Control\n\nSnapcast can be controlled using a [JSON-RPC API](doc/json_rpc_api/control.md) over plain TCP, HTTP(S), or Websockets:\n\n- Set client's volume\n- Mute clients\n- Rename clients\n- Assign a client to a stream\n- Manage groups\n- ...\n\n### WebApp\n\nThe server is shipped with [Snapweb](https://github.com/badaix/snapweb), this WebApp can be reached under `http://\u003csnapserver host\u003e:1780` or `https://\u003csnapserver host\u003e:1788`, if SSL is enabled (see [HTTPS configuration](doc/configuration.md#https)).\n\n\u003cpicture\u003e\n \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/badaix/snapweb/master/snapweb_dark.png\"\u003e\n \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/badaix/snapweb/master/snapweb_light.png\"\u003e\n \u003cimg alt=\"Snapweb\" src=\"https://raw.githubusercontent.com/badaix/snapweb/master/snapweb_light.png\"\u003e\n\u003c/picture\u003e\n\n### Android client\n\nThere is an Android client [snapdroid](https://github.com/badaix/snapdroid) available in [Releases](https://github.com/badaix/snapdroid/releases/latest) and on [Google Play](https://play.google.com/store/apps/details?id=de.badaix.snapcast)\n\n![Snapcast for Android](doc/snapcast_android_scaled.png)\n\n### Contributions\n\nThere is also an unofficial WebApp from @atoomic [atoomic/snapcast-volume-ui](https://github.com/atoomic/snapcast-volume-ui).\nThis app lists all clients connected to a server and allows you to control individually the volume of each client.\nOnce installed, you can use any mobile device, laptop, desktop, or browser.\n\nThere is also an [unofficial FHEM module](https://forum.fhem.de/index.php/topic,62389.0.html) from @unimatrix27 which integrates a Snapcast controller into the [FHEM](https://fhem.de/fhem.html) home automation system.\n\nThere is a [snapcast component for Home Assistant](https://home-assistant.io/components/media_player.snapcast/) which integrates a Snapcast controller in to the [Home Assistant](https://home-assistant.io/) home automation system and a [snapcast python plugin for Domoticz](https://github.com/akamming/domoticz-snapcast) to integrate a Snapcast controller into the [Domoticz](https://domoticz.com/) home automation system.\n\nFor a web interface in Python, see [snapcastr](https://github.com/xkonni/snapcastr), based on [python-snapcast](https://github.com/happyleavesaoc/python-snapcast). This interface controls client volume and assigns streams to groups.\n\nAnother web interface running on any device is [snapcast-websockets-ui](https://github.com/derglaus/snapcast-websockets-ui), running entirely in the browser, which needs [websockify](https://github.com/novnc/websockify). No configuration needed; features almost all functions; still needs some tuning for the optics.\n\nA web interface called [HydraPlay](https://github.com/mariolukas/HydraPlay) integrates Snapcast and multiple Mopidy instances. It is JavaScript based and uses Angular 7. A Snapcast web socket proxy server is needed to connect Snapcast to HydraPlay over web sockets.\n\nFor Windows, there's [Snap.Net](https://github.com/stijnvdb88/snap.net), a control client and player. It runs in the tray and lets you adjust client volumes with just a few clicks. The player simplifies setting up snapclient to play your music through multiple Windows sound devices simultaneously: pc speakers, hdmi audio, any usb audio devices you may have, etc. Snap.Net also runs on Android, and has limited support for iOS.\n\n## Setup of audio players/server\n\nSnapcast can be used with a number of different audio players and servers, and so it can be integrated into your favorite audio-player solution and make it synced-multiroom capable.\nThe only requirement is that the player's audio can be redirected into the Snapserver's fifo `/tmp/snapfifo`. In the following configuration hints for [MPD](http://www.musicpd.org/) and [Mopidy](https://www.mopidy.com/) are given, which are base of other audio player solutions, like [Volumio](https://volumio.org/) or [RuneAudio](http://www.runeaudio.com/) (both MPD).\n\nThe goal is to build the following chain:\n\n```plain\naudio player software -\u003e snapfifo -\u003e snapserver -\u003e network -\u003e snapclient -\u003e alsa\n```\n\nThis [guide](doc/player_setup.md) shows how to configure different players/audio sources to redirect their audio signal into the Snapserver's fifo:\n\n- [MPD](doc/player_setup.md#mpd)\n- [Mopidy](doc/player_setup.md#mopidy)\n- [FFmpeg](doc/player_setup.md#ffmpeg)\n- [mpv](doc/player_setup.md#mpv)\n- [MPlayer](doc/player_setup.md#mplayer)\n- [Alsa](doc/player_setup.md#alsa)\n- [PulseAudio](doc/player_setup.md#pulseaudio)\n- [AirPlay](doc/player_setup.md#airplay)\n- [Spotify](doc/player_setup.md#spotify)\n- [Process](doc/player_setup.md#process)\n- [Line-in](doc/player_setup.md#line-in)\n- [VLC](doc/player_setup.md#vlc)\n\n## Roadmap\n\nUnordered list of features that should make it into the v1.0\n\n- [X] **Remote control** JSON-RPC API to change client latency, volume, zone,...\n- [X] **Android client** JSON-RPC client and Snapclient\n- [X] **Streams** Support multiple streams\n- [X] **Debian packages** prebuild deb packages\n- [X] **Endian** independent code\n- [X] **OpenWrt** port Snapclient to OpenWrt\n- [X] **Hi-Res audio** support (like 96kHz 24bit)\n- [X] **Groups** support multiple Groups of clients (\"Zones\")\n- [X] **Ports** Snapclient for Windows, Mac OS X,...\n- [ ] **JSON-RPC** Possibility to add, remove, rename streams\n- [ ] **Protocol specification** Snapcast binary streaming protocol, JSON-RPC protocol\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadaix%2Fsnapcast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadaix%2Fsnapcast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadaix%2Fsnapcast/lists"}