[New integration] RadioPlayer: web radios from your country on your speakers đź“»

Hello everyone!

I present to you RadioPlayer, an external integration for Gladys (minimum version 5.3.0) that plays web radios on your home speakers: Google Cast (Chromecast, Google Home and Nest, speakers with built-in Chromecast), Sonos and UPnP/DLNA (network amplifiers, TVs, Freebox Player, Kodi…).

What it does:

  • :globe_showing_europe_africa: A catalog specific to your country: top radios, 11 genres, search. It comes from the free Radio Browser directory, without an account or API key.
  • :speaker_high_volume: Each speaker becomes a Gladys music player: « now playing Â» card, music panel to browse and search, volume, mute, next or previous station.
  • :star: Up to 30 favorites and history of the last radios listened to.
  • :bar_chart: 3 widgets: current radio, favorite radios (launch with one gesture), top radios in the country.
  • :clapper_board: Scenes: triggers « radio launched Â», « radio stopped Â» and « speaker unreachable Â»; actions « play a radio Â», « play a favorite Â», « next station Â» and « stop the radio Â». Perfect for a radio alarm clock!
  • :speaking_head: Interface and documentation in French, English, German and Spanish.

Countries covered: France, Belgium, Luxembourg, Switzerland, Germany, Austria, Netherlands, United Kingdom, Ireland, Spain, Portugal, Italy, Canada, United States, Mexico, Argentina, Chile, Colombia, Peru and Australia.

How it works: the speakers are controlled over the local network and it’s the speaker that plays the stream, no sound goes through Gladys. Internet access is required for the catalog and streams.

Installation: from the Gladys integrations catalog. Choose your country, then add your speakers from the Discovery tab.

Code, documentation and issue tracking: GitHub - gboulvin/Gladys-RadioPlayer · GitHub

Tested only with Google Cast (TV) and DNLA (Home cinema).

This integration stands out from Radio Browser (guim31/gladys-radio-browser) which does not allow direct playback of content (@guim31, if you prefer to improve your integration, let me know!)

Hi @GBoulvin, great job, the read on Cast, Sonos and UPnP is exactly what was missing!

Go for it, no need to redo this in Radio Browser: I’ll keep it as is to browse the directory, and I’ll add a link to RadioPlayer in its README for those who want to listen. That way, no duplicates :slight_smile:

Thanks for this integration
I manually added the IPs of my Sonos speakers in the configuration and they are detected as Google Cast :sweat_smile:
Could you look into fixing this please @GBoulvin? :smiling_face:

@GBoulvin That’s one cool, super strong integration. Now I can easily switch if I want to hear something from another country.

Well done

Regards

Tom

Thanks for the feedback!

This has been fixed in version 1.2.1 of RadioPlayer: a manually entered IP address is now recognized as a Sonos when it is one (in principle :wink: ).

To get things back in order:

  1. Update RadioPlayer from Gladys (version 1.2.1).
  2. Delete the devices « Google Cast 192.168.x.x » that were incorrectly created: an integration cannot delete devices itself. Your IPs can remain as they are in the configuration.
  3. In the RadioPlayer configuration, click on « Search for speakers »: your Sonos should appear under the name of their room.
  4. Add them from the Discovery tab.

If a Sonos still doesn’t appear, you can send me the result of the « Search for speakers » button and the integration logs, Claude will see what he can do :smiley:

That’s perfect, thank you :slight_smile:
Do you think it’s possible to add Apple speakers?

I had already tried but basically, it’s not great. Maybe in a specific version? Here’s what Claude replied to me:

No, AirPlay is not supported at all, neither announced nor hidden. I deliberately removed it because it works in the opposite way to the other three protocols.

Difference in operation

  • Google Cast, Sonos and DLNA: RadioPlayer only sends the stream address, and it’s the speaker that downloads and decodes the radio. The container never touches the sound, even for a radio listened to for hours.
  • AirPlay: the speaker does not accept a stream address. The transmitter must itself download the radio, decode it and push the raw sound continuously, at the right pace.

Gladys’ native AirPlay integration confirms this: for a simple voice announcement, it launches ffmpeg to convert the sound to PCM, sends it to the speaker, and cuts off after a maximum of 5 minutes.

What AirPlay would cost in RadioPlayer

  1. Heavier Docker image: ffmpeg would need to be included, adding several tens of MB.
  2. Continuous processor usage: one decode per speaker, for the entire listening duration. This is noticeable on a Raspberry Pi.
  3. Network: AirPlay also exchanges synchronization packets in both directions between the speaker and the transmitter. However, the integration container is behind Gladys’ isolated network, which only allows simple outgoing connections. It is very likely that this will not work, and I cannot verify it without AirPlay hardware.
  4. AirPlay 2: recent HomePods and Apple TVs require encrypted pairing, only known through reverse engineering and fragile from one version to another.

In practice, the lack is limited

Sonos devices compatible with AirPlay 2 are already covered by the Sonos part. Many AirPlay amplifiers and TVs (Denon, Marantz, Yamaha, Samsung, LG…) also support DLNA or have Chromecast built-in, and RadioPlayer finds them through this. The real lack is Apple-only devices: HomePod, HomePod mini and Apple TV.

If you have this kind of device, I can try an experimental AirPlay version (with ffmpeg in the image and sound sent from the container), marked as experimental in the documentation. You would need to test it at your place, because of the network issue in point 3. Let me know if you want me to proceed.

Maybe tell me which model you have to see what we can do?

Thanks :wink:
I have 2 HomePod mini A2374

Well, after a long discussion with Claude, it turns out there is no viable solution to stream to HomePods.

The limitation is the same one that had made us abandon external AirPlay integration: In short, external integrations work in bridge mode and AirPlay needs to be in host mode or have a PTP clock served by the core. It’s another project that is not impossible but requires quite a bit of adaptation/specification.

In short, for now, HomePods will remain silent but it is not impossible that this may change later :wink:

Thanks so much for the research :slight_smile: