Snapcast

Snapcast (Synchronous audio player) plays audio streams time sychronized on multiple devices over network using a server and a client component. The server picks up an audio stream from a fifo pipe, thus it can be combined with any audio source that is able to write to a pipe. The Snapserver is able to handle multiple streams at once. The assignment of clients to streams and their volume is controlled via a JSON-API.

Server
The Snapserver can run as its own user:group e.g. snapserver:snapserver (created during emerge).

A sample config that makes snapserver pick up an audio stream from the named pipe /tmp/snapcast looks like this:

To start snapserver now run:

To start snapserver at boot time run:

Client
First get the number of the soundcard snapclient should use for audio output

To start snapclient on soundcard 1 (pulseaudio in this case) from command line run

Within a desktop environment (to make it use the users pulseaudio) we might run snapclient just like this.

To run snapclient as a system service (headless, Raspberry PI, etc.) a basic config looks like this:

To start snapclient now run:

To start snapclient at boot time run:

Audio source
To make some testing noise, random bytes can be shoved into the snapservers pipe

Snapcast can basically be used with anything that is able to write PCM audio to a fifo.

MPlayer example
To make mplayer play something over snapcast use

MPD Example
To hear music with MPD over snapcast create a new audio_output in the mpd.conf using the fifo module

The samplerate setting is the default one used by snapcast. Different samplerates can be used but must be set in the snapserver config file first.

Environment variables

 * VAR1
 * VAR2

Files

 * - Global (system wide) configuration file.
 * - Local (per user) configuration file.

Service
(Provide instructions on starting/stopping and enabling/disabling the software's service. This is only really necessary if it if the software includes a daemon for certain tasks.)

Usage
(Explain how to use the package/software/tool/utility in this section.)

Invocation
(Remove this section if not applicable.)

Troubleshooting
No AVAHI: use -h $host [Err] Exception: BrowseAvahi - Failed to create client: Daemon not running

Issue 1
When X happens, Y is how you fix it.

Removal
(Explain how to properly remove the software. If this section needs more than an 'emerge -C' command each step should be explained in detail so that no trace of the software remains on the system.)

External resources

 * (Link to external resources (outside the Wiki) using bullet points in this section. It is common for the information in this section to full sentences that are links.)