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.41k stars 130 forks source link

Playing .m3u with annotations via playlist operator doesn't work #2257

Closed Vaalyn closed 2 years ago

Vaalyn commented 2 years ago

Describe the bug I'm investigating a problem with Liquidsoap not switching to playlists in AzuraCast when using our "Manual AutoDJ Mode" where we remove our "next_song" dynamic playlist call to our own scripts and rely completely on the playlist and switch definitions in the LS config we generate.

Liquidsoap seems to be unable to parse the .m3u playlists we generate via the playlist operator and thus not being able to switch to those playlists.

To Reproduce Here is how our generated .m3u playlists look like:

annotate:title="A World in Eternal Night",artist="00ToD00",duration="243.00",song_id="b1e954311bc39688b4d010e2dbc1952b",media_id="29066",liq_amplify="0.00dB",playlist_id="1":/var/azuracast/stations/brg/media/00tod00_-_a_world_in_eternal_night.mp3
annotate:title="Discord (Octavia's Version)",artist="4_4",duration="62.00",song_id="16ecb619dcb21f198e908f4e7b8965fd",media_id="29067",liq_amplify="0.00dB",playlist_id="1":/var/azuracast/stations/brg/media/4_4_-_discord_-28octavia_s_version-29.mp3
annotate:title="A New Leaf Over",artist="4everfreebrony",duration="254.00",song_id="343ba961f9da230f65432e435690f71d",media_id="29069",liq_amplify="0.00dB",playlist_id="1":/var/azuracast/stations/brg/media/4everfreebrony_-_a_new_leaf_over.mp3
annotate:title="A Season's End",artist="4everfreebrony",duration="185.00",song_id="f97e82c5d292ae1aa2f871d3fc60d01b",media_id="29068",liq_amplify="0.00dB",playlist_id="1":/var/azuracast/stations/brg/media/4everfreebrony_-_a_season_s_end.mp3
annotate:title="Coming Home to You",artist="4everfreebrony",duration="212.00",song_id="60ab89204861910d77d37dc5fdb12bd0",media_id="29070",liq_amplify="0.00dB",playlist_id="1":/var/azuracast/stations/brg/media/4everfreebrony_-_coming_home_to_you.mp3
annotate:title="Take My Leave",artist="4everfreebrony",duration="193.00",song_id="a49054e4fefc234951e82e63e97bb415",media_id="29071",liq_amplify="0.00dB",playlist_id="1":/var/azuracast/stations/brg/media/4everfreebrony_-_take_my_leave.mp3

Here is a minimal script that reproduces the issue in our stations container:

init.daemon.set(false)
log.stdout.set(true)
log.file.set(false)

playlist_daydj = playlist(id="playlist_daydj",mime_type="audio/x-mpegurl",mode="random",reload_mode="watch","/var/azuracast/stations/brg/playlists/playlist_daydj.m3u")
playlist_daydj = cue_cut(id="cue_playlist_daydj", playlist_daydj)

radio = random(id="standard_playlists", weights=[3], [playlist_daydj])

radio = fallback(id="safe_fallback", track_sensitive = false, [radio, single(id="error_jingle", "/usr/local/share/icecast/web/error.mp3")])

output.dummy(radio)

Expected behavior Liquidsoap should be able to parse the .m3u playlists and correctly switch to them.

Version details

Install method .deb from GH release: https://github.com/AzuraCast/docker-azuracast-radio/blob/aa4276df9a8e78646d3d4f31b9d06d6b42e67e66/build/setup/liquidsoap.sh#L23-L28

Logs

