I’m running Mopidy, Mopidy-http, a custom UI of mine, and Icecast in Docker. Everything works smoothly most of the time but after queuing a bunch of tracks eventually the queuing fails and I see this in the Mopidy logs:
ERROR 2020-04-19 23:32:30,442 [1:MainThread] mopidy.audio.gst,
GStreamer error: Could not connect to server
I tried launching with mopidy -vvvv and using the environment variable GST_DEBUG="3 mopidy -v" but neither of these is resulting in any more diagnostic information. Any idea how I can diagnose why GStreamer is sporadically failing?
Not heard of this before. Just queuing tracks doesn’t involve Gstreamer. You are setting GST_DEBUG to an odd value there, where did you get that from? If I had to guess, I’d say that “could not connect to server” was referring to the icecast server and wasn’t related to actually queuing tracks.
The tracks get queued, but when I see this error I also see totally glitched playback. The track will keep restarting playback every ~5 seconds and no sound ever gets output. It looks like Mopidy is panicking that it’s not actually able to output the stream and decides to just restart the track (over and over). I can upload a gif of Iris’ UI when this happens if you’re curious.
You are setting GST_DEBUG to an odd value there, where did you get that from?
If I had to guess, I’d say that “could not connect to server” was referring to the icecast server and wasn’t related to actually queuing tracks.
I believe it’s caused by a sporadic communication failure between Mopidy and Icecast but I can’t imagine how that’s possible, since both services are docker containers in the same stack.
Mopidy could possibly handle this error case better and not glitch the playback, but also I think it’s not unreasonable that it spazes out and I should just fix the underlying issue with why Mopidy and Icecast occasionally fail to communicate.
Are you sure it’s not just the iris UI that is confused? I don’t think we ever restart the same track on failure, we should be moving to the next track in the tracklist in that situation.
Your gst debug env value does not match what is in the docs. You’ve added quotes.
It would be helpful if you could share your debug log.
Are you sure it’s not just the iris UI that is confused?
I’m definitely not sure what’s going on, but I’m sure this indicates more than Iris going crazy. The Icecast stream itself stops outputting audio (I am confirming by directly opening the stream in a browser window outside my app and outside Iris) and my app, which listens to Mopidy http events, stops receiving playback events. The tracklist never advances when in this state. At least, the websocket never sends an event saying otherwise.
Sure, I agree something in Mopidy has gone wrong. I’m just trying to separate the actual Mopidy behaviour from the multiple other pieces here. I think we need logs to make progress. If you have GST_DEBUG=3 you should have an enormous amount of gstreamer logging and there will hopefully be more info about icecast in there. Finding the relevant lines is a fun task. You can also go more verbose if you need (good luck!).
Yeah definitely need more logs. Sounds good, I’ll try GST_DEBUG=3 and see if that gives me more logs. I’ll also look into getting more verbose logging from Icecast (which is currently not returning any errors)
EDIT: My issue was resolved by downgrading to libshout 2.4.1!
I’m encountering similar errors. Here is the relevant bit obtained with running with GST_DEBUG=3 mopidy -v
DEBUG [MainThread] mopidy.audio.gst Got ERROR bus message: error=GLib.Error('Could not connect to server', 'gst-resource-error-quark', 6) debug='gstshout2.c(620): gst_shout2send_connect (): /GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:abin/GstBin:audio-sink/mopidy+audio+actor+_Outputs:mopidy+audio+actor+_outputs0/GstBin:bin0/GstShout2send:shout2send0:\nshout_open() failed: err=Please retry current operation.'
I’ve used others’ docker containers that did not exhibit this issue. However, I had other problems with them so am trying to create my own. I’ve not yet been able to narrow down the key differences that are leading to this error in my container but not others.
I’m interested in outputting to icecast and snapcast simultaneously. This is my config: