Closed wezo3 closed 2 years ago
Thanks for this detailed bug report. Will have a look shortly
I have the same issue on https://github.com/savonet/liquidsoap/discussions/2439
The problem is that the map.metadata running before icecast/shoutcast connection then not send the first current song, only the first. Maybe if put a condition that sleep the map.metadata some seconds on first run or wait the streaming connection before running.
Thanks for reporting this issue. I believe that it should be fixed now. We will proceed with a release of a 2.0.7
bugfix release and the first 2.1.0
release very shortly. Both releases should include the fix.
@toots Thank you for the fix and your response but half of issue fixed only its fixed for Liquidsoap restart or start but if we restart icecast or shourcast server without restart Liquidsoap process, the issue still not fixed must wait to start second track
I think this is because Liquidsoap send metadata one time only when start track so when restart icecast process not send metadata again to output until Liquidsoap prepare next track to start to collect and send new metadata again can you set option or auto send metadata every few seconds with encoding output ? so when stop and restart icecast service the metadata send again instead of wait to second track
Regards
Hi,
This can be implemented in your script. I would do something like that:
last_metadata = ref([])
source = ...
source = source.on_metadata(source, fun (m) -> last_metadata := m)
source = insert_metadata(source)
insert_metadata = source.insert_metadata
icecast_error = ref(false)
def on_error(_) =
icecast_error := true
3.
end
def on_connect() =
if !icecast_error then
if !last_metadata <> [] then
insert_metadata(!last_metadata)
end
icecast_error := false
end
end
output.icecast(on_error=on_error, on_connect=on_connect, ..., source)
This should re-inject the latest metadata each time your output.icecast is reconnecting after encountering an error.
(code not tested!)
@toots Thank you, excuse me I'm not aware good with this code so when I use it appear Error 2: Parse error
can please help to put example for my code to success add auto insert metadata ?
this is my code :
input = single("/root/media/raj3en_ya_hawa.mp3")
output.icecast( %mp3.cbr(stereo=true,stereo_mode="default",samplerate=44100,bitrate=320,id3v2=true),
name="auto dj",
public=true,
description="test 11",
url="domain.com",
mount="stream",
host="127.0.0.1",
port=8000,
password="passwordhere111",
genre="music1",
fallible=true, input)
Sorry to bother you and thank you Regards
can you please help with this @toots about your code appear error
if !last_metadata <> [] then
Error 2: Parse error
can you please show hint in my code above ? Thanks
Describe the bug I see when start liquidsoap process from beginning metadata not sent to icecast or shoutcast and send metadata success when start next track for example it I set single file for loop metadata not send when I start liquidsoap and send success in next loop
same issue happen if restart icecast/shoutcast server metadata not sent and send success with next track I hope from developers check this and fix as soon as possible in next update
main post url : https://github.com/savonet/liquidsoap/discussions/2496
To Reproduce A minimal script to reproduce the issue is the most efficient way to have your bug addressed and fixed very quickly!
Expected behavior when start liquidsoap process from beginning metadata not sent to icecast or shoutcast and send metadata success when start next track
Version details
Install method Installed by opam with all packages
Common issues Can't decode or encode in some audio format? Check if you have installed the correct dependencies i'm sure every thing good because its works good when start next track after first time run
this is the logs :
Regards