Snapcast

Snapcast

Warning

This page uses Playout, which is a legacy app.

Playout can be used with Snapcast to enable multi-room audio in your home. This page describes how to set things up using Linux and ALSA. Playout uses ALSA on Linux so it’s required.

Snapcast Server

Install the Snapcast server on your Linux system. This command is for Ubuntu, see install.md for other systems.

$ apt install snapserver

Check /etc/snapserver.conf for the following line:

source = pipe:///tmp/snapfifo?name=default

This source uses /tmp/snapfifo as the audio pipe where ALSA output will be sent to.

Tip

The source name is default. Change the name to something more meaningful, like TakeoutFM.

Setup ALSA

Next ALSA needs to be changed to redirect audio to the /tmp/snapfifo pipe. Edit or create /etc/asound.conf (may not exist) and add the following. Note this came from player_setup.

pcm.!default {
    type plug
    slave.pcm rate48000Hz
}

pcm.rate48000Hz {
    type rate
    slave {
        pcm writeFile # Direct to the plugin which will write to a file
        format S16_LE
        rate 48000
    }
}

pcm.writeFile {
    type file
    slave.pcm null
    file "/tmp/snapfifo"
    format "raw"
}

Tip

See https://github.com/badaix/snapcast/issues/737 if you have /tmp/snapfifo permission errors.

Run Playout

With this setup Playout audio is sent to the configured pipe which is read by the Snapcast server and sent to Snapcast clients.

$ playout play -q 'bagel radio'

Snapcast Clients

Install the Snapcast client from F-Droid, Google Play and/or the App Store. There’s also an Ubuntu Snapcast client package called snapclient.

$ apt install snapclient