Instant playback of MP3 radio streams vs. hiccup start

When triggering playback of an MP3 radio stream in Mopidy, it takes 3-4 seconds before anything happens. Than I hear like a single second of the program followed by another 5-6 seconds of silence before I finally hear the continuous stream.

The same stream URL opened however in the web browser plays almost instantly.

I assume Mopidy’s behaviour is caused by some buffering mechanisms, question however is if and how I can optimize my settings to get instant, interrupted playback!?

I am quite sure that you could never reach “instant playback” from a radio stream, for many reasons. Mainly, because it is not a matter of intercepting an analog radio signal from the antenna and convey it to the detector circuits. You need time for:

  • resolve DNS on the network
  • start buffering the stream
  • decode from digital to analog

If you have a DAB radio on your car, you will notice 5-6 seconds of delay before listening to audio: add to these seconds the DNS resolution time and you’ll have (more or less) the same time required by an internet stream to play.

I’ve no idea about DAB but yes the latency is due to our buffering. We do not currently expose any buffer settings. To be honest it’s a support nightmare doing so and I’m not hugely interested. We are thinking of exposing a “live” mode setting which will disable buffering for all “streams” but it has the unavoidable drawback that you can no longer seek. That generally isn’t an issue most of the time, until it is. The other drawback is that if you are connected to the Internet via a wet piece of string you will hear that. I’m on the fence at the moment about what to do… The more settings like this you expose, the more ways there are break things…