Snapcast Server, Snapcast Client and librespot repository

Done :slight_smile: Works like a charm

1 Like

awesome! Your work has been merged <3 Thanks a lot!

1 Like

Hello,
Thank you very much for great hassio snapcast addon. I have one problem, when trying to use mopidy-Iris web client, which has build in support for snapcast mixer (i.e. allows to control snapcast clients volume). I do use hassio Mopidy addon from here.

If you enable snapcast support in Mopidy it will crash snapcast server with:

2020-04-25 21-04-28 [Notice] (handleAccept) ControlServer::NewConnection: 192.168.1.99
terminate called after throwing an instance of ‘nlohmann::detail::type_error’
what(): [json.exception.type_error.316] invalid UTF-8 byte at index 95: 0xC0
/run.sh: line 43: 224 Aborted (core dumped) /usr/bin/snapserver -c /etc/snapserver.conf
[cmd] /run.sh exited 134
[cont-finish.d] executing container finish scripts…
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

It seem to be linked to json library used in snapcast server: json.exception.type_error.316 · Issue #1195 · nlohmann/json · GitHub

So to me it seems more like mopidy/iris issue, but I can imagine this one will be nightmare to solve - too many developers streams involved. :slight_smile: So first I am trying here - did anyone get into same issue?

Thank you.
Litin

Hi,

I have ended up in a issue with the SnapClient (see the log below) I am running latest and greatest version 0.109.4 (samme issue on 108) on a rpi4 also running the snapcast server and librespot. however I cant seem to figure out how to resolve the error I receive and why my minijack wont work…

using built-in audio digital Stereo (IEC958):

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Start Snapclient…
2020-05-05 10-04-22 [Info] Latency: 0
2020-05-05 10-04-22 [Notice] Connected to 192.168.1.9
2020-05-05 10-04-22 [Info] My MAC: “02:42:ac:1e:21:01”, socket: 5
2020-05-05 10-04-22 [Info] ServerSettings - buffer: 1000, latency: 0, volume: 100, muted: 0
2020-05-05 10-04-22 [Info] Codec: flac
2020-05-05 10-04-22 [Notice] sampleformat: 44100:16:2
metadata:{“STREAM”:“SpotifyConnect”}
ALSA lib dlmisc.c:283:(snd_dlobj_cache_get0) Cannot open shared library /usr/lib/alsa-lib/libasound_module_pcm_pulse.so ((null): Error loading shared library /usr/lib/alsa-lib/libasound_module_pcm_pulse.so: No such file or directory)
2020-05-05 10-04-22 [Err] Controller::onException: Can’t open default PCM device: No such device or address
2020-05-05 10-04-24 [Warn] timeout while waiting for response to: 2, timeout 2000
2020-05-05 10-04-24 [Err] Exception in Controller::worker(): Can’t open default PCM device: No such device or address

