savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.4k stars 128 forks source link

Switch skips one track #1366

Open z814 opened 4 years ago

z814 commented 4 years ago

Describe the bug Switch does not start playback at the scheduled time.

Script:

def news_end()
  # This script is only for deleting the news playlist file (/usr/share/liquidsoap/news/pl.m3u).
  system("php /usr/share/liquidsoap/news/news_end.php")  
end

music = audio_to_stereo(playlist(reload=1, reload_mode="rounds", mode="randomize", "/home/music"))

#The playlist is automatically created two minutes before the start of the hour.
news = audio_to_stereo(playlist.once(on_done={news_end()},"/usr/share/liquidsoap/news/pl.m3u",reload_mode="watch"))

radio = switch(track_sensitive = true, [ ({00m01s-10m00s}, news), music ])

security = sine()
radio = fallback(track_sensitive = false, [radio, security])

output.icecast(%fdkaac(bitrate=64), mount="radio1", name="radio1", encoding="UTF-8",
host="localhost", port=8080, password="111", description="radio1", public=false, radio)

Log: 2020/09/27 07:51:57 [music:3] Prepared "/home/music/song2.mp3" (RID 0). 2020/09/27 07:54:46 [decoder:3] Method "MAD" accepted "/home/music/song5.mp3". 2020/09/27 07:54:56 [music:3] Prepared "/home/music/song3.mp3" (RID 1). 2020/09/27 07:58:12 [decoder:3] Method "MAD" accepted "/home/music/song4.mp3". 2020/09/27 07:58:22 [music:3] Prepared "/home/music/song5.mp3" (RID 4). 2020/09/27 07:58:32 [request.dynamic.list_7710:3] Reloading playlist with URI /usr/share/liquidsoap/news/pl.m3u 2020/09/27 08:01:48 [decoder:3] Method "MAD" accepted "/home/music/song3.mp3". 2020/09/27 08:01:58 [music:3] Prepared "/home/music/song4.mp3" (RID 5). 2020/09/27 08:01:59 [decoder:3] Method "MAD" accepted "/usr/share/liquidsoap/news/newsmain.mp3". 2020/09/27 08:05:10 [decoder:3] Method "MAD" accepted "/home/music/song2.mp3". 2020/09/27 08:05:20 [request.dynamic.list_7710:3] Prepared "/usr/share/liquidsoap/news/newsmain.mp3" (RID 3). 2020/09/27 08:05:20 [fallback_7717:3] Switch to switch_7716 with forgetful transition. 2020/09/27 08:05:20 [switch_7716:3] Switch to audio_to_stereo_7714. 2020/09/27 08:06:56 [music:3] Prepared "/home/music/song3.mp3" (RID 2). 2020/09/27 08:06:56 [fallback_7717:3] Switch to audio_to_stereo_7708 with forgetful transition.

Why doesn't he switch to the news at 2020/09/27 08:01:59 and skips another track?

Version details

Install method opam

z814 commented 3 years ago

Version <=1.3.7 works fine:

2020/10/01 18:57:58 [decoder:3] Method "MAD" accepted "/home/music/song1.mp3".
2020/10/01 18:58:08 [music:3] Finished with "/home/music/song2.mp3".
2020/10/01 18:58:08 [music:3] Prepared "/home/music/song1.mp3" (RID 343).
**2020/10/01 18:58:30 [request.dynamic_6387:3] Reloading playlist with URI /usr/share/liquidsoap/news/pl.m3u
2020/10/01 18:58:31 [decoder:3] Method "MAD" accepted "/usr/share/liquidsoap/news/newsmain.mp3".**
2020/10/01 19:01:27 [decoder:3] Method "MAD" accepted "/home/music/song5.mp3".
2020/10/01 19:01:37 [music:3] Finished with "/home/music/song1.mp3".
**2020/10/01 19:01:37 [request.dynamic_6387:3] Prepared "/usr/share/liquidsoap/news/newsmain.mp3" (RID 409).**
2020/10/01 19:01:37 [switch_6392:3] Switch to audio_to_stereo_6390 with forgetful transition.
2020/10/01 19:03:07 [request.dynamic_6387:3] Finished with "/usr/share/liquidsoap/news/newsmain.mp3".
2020/10/01 19:03:07 [music:3] Prepared "/home/music/song5.mp3" (RID 410).
2020/10/01 19:03:07 [switch_6392:3] Switch to audio_to_stereo_6385 with forgetful transition.

However version >=1.4.0 skips one track.

bugoverfl0w commented 3 years ago

I have the same error, it skips some tracks, not one track

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

toots commented 2 years ago

Switch has been reworked a bunch lately, any chance one of y'all could try to see if this issue is still present with the latest v2.0.4-preview?