2022/02/27 16:16:44 >>> LOG START
2022/02/27 16:16:42 [main:3] Liquidsoap 2.0.3-1
2022/02/27 16:16:42 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] posix-time2=2.0.0 pcre=7.5.0 sedlex=2.5 menhirLib=20211128 curl=0.9.2 memtrace=v0.2.1.2 mem_usage=0.0.1 dtools=0.4.4 duppy=0.9.2 cry=0.6.6 mm=0.8.0 xmlplaylist=0.1.5 lastfm=0.3.3 ogg=0.7.0 ogg.decoder=0.7.0 vorbis=0.8.0 vorbis.decoder=0.8.0 opus=0.2.1 opus.decoder=0.2.1 speex=0.4.0 speex.decoder=0.4.0 mad=0.5.0 flac=0.3.0 flac.ogg=0.3.0 flac.decoder=0.3.0 dynlink=[distributed with Ocaml] lame=0.3.5 shine=0.2.2 frei0r=0.1.2 fdkaac=0.3.2 theora=0.4.0 theora.decoder=0.4.0 ffmpeg=1.1.1 bjack=0.1.6 alsa=0.3.0 ao=0.2.3 samplerate=0.1.6 taglib=0.3.9 ssl=0.5.9 magic=0.7.3 camomile=1.0.2 inotify=2.3 yojson=1.7.0 faad=0.5.0 soundtouch=0.1.9 portaudio=0.2.3 pulseaudio=0.1.4 ladspa=0.2.0 dssi=0.1.3 tsdl=v0.9.8 tsdl-ttf=0.3.2 tsdl-image=0.3.2 camlimages=4.2.6 cohttp-lwt-unix=5.0.0 prometheus-app=1.1 srt.constants=0.2.2 srt.types=0.2.2 srt.stubs=0.2.2 srt.stubs.locked=0.2.2 srt=0.2.2 lo=0.2.0 gd=1.0a5
2022/02/27 16:16:43 [clock:3] Using native (high-precision) implementation for latency control
2022/02/27 16:16:44 [playlist.basic:3] Wrong mime type application/csv for playlist!
2022/02/27 16:16:44 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main.
2022/02/27 16:16:44 [frame:3] Video frame size set to: 1280x720
2022/02/27 16:16:44 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2022/02/27 16:16:44 [frame:3] Targeting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2022/02/27 16:16:44 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2022/02/27 16:16:44 [sandbox:3] Running inside a docker container, disabling sandboxing.
2022/02/27 16:16:44 [video.converter:3] Using preferred video converter: ffmpeg.
2022/02/27 16:16:44 [audio.converter:3] Using samplerate converter: ffmpeg.
2022/02/27 16:16:44 [error_jingle:3] /usr/local/share/icecast/web/error.mp3 is static, resolving once for all...
2022/02/27 16:16:44 [error_jingle:3] Prepared "/usr/local/share/icecast/web/error.mp3" (RID 1).
2022/02/27 16:16:44 [clock.main:3] Streaming loop starts in auto-sync mode
2022/02/27 16:16:44 [clock.main:3] Delegating synchronisation to CPU clock
[mp3float @ 0x7ff498008540] 2022/02/27 16:16:44 [safe_fallback:3] Switch to error_jingle.
Vaalyn commented 2 years ago

Testing without annotations in the .m3u playlist:

/var/azuracast/stations/brg/media/00tod00_-_a_world_in_eternal_night.mp3
/var/azuracast/stations/brg/media/4_4_-_discord_-28octavia_s_version-29.mp3
/var/azuracast/stations/brg/media/4everfreebrony_-_a_new_leaf_over.mp3
/var/azuracast/stations/brg/media/4everfreebrony_-_a_season_s_end.mp3
/var/azuracast/stations/brg/media/4everfreebrony_-_coming_home_to_you.mp3
/var/azuracast/stations/brg/media/4everfreebrony_-_take_my_leave.mp3

With the same LS script as above this works correctly so it looks like the annotations are the problem here.

