RadioParadise plugin Flac, works only for a while.

Wonderful!! it works perfectly.
I’m still trying.
Thanks again! you are a genious! and very patient …

Maybe a shorter song at the beginning?
Maybe silence and a message in the place of the cover: … downloading block …
Even this message can go between the blocks if it is necessary to wait.

Hello Marco, here is a bug.
I see 3 * .flac in the folder /home/volumio/rp-flac
It is being played in this case on 202615-20218, it ends and the next one does not start.
I look and the playlist is loaded but it does not play.
The metadata is synchronized as the playback started, but it did not start.
I make “mpc play” and start playing. The metadata is desynchronized of course.
Goes Putty capture.flacrp.JPG

And this is exactly the problem I described. There was not enough time to download the next flac file when the last song of the previous started, in your case id 20218. The logs would help a lot but basically this is the only reason why it might fail.

The download speed of the Radio Paradise servers varies extremely. Sometimes it loads with up to 4 MB/sec, sometimes it doesn’t get faster than 200 KB/sec. From what I’ve seen it seems to run smooth late at night and in the morning and not it gets slow in the afternoon and evening.

I have to think about a way to get more time. I could start the download of the next file as soon as the first song of a file starts (not the last one). Give me some time…

:arrow_right: Update: 22.05.2019 23:16 (CEST)

I updated the plugin again. The first song is now “Universal Traveler” by Air. It will only be played as long as the download of the first flac file takes. After the download finished, the playback will automatically switch. This is the best tradeoff I could think of.

The download of the following flac file now already starts as soon as the first song of the previous flac file starts playing. This way there should be more than enough time for the download even if the server is slow.

Please install the plugin from scratch again exactly like described here.
The first wget command will automatically download the updated plugin version (since it’s Dropbox and its versioning system!). The file size has been reduzed to 26,2 MB.

Testing, everything seems to be fine.
Question: how do you know which is the link to the next block flac?

I described how the API works on my github page.

In short:
You call the API for the first time with the base url

https://api.radioparadise.com/api/get_block?bitrate=4&chan=0&info=true

and it returns a json result containing all information about the first flac file to play.

{ "event": "1682118", "end_event": "1682123", "length": "1027.719", "url": "https://apps.radioparadise.com/blocks/chan/0/4/1682118-1682123.flac", "expiration": 1523016067, ...
It also includes an „end_event“ id (1682123 in this example) and you need exactly this id to query the API for the next block to play. See the last url parameter at the end (&event=1682123):

https://api.radioparadise.com/api/get_block?bitrate=4&chan=0&info=true&event=1682123

This call returns all information about the following block and again an „end_event“ id for the one after that. It‘s basically a loop.

Aaaaaah, that I did not know! In fact, with my program I entered the API, but I could never understand the “event”. I had read it in Bill’s original email but I did not understand it.
Thank you! You always learn something.
Last night it worked for two hours without problems.

Yes, I’ve been listening for hours now without problems. Basically the only problem that could happen now is exactly at the beginning, if the first Flac file can’t be downloaded within 4 minutes (which is the length of the Air song that comes pre-bundled). If it get’s past this point, there should not be a problem anymore because now there is plenty of time to pre-download the following file.

I think about integrating the download feature as an option in the plugin settings so that the user can choose whether she/he wants to pre-download the files or not.

If you notice anything strange, keep me informed.

The download time in my case is between 30 sec. and a minute and a half. It is not annoying at all.
Regarding the possible modifications of the type to choose which method to use, it seems to me that you must wait for Bill to define what he is going to do.
The direct download link works very well, if you simultaneously add a file with the metadata, it would be fully functional. (It’s rare that metadata can not be added to flac.)
It may be convenient to do the installer for the plugin, I suppose there are users who do not know how to do it by hand. In this way there will be more users testing.

Over time there is a desynchronization of metadata, it does not affect reproduction.
I thought that changing the block would “reset” but not, it remains out of sync.
I keep trying …

I updated the plugin once again. There is now a switch in the settings of the Plugin where you can choose whether you want to use the Download feature or the normal stream. The default option when installing the plugin is to predownload the tracks. Maybe I’ll change it before committing the release.

Installation instructions stay the same as described here.

Later I try it and I tell you.
Earlier I mentioned that at least using Mellow Mix there is a significant desynchronization in the metadata. As time passes, hours, the shift increases.
There is no way to synchronize every time you start playing a block?

Does it happen on the main channel as well? I have been listening to this for hours and couldn‘t reproduce this.

I will tell you tomorrow…

Bill say:

We’ve sorted out the issues on our FLAC stream encoder, and these URLs should work fine now — bandwidth permitting, of course.

Main Mix: stream.radioparadise.com/flac
Mellow Mix: stream.radioparadise.com/mellow-flac

In this post https://radioparadise.com/community/forum/topic/24857/3847560
I ask Bill for an API to extract the data and he answers:
Yes, we’ll have an API endpoint you can use to record the current playing metadata + the time until the next song starts.

Yes, also with the new version of the plugin, having the previous download option disabled. That is, it desynchronizes in all cases.
The strange thing is that it is not cut using this option. Is there an explanation or Bill modified something?

Very minor issue with the latest update/version.

On entering the Settings page, the On/Off slider for Predownload Tracks doesn’t render correctly. After clicking on it, it then renders correctly.

Cheers.

Hi Marco, Bill say:

That’s now available here: https://api.radioparadise.com/api/now_playing

For alt mixes (currently ‘mellow’, others in the future) add ?chan=1

The ‘time’ value is the time in seconds until the current song ends, to be used to calculate the refresh time.