InternetRadio - customize

,

Vanglesis makes changes including (better) support for playlists, etc. If there is an issue (and there is) then it needs to be recorded and fixed. We can’t guarantee that copying random bits of code between versions will continue to work and not cause other issues.

1 Like

:question:
It is only the inet_radio.py not random bits of code.

But that code has changed, and will change again very soon.

I have pushed some updates to testing (vangelis). This provides these improvements to the radio player:

  • Use VLC as the playback engine to better support streams.
  • Supports aac streams with minimal startup delay.
  • Prev/Next control to step through radio channels and playlists. Short delay before selecting a radio channel to allow navigation through all stations.
  • Option to enable random playback of playlists.
  • Improved display of information.
  • Enabled all tested/working default radio stations

I hope this resolves the issues that people saw with the last update that stopped aac streams working. Please report issues in the tracking system, ideally via webconf Report Issue button.

VLC is a good player but has some odd behaviour that needed working around (which made this a far more time consuming fix). Some of these (for the technically curious) include:

  • Cannot run as root. We run zynthian as root so I had to run sed -i 's/geteuid/getppid/' /usr/bin/vlc to remove this constraint. This is done by the update but we may need to revisit if vlc package is updated.
  • Jack client is restarted for each change of stream. Had to put in code to retrigger zynthian’s audio routing.
  • Jack client auto connects. I used a dummy destination so that it fails this auto connect and zynthian’s audio routing handles this. This may have been easier if it wasn’t a chain which needs flexible output routing. (Frustrating because most users will not add effects.)
  • CLI has odd characters that break most attempts to interface. I used telnet and some clever parsing to get the required behaviour.

Enjoy!

3 Likes

:heart: Thank you! Seems to work very well. Occasionally (two times while testing) I have to stop-start a stream manually after dialing in that preset via prev/next, but never more than once, which is perfectly fine.

I thought I had fixed that with my last commit which adds a background task to connect the audio routing incase it fails, e.g. stream is slow starting. Possibly the stream is very slow - I will have another look. Will you confirm what version of zynthian-ui shows in webconf?

1 Like

vangelis (3228a6c)
Yes, maybe the strream Cafe d M is slow.
Wi-Fi makes also more problems since one of the recent updates (which is a problem of RaspberryPi new brcm firmware and hopefully they fix that soon), maybe that is also a possible cause.

thanks Riban prev/next is really useful

1 Like

Wow, I just found the radio and it is so cool to play along with some random music. Wouldn’t be a spotify client also nice? :grimacing:

I don’t know the current state of art, but I think I used something like spotifyd, ncspot or spotify-tui in the past.

2 Likes

This playlist feature is really useful for practicing, warmup or simply playing along some music.
Thank you for this!

1 Like

Ok :smiley: I’m VERY late to the party, but i did not realize that this wonder-box had streaming radio support :grimacing:

Will try it out immediately (idk if it will retire my squeezebox, but time will tell)

2 Likes

Oh boy, do i feel stupid now :frowning:

How do i enable this?

tl:dr please…

Perhaps this (9.5) Internet Radio section will help?:

Wow - I had that link working before, now after trying to edit the post to add section number it gets a 404 not found! Hopefully you can find section 9.5 Internet Radio which begins:

Zynthian has internet streaming radio with a selection of channels available as a chain from the Audio Generator/Other category.

[Edit - @riban edited post to correct link to user gude.]

2 Likes

I found it in the wiki pages. Thank you

1 Like

Ok, now i feel even more daft :frowning: (very sorry about the upcoming question…):

I’m running Vangelis, updated 2 weeks ago. When using VNC and looking at audio generator/other, i can’t really find any trace of the radio there. I do see this noise generator and one other thing, but no sign of any radio.

Like Sting sang, “its probably me”, but i don’t have any clue what to do about it…?

Try to bold push select. This shows disabled engines, and allows ticking boxes.

Don’t forget Audio Generador also have several categories that you can browse.

Regards

Hello, as newbie I don’t know where to edit the playlist. I thaugt it was in my-data/presets/inet_radio/presets.json, but I ever have the Zynthian playlist. Any cue ?

2 Likes

I found myself the solution :

  1. I’m listening to ‘KISS Classical’ on internet radio,

  2. in a linux consol : cd /zynthian

  3. sudo grep -rl “KISS Classical”

  4. the response : zynthian-ui/zyngine/zynthian_engine_inet_radio.py

  5. The playlist is therev in the pyton file


    Internet Radio Engine Class

    ------------------------------------------------------------------------------

    class zynthian_engine_inet_radio(zynthian_engine):

    default_presets = {
        "Ambient": [
            ["http://relax.stream.publicradio.org/relax.mp3",
             0, "Relax"],
            ["https://peacefulpiano.stream.publicradio.org/peacefulpiano.aac",
             0, "Peaceful Piano", "aac", ""],
    

Another way to do that :

  1. Create file /zynthian/zynthian-my-data/presets/inet_radio/presets.json
  2. { “Classique”: [ [“http://radioclassique.ice.infomaniak.ch/radioclassique-high.mp3”, 0, “Radio Classique”], [“http://icecast.radiofrance.fr/francemusique-midfi.mp3”, 0, “France Musique”] ] }

As explained here :slight_smile:

# ---------------------------------------------------------------------------
# Bank Management
# ---------------------------------------------------------------------------

def get_bank_list(self, processor=None):
    try:
        with open(self.my_data_dir + "/presets/inet_radio/presets.json", "r") as f:
            self.presets = json.load(f)
    except:
        # Preset file missing or corrupt
        self.presets = self.default_presetshttps://discourse.zynthian.org/u/fussl
        """
        # Write default preset file
        json_obj = json.dumps(self.presets, indent=4)
        with open(self.my_data_dir + "/presets/inet_radio/presets.json", "w") as f:
            f.write(json_obj)

The presets of fussl, in Mar 2025 is working very well. Thank you ! https://discourse.zynthian.org/t/internetradio-customize/9501/18?u=fabdecafaret

1 Like