2022/02/27 16:41:06 >>> LOG START
2022/02/27 16:41:04 [main:3] Liquidsoap 2.0.3-1
2022/02/27 16:41:04 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] posix-time2=2.0.0 pcre=7.5.0 sedlex=2.5 menhirLib=20211128 curl=0.9.2 memtrace=v0.2.1.2 mem_usage=0.0.1 dtools=0.4.4 duppy=0.9.2 cry=0.6.6 mm=0.8.0 xmlplaylist=0.1.5 lastfm=0.3.3 ogg=0.7.0 ogg.decoder=0.7.0 vorbis=0.8.0 vorbis.decoder=0.8.0 opus=0.2.1 opus.decoder=0.2.1 speex=0.4.0 speex.decoder=0.4.0 mad=0.5.0 flac=0.3.0 flac.ogg=0.3.0 flac.decoder=0.3.0 dynlink=[distributed with Ocaml] lame=0.3.5 shine=0.2.2 frei0r=0.1.2 fdkaac=0.3.2 theora=0.4.0 theora.decoder=0.4.0 ffmpeg=1.1.1 bjack=0.1.6 alsa=0.3.0 ao=0.2.3 samplerate=0.1.6 taglib=0.3.9 ssl=0.5.9 magic=0.7.3 camomile=1.0.2 inotify=2.3 yojson=1.7.0 faad=0.5.0 soundtouch=0.1.9 portaudio=0.2.3 pulseaudio=0.1.4 ladspa=0.2.0 dssi=0.1.3 tsdl=v0.9.8 tsdl-ttf=0.3.2 tsdl-image=0.3.2 camlimages=4.2.6 cohttp-lwt-unix=5.0.0 prometheus-app=1.1 srt.constants=0.2.2 srt.types=0.2.2 srt.stubs=0.2.2 srt.stubs.locked=0.2.2 srt=0.2.2 lo=0.2.0 gd=1.0a5
2022/02/27 16:41:05 [clock:3] Using native (high-precision) implementation for latency control
2022/02/27 16:41:06 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main.
2022/02/27 16:41:06 [frame:3] Video frame size set to: 1280x720
2022/02/27 16:41:06 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2022/02/27 16:41:06 [frame:3] Targeting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2022/02/27 16:41:06 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2022/02/27 16:41:06 [sandbox:3] Running inside a docker container, disabling sandboxing.
2022/02/27 16:41:06 [video.converter:3] Using preferred video converter: ffmpeg.
2022/02/27 16:41:06 [audio.converter:3] Using samplerate converter: ffmpeg.
2022/02/27 16:41:06 [error_jingle:3] /usr/local/share/icecast/web/error.mp3 is static, resolving once for all...
2022/02/27 16:41:06 [error_jingle:3] Prepared "/usr/local/share/icecast/web/error.mp3" (RID 1).
2022/02/27 16:41:06 [clock.main:3] Streaming loop starts in auto-sync mode
2022/02/27 16:41:06 [clock.main:3] Delegating synchronisation to CPU clock
2022/02/27 16:41:06 [safe_fallback:3] Switch to error_jingle.
[mp3float @ 0x7f5fa4008540] Could not update timestamps for skipped samples.
2022/02/27 16:41:06 [playlist_daydj:3] Prepared "/var/azuracast/stations/brg/media/4everfreebrony_-_take_my_leave.mp3" (RID 2).
2022/02/27 16:41:06 [safe_fallback:3] Switch to standard_playlists with transition.
[mp3float @ 0x7f5fa4052280] 2022/02/27 16:41:06 [standard_playlists:3] Switch to switch_0.
2022/02/27 16:41:06 [switch_0:3] Switch to cue_playlist_daydj.
Could not update timestamps for skipped samples.
2022/02/27 16:41:06 [cue_playlist_daydj:3] Cueing in...
F-luxus commented 2 years ago

Its seems I have the same problem after AzuraCast update to latest version. With Manual AutoDJ Mode on AzuraCast Playlist liquidsoap showing this error:

Reloading playlist with URI
Nonexistent file or ill-formed URI
Couldn't read playlist: request resolution failed

Code looks like this:

playlist_ads = playlist(id="playlist_ads",mime_type="audio/x-mpegurl",mode="randomize",reload_mode="watch","/var/azuracast/stations/test/playlists/playlist_ads .m3u")

playlist_ads  = cue_cut(id="cue_playlist_ads ", playlist_ads)

playlist_ads  = drop_metadata(playlist_ads)

intro = single("/var/azuracast/stations/test/media/INTRO/intro.mp3")

radio = rotate(weights=[1,3,8], [intro, playlist_ads, radio])

intro part is working every 8th song, but ads not playing regarding the same problem as author. Any fix yet?

toots commented 2 years ago

Thanks for reporting. Could you send some extract of the logs with log level 5? I am not able to reproduce at the moment.

Vaalyn commented 2 years ago

Thanks for reporting. Could you send some extract of the logs with log level 5? I am not able to reproduce at the moment.

I have checked this with the v2.0.4-preview branch and there it works correctly again. I assume that between that and v2.0.3-1 this issue got fixed.

@F-luxus could you check which version of Liquidsoap you are running? You can see this in the Liquidsoap Logs in the following part:

2022/03/21 04:00:01 >>> LOG START
2022/03/21 04:00:01 [main:3] Liquidsoap 2.0.4
F-luxus commented 2 years ago

