Reload playlist failling

Hello all,

we are setting up an online another online radio…
Libretime is install via Docker Compose, all details of the install are here : Making sure you're not a bot!

I’m giving my best try to make custom auto-dj fallback, editing ls_script.liq which kind work as expected…

But sometimes, I see liquidsoap playing infinitely the emergency track… an never getting back to the playlist… Even if the reload time is setup to 12h…

I’ve a bash script that populate with new audio files the “day” folder at night, and the “night” folder during the day… But it seems when 2 tracks can’t be loaded in a row by liquidsoap, it fallback on the emergency, and never get out of it….

Is there some sort of playlist.reload possible when it’s on fail? I could find a solution in the doc or the book…

Relevant part of the script is here :

#default = amplify(id="silence_src", 0.00001, noise())

# Safety offair song
emergency = playlist("/app/myradio/offair")

# Day music
day = playlist(reload=43200, reload_mode="seconds", "/app/myradio/music/day")

#Night music
night = playlist(reload=43200, reload_mode="seconds", "/app/myradio/music/night")

# Enable metadata
day = map_metadata(update_metadata, day)
night = map_metadata(update_metadata, night)

rotation = switch([({8h-20h}, day), ({20h-8h}, night)])

# AutoDJ Harbor live source
djharbor = input.harbor("remotedj", port=8003, password="xxxxx")

dj = fallback(track_sensitive = false, [djharbor, rotation])

default = fallback(track_sensitive = false,[dj, emergency])

# Original metadata update
def map_message_offline(m) =
  [("title", m["title"] )]
end

default = map_metadata(id="map_metadata:offline", map_message_offline, default)

thanks !

pierre

hey!

it sounds like a liquidsoap issue and since the libretime’s liquidsoap version is very old, there might not be a way to fix it.

Since this is a new deployment I think you can give the debian 12 upgraded version a try. It hasn’t made it to the official LT github repo but al the patches are available here

cheers,

Thanks @k054 !

I’m a total newbie so I’ve no idea how I could edit my docker setup to use this version you are mentioning… Is that easily doable?
or should I wait for the merges to happen?

The patches were tested on a non-docer installation, and I think making it work on the docker container would need some additional work, so I’s say give it a try but don’t get frustrated if it doesn’t work on the first attempt.

let us know how it goes :slight_smile:

Hello, self-replying, in the end, it seems like the problem is actually the playlist not reloading when intended…

I should probably set the playlist’s reload_mode to “watch”. But I’m afraid it’s a lot of reload happening after each track’s upload. (All the tracks for the day are uploaded daily).

Ideal would be to reload once all files from the folder are uploaded… but i’m not sure how I can achieve that within liquidsoap. I’d like not having to rely on cronjob…

Any thought about that?

what version of liquidsoap are you running?

The docker image of libretime is the latest, V 4.5.0.

I kind of found a smoother way : instead of having pointing playlist() to the folder with audio, I’m now pointing it to a list of all audio files generated by a bash script.
And on my local machine, 40 minutes after picking a new set of files for the day, I set another cronjob to generate this list of files as “playlist.txt”. And everything is still synchronized on the remote vps with syncthing.
This way the files are uploaded and 40 minutes later (my estimated duration of upload of 1.4GB of audio), the playlist.txt is regenerated and uploaded too, which makes libretime reloading the playlist.

Only draw back is those 40 minutes when the files and the playlist.txt doesn’t match… but it doesn’t seems to break the stream so it seems all good for now..

in that case it’s liquidsoap 2.1 (very old)
so what distribution and version are you using? you could use a more recent liquidsoap either from your os repos or using opam

hey thx for your message, I’m using a Docker Image and Debian 13.

But now it seems that the stream is pretty stable so i might not adventure myself in doing customization in the containers… specially since i’m not expert at all.

I’m glad it’s working now :partying_face: but just to clarify I didn’t meant you could/should do anything within the container but that you can install a more recent liquidsoap version either from your repos or using opam in you base system, and stream from there to libretime’s harbor.

cheers