Restart web radio on internet restore?

Hey all. Is there any way to force Volumio to better handle internet stream restarting after internet goes out? My internet service blips out occasionally and the web radio never restarts. It just keeps thinking it’s playing. So annoying to have to keep stopping and starting it.
Does it both with V2 and V3

Thanks!!

Hi @Inssomniak
I have exactly the same problem. It’s very frustrating!
I have solved the problem (only partially), by running this code:

It works “alot” of the time - but it’s not working well.

Does anyone else have any other ideas of how to make streaming services more robust?

For both webradio, and RadioParadise, if there is any internet dropout, the stream stops, and the song timer counter just keeps going forever, the stream is broken.
To get it back, you have to click on the webGUI and restart the stream, at which point it will work again until the next “blip”.

For clarity - if you click the “Pause” button , and “Play” it doesnt recover. You have to go in and Play the stream again from source.

It’s basically unusable.

I have tried the Radiodawg and it is better for sure.
This seems silly though, such basic functionality should just work.

Yes, agreed, it should recover itself. Even my cheap $20 internet radio from the discount store is able to handle dropouts.
I found other entries in log file mpd.log - which shows fairly frequent:

> player: Decoder is too slow; playing silence to avoid xrun

I don’t know if this is also contributing. What I’m finding is that the music stops completely, yet the GUI still thinks the music is playing. There is no way of knowing from the GUI if it’s playing or not.

So, I found another script to detect this message in the mpd.log, and restart things if this message appears.

But, similar to the radiodawg script, it’s not reliable.

As someone who has paid for the Volumio Superstar subscription, it’s very very annoying.

I agree that it would be annoying to have this behaviour, but I doubt that correcting it is as simple as you imagine from the Volumio side of things. Could you do anything to improve your internet connection? For example, if you are using wifi, your LAN will probably have weak signal areas. You can improve the situation with extenders or using a usb wifi dongle on your device. A wired connection would be best of course, and then internet dropouts are at the door of your service provider.

P.S. Your Volumio Superstar subscription benefits do not cover internet provision … you can check out what you are paying for here Volumio Plans and Pricing · Volumio if you are unsure.

Hi @chsims1 - No question it’s an ISP issue. We are on a LTE connection, it’s the only thing available in the area. e.g. With our Amazon Echo device, we never have problems. I’m a network professional, so it’s not a local issue. We are optimised as best as we can.
My comment around the Volumio plans etc was more a comment that I had hoped that part of my subscription would go towards the improvement of the codebase, to improve areas such as this. I am aware that it doesn’t cover internet provision.
Our general observation is that other commercial streaming solutions can cater for poor internet. e.g. I can listen to Spotify (not the offline version) while driving in my car, and despite short dropouts of the internet signal, the show goes on without having to stop and restart the app manually. Of course, Spotify have much more $$ to invest in the codebase, but I think that internet music streaming is at a maturity level that this issue should be “well known” and whatever code required should not be out of reach of the developers.
We have pointed to two snippets of code here in this article and hopefully some developers with more knowledge of how Volumio works can take these and it may lead in the right direction to an improvement.
Thanks :grinning: :grinning:

You can prob. already make better improvements by replacing
DNS_TO_QUERY = “8.8.8.8”
DNS_TO_QUERY = the FQDN of the streaming URL.

Psuedo:

import urllib
url = 'http://radiostream

code = urllib.urlopen(url).getcode()
#if code == 2xx or 3xx:  
 if str(code).startswith('2') or str(code).startswith('3') :
    print 'Stream is working'
else:
    print 'Stream is dead'

Would there be a way of better determining if a stream is “actually” playing.? I’ve been testing this the past few days, and I have not had any internet dropout. I have a volumio rPI set up in my garage, playing 24x7 webradio and/or Radio Paradise. I will occasionally go down there and check to see if the audio is playing. I also am monitoring it very frequently from my office on the other side of the house using the web-browser interface. However, sometimes I come into the garage, and the music is not playing - but the web-browser thinks it is. In this case, I have to change the webradio station to something else, then change it back, and it comes on immediately. What sort of “test” could be done to see if the stream is actually… streaming… ?? Strangely, clicking “stop” on the GUI and then Play does not start the stream again. I have to change the station to something else.

those streams we can start but not stop…