@Vaalyn at this moment Liquidsoap 2.0.3-1 how did you update to Liquidsoap 2.0.4?

Vaalyn commented 2 years ago

The latest Rolling-Release of AzuraCast is on the 2.0.4-preview branch of Liquidsoap as far as I'm aware.

F-luxus commented 2 years ago

ahh... 🙊 maybe its not a good place to ask about. But I feel lost. I can't find any information on docks how can I change channel from Stable to Rolling Release on docker ---edit nevemind I need to learn how to read 😄 I found now how to update that

Vaalyn commented 2 years ago

@F-luxus have you checked if this is fixed for you on the updated version?

If it's working for you now too I'd close this issue as resolved then.

F-luxus commented 2 years ago

Yes, update helps to solve a problem

Vaalyn commented 2 years ago

Closing as solved then, thank you for testing this too 👍

terewere commented 2 years ago

I have a similar problem. It works on Macbook Pro but NOT on Ubuntu 20.04 Server. USING liquidsoap 2.0.4

To Reproduce log.stdout.set(true) log.file.set(false) settings.server.log.level.set(5)

a = playlist(mode="random",reload_mode="watch","c.m3u") radio = fallback(track_sensitive = false, [a, single(id="error", "error.mp3")]) output.dummy(radio)

M3U PLAYLIST WITH ANNOTATION PROTOCOL annotate:title="Sound 8",artist="Ownaradio",duration="10.79",media_id="56",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/cresent-hell-escalate-3-11647.mp3 annotate:title="Sound 10",artist="Ownaradio",duration="27.06",media_id="55",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/808-kick-boom-bass-snare-hit-hats-roll-140-bpm-3-trap-loop-15-12764.mp3 annotate:title="Jingle 1",artist="Radio",duration="10.92",media_id="58",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/jingle_1.mp3 annotate:title="21469",artist="dramatic-reveal",duration="12.28",media_id="196",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/dramatic-reveal-21469.mp3 annotate:title="Sound 10",artist="Ownaradio",duration="27.06",media_id="55",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/808-kick-boom-bass-snare-hit-hats-roll-140-bpm-3-trap-loop-15-12764.mp3 annotate:title="ad 1",artist="",duration="13.65",media_id="197",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/ad_1.mp3 annotate:title="ad 2",artist="",duration="9.56",media_id="198",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/ad_2.mp3 annotate:title="ann",artist="",duration="13.65",media_id="199",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/ann.mp3 annotate:title="6888",artist="birds singing",duration="22.34",media_id="200",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/birds_singing-6888.mp3 annotate:title="close",artist="",duration="21.38",media_id="201",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/close.mp3 annotate:title="Sound 8",artist="Ownaradio",duration="10.79",media_id="56",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/cresent-hell-escalate-3-11647.mp3 annotate:title="8261",artist="deep-breath",duration="20.04",media_id="202",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/deep-breath-8261.mp3 annotate:title="14652",artist="deep-reversed-boom-with-reverb",duration="27.43",media_id="203",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/deep-reversed-boom-with-reverb-14652.mp3 annotate:title="7134",artist="dream-sound-effect-downscale",duration="11.57",media_id="204",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/dream-sound-effect-downscale-7134.mp3 annotate:title="13883",artist="drum-roll-sound-effect-trommelwirbel-snare-crash-preisverleihung-drumroll-sound",duration="26.62",media_id="205",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/drum-roll-sound-effect-trommelwirbel-snare-crash-preisverleihung-drumroll-sound-13883.mp3 annotate:title="13407",artist="eastern-morning",duration="14.03",media_id="206",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/eastern-morning-13407.mp3 annotate:title="16208",artist="exiting-spicatos",duration="17.19",media_id="207",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/exiting-spicatos-16208.mp3 annotate:title="21668",artist="exiting-strings",duration="20.58",media_id="208",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/exiting-strings-21668.mp3 annotate:title="21486",artist="fearverb",duration="27.45",media_id="209",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/fearverb-21486.mp3 annotate:title="21991",artist="fire-sound-efftect",duration="15.20",media_id="210",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/fire-sound-efftect-21991.mp3 annotate:title="14714",artist="foot-steps",duration="22.10",media_id="211",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/foot-steps-14714.mp3 annotate:title="21616",artist="handy-introduction-01-glbml-bc",duration="17.18",media_id="213",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/handy-introduction-01-glbml-bc-21616.mp3 annotate:title="8186",artist="heavy-rain-nature-sounds",duration="29.91",media_id="214",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/heavy-rain-nature-sounds-8186.mp3 annotate:title="13222",artist="intro-music-black-box-brand-jingle",duration="19.91",media_id="215",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/intro-music-black-box-brand-jingle-13222.mp3 annotate:title="Jingle 1",artist="Radio",duration="10.92",media_id="58",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/jingle_1.mp3 annotate:title="jingle 2",artist="",duration="9.56",media_id="216",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/jingle_2.mp3 annotate:title="jingle 3",artist="",duration="12.29",media_id="217",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/jingle_3.mp3 annotate:title="6345",artist="nikonf4",duration="26.54",media_id="218",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/nikonf4-6345.mp3 annotate:title="14604",artist="office phone-ring medium-loudaif",duration="23.64",media_id="219",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/office_phone-ring_medium-loudaif-14604.mp3 annotate:title="21568",artist="orcs-loop",duration="25.99",media_id="220",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/orcs-loop-21568.mp3 annotate:title="14540",artist="saloon-piano-honky-tonk",duration="22.22",media_id="221",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/saloon-piano-honky-tonk-14540.mp3 annotate:title="14693",artist="seagull",duration="14.95",media_id="222",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/seagull-14693.mp3 annotate:title="14526",artist="short-whoosh-13x",duration="14.38",media_id="223",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/short-whoosh-13x-14526.mp3 annotate:title="21472",artist="suspense-intro",duration="18.65",media_id="224",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/suspense-intro-21472.mp3 annotate:title="20529",artist="unsettling-entities",duration="24.03",media_id="225",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/unsettling-entities-20529.mp3 annotate:title="21454",artist="uprise",duration="10.16",media_id="226",liq_amplify="0.00dB",station_id="20015",playlist_id="21":sounds/uprise-21454.mp3

