hamishfagg / dockerfiles

42 stars 31 forks source link

Mopidy unable to stream to Snapcast server #38

Open Graimalkin opened 1 year ago

Graimalkin commented 1 year ago

Hello there! I'm running your Mopidy Multiroom setup.

First off - thank you for this.

I was running into an issue with Mopidy -> Snapserver streaming local files on the :latest tags of the setup. Specifically:

ERROR    2023-06-30 17:45:11,589 [1:MainThread] mopidy.audio.gst
  GStreamer error: Error while sending data to "snapserver:4953".
ERROR    2023-06-30 17:45:13,787 [1:MainThread] mopidy.audio.gst
  GStreamer error: Could not open resource for reading.
WARNING  2023-06-30 17:45:13,787 [1:Audio-2] mopidy.audio.actor
  Setting GStreamer state to GST_STATE_PAUSED failed

A fair bit of sleuthing later, and I found the culprit. On ivdata/snapserver:latest the /etc/snapserver.conf file is being created automatically with this content:

/ # cat /etc/snapserver.conf 
[stream]
stream = spotify:///librespot?name=Spotify&devicename=DebugSpotify&bitrate=320

[http]
doc_root = /usr/share/snapserver/snapweb

That's ... not right.

The correct content should be the same as this:

[stream]
stream = tcp://0.0.0.0?name=Snapserver

[http]
doc_root = /usr/share/snapserver/snapweb

I didn't dig into why that file's being generated that way. Instead, I opted for the quick and dirty "pass the config file in via docker-compose" as seen here:

image

g13092 commented 1 year ago

good hint! I've had trouble for quite a few weeks, but never dug in. When looking at snapservers, iris kept telling me Spotify, even though I've never configured Spotify. This hack gets me by. cheers!