With the cleint using the “Default” output:
[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Start Snapclient…
2020-05-05 10-13-35 [Info] Latency: 0
2020-05-05 10-13-35 [Notice] Connected to 192.168.1.9
2020-05-05 10-13-35 [Info] My MAC: “02:42:ac:1e:21:01”, socket: 5
2020-05-05 10-13-35 [Info] ServerSettings - buffer: 1000, latency: 0, volume: 100, muted: 0
2020-05-05 10-13-35 [Info] Codec: flac
2020-05-05 10-13-35 [Notice] sampleformat: 44100:16:2
metadata:{“STREAM”:“SpotifyConnect”}
ALSA lib dlmisc.c:283:(snd_dlobj_cache_get0) Cannot open shared library /usr/lib/alsa-lib/libasound_module_pcm_pulse.so ((null): Error loading shared library /usr/lib/alsa-lib/libasound_module_pcm_pulse.so: No such file or directory)
2020-05-05 10-13-35 [Err] Controller::onException: Can’t open default PCM device: No such device or address
2020-05-05 10-13-37 [Warn] timeout while waiting for response to: 2, timeout 2000
2020-05-05 10-13-37 [Err] Exception in Controller::worker(): Can’t open default PCM device: No such device or address
2020-05-05 10-13-38 [Notice] Connected to 192.168.1.9
2020-05-05 10-13-38 [Info] My MAC: “02:42:ac:1e:21:01”, socket: 5
metadata:{“STREAM”:“SpotifyConnect”}
2020-05-05 10-13-38 [Info] ServerSettings - buffer: 1000, latency: 0, volume: 100, muted: 0
2020-05-05 10-13-38 [Info] Codec: flac
ALSA lib dlmisc.c:283:(snd_dlobj_cache_get0) Cannot open shared library /usr/lib/alsa-lib/libasound_module_pcm_pulse.so ((null): Error loading shared library /usr/lib/alsa-lib/libasound_module_pcm_pulse.so: No such file or directory)
2020-05-05 10-13-38 [Notice] sampleformat: 44100:16:2
2020-05-05 10-13-38 [Err] Controller::onException: Can’t open default PCM device: No such device or address

Anyone knows what I am doing wrong?

I have the same issue and opened a ticket for that:
https://github.com/raph2i/hassio-addons/issues/4
it might be a problem of the supervisor

Yes there must be some/something causing it in the supervisor module: https://community.home-assistant.io/t/audio-not-working-after-installing-hass-io-in-docker/178858/3

Whats the progress on the TTS? Can you share you config?

Could you share your HA config for the webradio? i have added the webradio URI in mopidy and also the location of the sink but no sound.

Alright, got all 3 add-ons built and started on hassio. I set host in configuration.yaml to the ip on the (pi) running the hassio, this is the log from snapcast client:

2020-05-11 15-42-21 [Err] Exception in Controller::worker(): resolve: Host not found (authoritative)
2020-05-11 15-42-21 [Err] Error in socket shutdown: Bad file descriptor

EDIT: I changed my config on snapcast client to

snapclientopts: ‘-h 192.168.3.107’

Now… i’m stuck again,

Start Snapclient…
2020-05-11 17-17-36 [Info] Latency: 0
2020-05-11 17-17-36 [Notice] Connected to 192.168.3.107
2020-05-11 17-17-36 [Info] My MAC: “02:42:ac:1e:21:03”, socket: 5
2020-05-11 17-17-36 [Info] ServerSettings - buffer: 1000, latency: 0, volume: 100, muted: 0
metadata:{“STREAM”:“SpotifyConnect”}
2020-05-11 17-17-36 [Info] Codec: flac
2020-05-11 17-17-36 [Notice] sampleformat: 44100:16:2
ALSA lib dlmisc.c:283:(snd_dlobj_cache_get0) Cannot open shared library /usr/lib/alsa-lib/libasound_module_pcm_pulse.so ((null): Error loading shared library /usr/lib/alsa-lib/libasound_module_pcm_pulse.so: No such file or directory)
2020-05-11 17-17-36 [Err] Controller::onException: Can’t open default PCM device: No such device or address

**EDIT:

Added Mopidy to my setup now the new hold up, I added this to mopidy conf:

  • name: audio/output
    value: >-
    audioresample ! audio/x-raw,rate=44100,channels=2,format=S16LE !
    audioconvert ! wavenc ! filesink location=/share/snapfifo/mopidy

Result:

usage: mopidy [-h] [–version] [-q] [-v] [–save-debug-log] [–config FILES]
[-o OPTIONS]
unrecognized command: !

This is the same issue I just had, still getting unrecognized command (i copied from your setup)

Also getting the ALSA lib error which seems to be an issue with hassio_audio. I tried this Supervisor add-on with no luck. I would really appreciate a fix!

Can someone guide me to install mopidy?
The edge repository tells me that it is not available for my system.

Try this repository on add-on store: https://github.com/kentloving/hassio-addons

Trying to update to Snapcast Server v0.20.0 … shouldn’t rebuild do the trick? Seems like its still pulling the 0.19.0 when I do that.

That is strange but it happened to me as well - even there is newer version of snapcast already available in Alpine edge repos. I solved this by opening bash shell to this docker instance and updating snap packages manually using apk. If someone knows why rebuild is not using latest sources automatically?

Can’t get SnapCast to connect in Mopidy. I can connect from the client and from my mobile device but Mopidy claims my SnapCast server is disconnected…

Still trying to configure the audio sink, but as already mentioned I get the error with the unrecognized command.
I installed the Mopidy version of https://github.com/kentloving/hassio-addons

Unfortunately I’m not able to install the newest version from the edge repository due to hardware incompatibilities…

Any progress on this one?

Is there any luck for me running Hassio on an RPI4? It seems like maybe I’m stuck becuase libspotify and a mopidy, etc. require 32bit and/or amd64? The raplh’s and ken’s don’t seem to work with 2021.09.0 and the edge repository mopidy is not compatible.

This is a bummer because I specifically went from debian with Home Assistant docker to Hass.o based on the multiroom audio blog post on HA and the mopdiy addon…oh well, guess this is part of the process/fun. Really wish there was some focus on getting the community away from Google/Alexa. That seems to be the core of the mission and there aren’t any solutions that aren’t super advanced. Thanks everyone here for trying.

Anyone who might be able to support on solving this issue?
Snapcast currently won’t start, giving the following message in the log:

**"s6-overlay-suexec: fatal: can only run as pid 1"**

I’m using Virtualbox as VM.

Also seen in this github issue:

Someone needs to add to the config.json

"init": false,

I can’t seem to find this file, where should it be located at?