MACBOOK PRO LOGS [THIS WORKS] 2022/03/29 09:55:33 >>> LOG START 2022/03/29 09:55:13 [main:3] Liquidsoap 2.0.4 2022/03/29 09:55:13 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=7.5.0 sedlex=2.5 menhirLib=20211128 curl=0.9.2 dtools=0.4.4 duppy=0.9.2 cry=0.6.7 mm=bfff160 ogg=0.7.1 ogg.decoder=0.7.1 vorbis=0.8.0 vorbis.decoder=0.8.0 opus=0.2.1 opus.decoder=0.2.1 mad=0.5.2 flac=0.3.0 flac.ogg=0.3.0 flac.decoder=0.3.0 dynlink=[distributed with Ocaml] lame=0.3.6 frei0r=0.1.2 fdkaac=0.3.2 ffmpeg=1.1.2 samplerate=0.1.6 taglib=0.3.9 camomile=1.0.2 faad=0.5.0 ladspa=0.2.2 2022/03/29 09:55:14 [clock:3] Using builtin (low-precision) implementation for latency control 2022/03/29 09:55:33 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main. 2022/03/29 09:55:33 [frame:3] Video frame size set to: 1280x720 2022/03/29 09:55:33 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples. 2022/03/29 09:55:33 [frame:3] Targeting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks. 2022/03/29 09:55:33 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks. 2022/03/29 09:55:33 [sandbox:3] Could not find binary bwrap, disabling sandboxing. 2022/03/29 09:55:33 [video.converter:3] Using preferred video converter: ffmpeg. 2022/03/29 09:55:33 [audio.converter:3] Using samplerate converter: ffmpeg. 2022/03/29 09:55:33 [error:3] error.mp3 is static, resolving once for all... [mp3 @ 0x7f854d614500] Estimating duration from bitrate, this may be inaccurate [mp3 @ 0x7f854d7121c0] Estimating duration from bitrate, this may be inaccurate [mp3 @ 0x7f854d6123c0] Estimating duration from bitrate, this may be inaccurate [mp3 @ 0x7f854d4484c0] Estimating duration from bitrate, this may be inaccurate 2022/03/29 09:55:33 [error:3] Prepared "error.mp3" (RID 1). 2022/03/29 09:55:33 [clock.main:3] Streaming loop starts in auto-sync mode 2022/03/29 09:55:33 [clock.main:3] Delegating synchronisation to CPU clock [mp3 @ 0x7f8551805780] Estimating duration from bitrate, this may be inaccurate 2022/03/29 09:55:33 [switch_0:3] Switch to error. [mp3 @ 0x7f854d613f80] Estimating duration from bitrate, this may be inaccurate [mp3 @ 0x7f854d716280] Estimating duration from bitrate, this may be inaccurate [mp3 @ 0x7f854f106780] Estimating duration from bitrate, this may be inaccurate 2022/03/29 09:55:33 [c.m3u:3] Prepared "sounds/dramatic-reveal-21469.mp3" (RID 2). 2022/03/29 09:55:33 [switch_0:3] Switch to c.m3u with transition. [mp3 @ 0x7f85518051c0] Estimating duration from bitrate, this may be inaccurate [mp3 @ 0x7f854d71a640] Estimating duration from bitrate, this may be inaccurate 2022/03/29 09:55:45 [decoder:2] Decoding "sounds/dramatic-reveal-21469.mp3" ended: Ffmpeg_decoder.End_of_file. [mp3 @ 0x7f854d53f180] Estimating duration from bitrate, this may be inaccurate [mp3 @ 0x7f854d53f180] Estimating duration from bitrate, this may be inaccurate 2022/03/29 09:55:45 [c.m3u:3] Prepared "sounds/808-kick-boom-bass-snare-hit-hats-roll-140-bpm-3-trap-loop-15-12764.mp3" (RID 3). [mp3 @ 0x7f8551905240] Estimating duration from bitrate, this may be inaccurate [mp3 @ 0x7f8551908b00] Estimating duration from bitrate, this may be inaccurate 2022/03/29 09:56:12 [decoder:2] Decoding "sounds/808-kick-boom-bass-snare-hit-hats-roll-140-bpm-3-trap-loop-15-12764.mp3" ended: Ffmpeg_decoder.End_of_file. [mp3 @ 0x7f854d541bc0] Estimating duration from bitrate, this may be inaccurate [mp3 @ 0x7f854d541bc0] Estimating duration from bitrate, this may be inaccurate 2022/03/29 09:56:12 [c.m3u:3] Prepared "sounds/jingle_1.mp3" (RID 4). [mp3 @ 0x7f854d41dd40] Estimating duration from bitrate, this may be inaccurate [mp3 @ 0x7f854d61a080] Estimating duration from bitrate, this may be inaccurate 2022/03/29 09:56:23 [decoder:2] Decoding "sounds/jingle_1.mp3" ended: Ffmpeg_decoder.End_of_file. [mp3 @ 0x7f854d619bc0] Estimating duration from bitrate, this may be inaccurate [mp3 @ 0x7f854d619bc0] Estimating duration from bitrate, this may be inaccurate 2022/03/29 09:56:23 [c.m3u:3] Prepared "sounds/deep-breath-8261.mp3" (RID 5). [mp3 @ 0x7f854d722d80] Estimating duration from bitrate, this may be inaccurate [mp3 @ 0x7f854d622680] Estimating duration from bitrate, this may be inaccurate 2022/03/29 09:56:43 [decoder:2] Decoding "sounds/deep-breath-8261.mp3" ended: Ffmpeg_decoder.End_of_file. [mp3 @ 0x7f854d423fc0] Estimating duration from bitrate, this may be inaccurate [mp3 @ 0x7f854d71f9c0] Estimating duration from bitrate, this may be inaccurate 2022/03/29 09:56:43 [c.m3u:3] Prepared "sounds/intro-music-black-box-brand-jingle-13222.mp3" (RID 6).

