badaix / snapcast

Synchronous multiroom audio player
GNU General Public License v3.0
6k stars 447 forks source link

Snapclient + ALSA: No chunks available / failed to get chunks #1064

Closed bradley-rose closed 1 year ago

bradley-rose commented 1 year ago

Describe the bug

Snapclient v0.26 will not work on any clients. Snapweb will play audio just fine.

I have two devices acting as "clients":

  1. The same Raspberry Pi device acting as my server. I have a DAC attached as a hat, and this is the target output device for Snapclient.
  2. An Arch Linux PC. This device only has Snapclient installed from AUR.

Snapweb is playing the content perfectly fine. I have confirmed that Snapserver is operating correctly.

Snapclient logging

(Stream) No chunks available (Alsa) Failed to get chunk (Controller) diff to server [ms]: 0 (Alsa) No chunk received for 5000ms. Closing ALSA.

These errors occur on the local host (127.0.0.1), as well as a remote host within the same subnet, no routed boundary or firewall in between.

Snapcast Configuration Files

Snapserver

/etc/snapserver.conf file:

[http]
enabled = true
bind_to_address = 0.0.0.0
port = 1780
doc_root = /usr/share/snapserver/snapweb

[stream]
source = pipe:///tmp/snapfifo?name=default
source = spotify:///librespot?name=Spotify&bitrate=320&devicename=MultiRoom

[audio]
output = audioresample ! audio/x-raw,rate=44100,channels=2,format=S32LE ! audioconvert ! wavenc ! filesink location=/tmp/snapfifo

Snapclient

/etc/default/snapclient file

START_SNAPCLIENT=true
SNAPCLIENT_OPTS="--host 127.0.0.1"

Steps to Reproduce

  1. Install Snapclient
  2. Point Snapclient to the Snapserver host
  3. Execute Snapclient, either via the CLI (sudo snapclient) or via the system daemon (sudo systemctl start snapclient)

Environment Details

bradley-rose commented 1 year ago

Figured it out. I just had some incorrect inputs in the Snapserver configuration file from a previous implementation I had.

snapserver.conf contents:

[http]
enabled = true
bind_to_address = 0.0.0.0
port = 1780
doc_root = /usr/share/snapserver/snapweb

[stream]
source = airplay:///shairport-sync?name=Airplay&devicename=Multiroom
source = spotify:///librespot?name=Spotify&bitrate=320&devicename=Multiroom

sampleformat = 44100:16:2

codec = flac

All Snapclient hosts are connecting seamlessly now, no issues whatsoever.