Snapcast client default output device

Does someone know how I can define the default output device for a snapcast client on a pi 4?

If I run snapclient -s 4 everything runs fine. Using snapclient without any args results in no sound at all because the default device is used.

My snapclient config file:

START_SNAPCLIENT=true
SNAPCLIENT_OPTS="-s 4 -h"

Using this config results in this output:

2021-07-14 02-23-40.790 [Info] (Avahi) Service 'Snapcast' of type '_snapcast._tcp' in domain 'local':
2021-07-14 02-23-40.790 [Info] (Avahi) 	raspberrypi.local:1704 (169.254.214.120)
2021-07-14 02-23-40.795 [Info] (Controller) Found server 169.254.214.120:1704
2021-07-14 02-23-40.795 [Info] (Connection) Resolving host IP for: 169.254.214.120
2021-07-14 02-23-40.796 [Info] (Connection) Connecting
2021-07-14 02-23-40.796 [Notice] (Connection) Connected to 169.254.214.120
2021-07-14 02-23-40.796 [Info] (Connection) My MAC: "dc:a6:32:59:ae:76", socket: 8
2021-07-14 02-23-40.977 [Info] (Controller) ServerSettings - buffer: 1000, latency: 0, volume: 100, muted: 0
metadata:{"STREAM":"default"}
2021-07-14 02-23-40.978 [Info] (Controller) Codec: flac, sampleformat: 48000:16:2
2021-07-14 02-23-40.978 [Info] (Player) Player name: alsa, device: default, description: Playback/recording through the PulseAudio sound server, idx: 3, sharing mode: unspecified, parameters: <none>
2021-07-14 02-23-40.978 [Info] (Player) Mixer mode: software, parameters: <none>
2021-07-14 02-23-40.978 [Info] (Player) Sampleformat: 48000:16:2, stream: 48000:16:2
2021-07-14 02-23-40.978 [Info] (Alsa) Using default buffer_time: 80 ms, default fragments: 4
2021-07-14 02-23-40.984 [Info] (Alsa) PCM name: default, sample rate: 48000 Hz, channels: 2, buffer time: 80000 us, periods: 4, period time: 20000 us, period frames: 960
2021-07-14 02-23-40.985 [Info] (Stream) No chunks available
2021-07-14 02-23-40.985 [Info] (Alsa) Failed to get chunk
2021-07-14 02-23-41.004 [Info] (Controller) diff to server [ms]: 0.004
2021-07-14 02-23-45.991 [Notice] (Alsa) No chunk received for 5000ms. Closing ALSA.

Btw does someone know what the cache_exhausted log means?

I’ve got it sorted out by opening an issue on github.

Solution is removing the empty -h flag in the config file:

START_SNAPCLIENT=true
SNAPCLIENT_OPTS="-s 4"

If you run snapclient using the command line the config file isn’t used at all. This is intended by the developers.

So just run sudo systemctl restart snapclient and it should be up and running.

1 Like