UBUNTU 20.04 SERVER LOGS [DOES NOT. WORK] 2022/03/29 09:54:40 >>> LOG START 2022/03/29 09:54:39 [main:3] Liquidsoap 2.0.4 2022/03/29 09:54:39 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=7.5.0 sedlex=2.5 menhirLib=20211128 dtools=0.4.4 duppy=0.9.2 cry=0.6.6 mm=bfff160 ogg=0.7.1 ogg.decoder=0.7.1 mad=0.5.2 flac=0.3.0 flac.ogg=0.3.0 flac.decoder=0.3.0 dynlink=[distributed with Ocaml] lame=0.3.5 frei0r=0.1.2 fdkaac=0.3.2 ao=0.2.4 samplerate=0.1.6 taglib=0.3.9 ssl=0.5.9 magic=0.7.3 camomile=1.0.2 faad=0.5.0 2022/03/29 09:54:39 [clock:3] Using builtin (low-precision) implementation for latency control 2022/03/29 09:54:40 [playlist.basic:3] Wrong mime type application/csv for playlist! 2022/03/29 09:54:40 [playlist.basic:3] Wrong mime type application/csv for playlist! 2022/03/29 09:54:40 [playlist.basic:3] Wrong mime type application/csv for playlist! 2022/03/29 09:54:40 [playlist.basic:3] Wrong mime type application/csv for playlist! 2022/03/29 09:54:40 [playlist.basic:3] Wrong mime type application/csv for playlist! 2022/03/29 09:54:40 [playlist parser:3] No format found 2022/03/29 09:54:40 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main. 2022/03/29 09:54:40 [frame:3] Video frame size set to: 1280x720 2022/03/29 09:54:40 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples. 2022/03/29 09:54:40 [frame:3] Targeting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks. 2022/03/29 09:54:40 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks. 2022/03/29 09:54:40 [sandbox:3] Sandboxing disabled 2022/03/29 09:54:40 [video.converter:3] Couldn't find preferred video converter: ffmpeg. 2022/03/29 09:54:40 [audio.converter:3] Using samplerate converter: libsamplerate. 2022/03/29 09:54:40 [error:3] error.mp3 is static, resolving once for all... 2022/03/29 09:54:40 [error:3] Prepared "error.mp3" (RID 1). 2022/03/29 09:54:40 [clock.main:3] Streaming loop starts in auto-sync mode 2022/03/29 09:54:40 [clock.main:3] Delegating synchronisation to CPU clock 2022/03/29 09:54:40 [switch_0:3] Switch to error. 2022/03/29 09:55:09 [decoder:2] Decoding "error.mp3" ended: Mad.End_of_stream. 2022/03/29 09:55:10 [error:3] Prepared "error.mp3" (RID 1). 2022/03/29 09:55:39 [decoder:2] Decoding "error.mp3" ended: Mad.End_of_stream. 2022/03/29 09:55:40 [error:3] Prepared "error.mp3" (RID 1). 2022/03/29 09:56:09 [decoder:2] Decoding "error.mp3" ended: Mad.End_of_stream. 2022/03/29 09:56:10 [error:3] Prepared "error.mp3" (RID 1). 2022/03/29 09:56:39 [decoder:2] Decoding "error.mp3" ended: Mad.End_of_stream. 2022/03/29 09:56:40 [error:3] Prepared "error.mp3" (RID 1). 2022/03/29 09:57:09 [decoder:2] Decoding "error.mp3" ended: Mad.End_of_stream. 2022/03/29 09:57:10 [error:3] Prepared "error.mp3" (RID 1). 2022/03/29 09:57:39 [decoder:2] Decoding "error.mp3" ended: Mad.End_of_stream. 2022/03/29 09:57:40 [error:3] Prepared "error.mp3" (RID 1). 2022/03/29 09:58:09 [decoder:2] Decoding "error.mp3" ended: Mad.End_of_stream.

Install method OPAM for both Macbook pro and Ubuntu 20.04 server

toots commented 2 years ago

@Vaalyn & @F-luxus : glad to hear!

@terewere : it looks like the mime type detection is inconsistent and the playlist is detected as a CSV by ubuntu. I would suggest forcing the mime type the way it is being done in the original example:

s = playlist(mime_type="audio/x-mpegurl", ...)
terewere commented 2 years ago

@toots Well the original code has the mime_type attribute present but didn't work. I only remove it for brevity.

terewere commented 2 years ago

It works well in Docker using Opam.

toots commented 2 years ago

Thanks for y'all patience with this! I found the source of the issue: the parser was behaving differently when compile with magic enabled. Also, the check was pretty dumb, it was expecting a mime type of text/* which is not always returned for text files, as @terewere's example showed.

This is fixed in main and v2.0.4-preview and will be released soon!

terewere commented 2 years ago

Thank you very much @toots, It's fixed!