Media_player.play_media very long delay to load radio stream

I made a simple script with below content:

- service: media_player.play_media
    data:
      entity_id: media_player.kitchen
      media_content_id: http://icecast.vrtcdn.be/mnm-high.mp3
      media_content_type: 'music'

The script works but there is a very long delay, almost 1 minute, between the time I start the script and I can hear the streamed audio in my media player.

Any idea why this happens (I suspect some buffering, but 1 minute is very long) and could this be solved?

I have unlimited internet access, it would be an option (but I donā€™t know how to setup), that HA streams the link 24h a day and buffers in advance.

Thanks anyway for any advice!

2 Likes

I have exactly the same problem. My delay is 45 seconds between calling the service and it playing on my Google speaker. The service to terminate the stream takes only 1-2 seconds. I am aware that the speaker can go into a ā€˜sleepā€™ mode but this delay occurs even when repeatedly triggered.
Can anyone provide some guidance on how to fix this issue or a reason behind the delay.

I get this with some streams but not others. I have read that if you request the stream a second time it generally will start playing basically immediately but I havenā€™t bothered to test it myself.

I tried running it in a second time but made no difference. What I have since discovered is the wait time between 2 devices that are both set up in the service are quite different. In the bedroom I have a Lenova Clock Essential device and in the kitchen a standard Google Home Mini. The Lenova fires up within 10-15 seconds whereas the nest is the one taking 45 seconds.

This happens for me, too. Take for instance:

Itā€™s stinks when I try to impress my friends with this functionality, and they can simply say ā€œOK Google, Play KEXP on Living Roomā€, and it happens instantly. :frowning:

1 Like

Any solution to fix that?

Anyone? Bueller?

I have this issue also when trying to stream any radio stations on my Google nest mini vĆ­a radio browser, sometimes it wonā€™t load at all, some others will take almost a minute.

This is still an issue, can someone please confirm that this is being acknowledged by the Devs as an issue?

I donā€™t think itā€™s a HA issue, I think itā€™s on Googleā€™s side.

I donā€™t think itā€™s a Google issue as it only happens with radio, itā€™s instant with everything else?

But this is still the Google device having to link to an internet radio stream URL rather than hitting the Google server to stream music or your in-house device to stream locally.

Anyone found any solutions to this?

I also get a approx 30 second delay from time stream is called to it playing audibly on the Google Home mini speaker.

Iā€™m guessing this is a Google Home issue rather than HA but would be good to know if there are any workarounds/hacks for it to audibly play the stream instantly

Itā€™s the same here and Iā€™m not using Google, but LMS server and media player.
Sometimes the first load stops and when I start again it loads almost immediately.
So I donā€™t think itā€™s Googleā€™s problem.

Pretty sure you want media_content_type: ā€˜audio/mpegā€™ not music to indicate itā€™s a stream.

Otherwise (Iā€™m guessing) it treats it as a file to be downloaded and downloads as much as it can before it starts playing. If it was a non-stream URL (e.g. a link to a mp3) it would download the file very fast and start playing it.

There is an extra: element which has an option:

stream_type string (optional)

Describes the type of media artifact as one of the following: NONE, BUFFERED, LIVE.

That might work as well, but I know at least the first method works fine with my BluOS players.