FLAC internet radio playback with Chromecast

Hiya all,

I’ve made an automation to playback internet radio, based on an input select, on my Chomecast Ultra. This works great, except FLAC radio stations go quiet after about two seconds of playback, while continuing playing (the progress bar continues on screen). Internet radio using MP3 or AAC streams works fine.

Here’s an example:

service: media_player.play_media
  entity_id: media_player.castmymusic
  media_content_type: music
  media_content_id: http://stream.radioparadise.com/rock-flac

I would accept this as a limitation of the ‘Default Media Receiver’ were it not for the fact that if I open the stream on my pc in VLC, and ‘render’ (cast) it on my Chromecast from there, the stream works fine (also with ‘Default Media Receiver’ as app). In HA the source URL is in that case shown as ‘mylocalpcIP:port/stream’, so the stream is forwarded. Also FLAC is supported by the Chromecast.

Is there a setting to enable FLAC casting to the Default Media Receiver from HA, so it’ll work like VLC?

Here I see mention of FLAC casting, but only about local URLs: Google Cast - Home Assistant

When you make a cast, then you send an URL to the chromecast and that connect to that URL and plays the stream from there. HA is then just a remote to control the Chrmecast.
When you make a render and a cast in VLC, then VLC connects to the stream and then retransmit this stream. VLC might and probably are making changes to the stream, which enables Chromecast to continue playing.

My guess is that the issue is either with your Google Chromecast or Radio Paradise.
Have you checked if you can update the firmware on your Chromecast?

If you want a similar functionality on your HA, then you need to turn your HA into a media server.
Kodi might be a solution or maybe MPD or Mopidy. The possible solutions depends a bit on your setup of HA and the host system.

See if the service “media_extractor.play_media” makes a difference. Also try different types of streams (AAC, MP3), it’s not flac, but if you get robust playback the trade-off may be with it.

Try something like this

- alias: 'Chromecast kitchen: Radio Paradise'
    service: media_extractor.play_media
#    service: media_player.play_media
      #media_content_id: "https://stream.radioparadise.com/mp3-320"
 #     media_content_id: "http://stream.radioparadise.com/aac-320"
      media_content_id: "http://stream.radioparadise.com/flac"
      media_content_type: "music"
      entity_id: media_player.chromecast_kitchen