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

Track titles are set to 'unknown' randomly #1808

Closed ivellios1988 closed 2 years ago

ivellios1988 commented 3 years ago

With reference to: https://github.com/AzuraCast/AzuraCast/issues/4434

Describe the bug I’m using AzuraCast v0.14.0 Stable. Since I recently installed AzuraCast I’m constantly encountering a strange issue that makes titles of many tracks being set to ‘Unknown’ in the title bar. Some track is played by Liquidsoap, everything is fine, the title is displayed properly, then another track is played and all I see in the title bar is ‘Unknown’. Even though the correct title and artist info is present in Liquidsoap’s log file and the media file is tagged properly as well. I should add that I care a lot about correct tags in my media files. MP3s, AACs, OGGs, OPUSes, are all tagged so that they have at least the title and artist’s name, and some of them also contain things such as year, genre, album cover, etc. This ‘unknown’ thing seems to occur completely randomly, as the same file can be played multiple times, and one time the title is displayed properly when another time it is set to ‘unknown’. Most of my media files I tagged using Mp3tag, I also edited many of them using the AzuraCast’s built-in tag editor.

Here I attach one of the problematic 'tagged but unknown' MP3s: https://drive.google.com/file/d/1uKmzYUIxPbdhIfY71ipagMOMhnkrO_IV/view?usp=sharing

My Liquidsoap configuration file: https://pastebin.com/h3JWc4Ak As you will see, I tried to implement a solution described here: https://github.com/savonet/liquidsoap/issues/1244 but with no success

Relevant log output referring to the file I attached, with some notes from me:

2021/07/28 15:29:23 [lang:3] AzuraCast Raw Response: annotate:title="Conquest of paradise (Vangelis)",artist="5 covers mixed together",duration="365.00",song_id="4ab2c2ef9276b004f07249568f94e0e3",media_id="12",liq_amplify="0.00dB",playlist_id="3":/var/azuracast/stations/radio_paranormalium/media/muzyka/covery/5 covers mixed together - Conquest of paradise (Vangelis).mp3
2021/07/28 15:29:23 [decoder:3] Method "FFMPEG" accepted "/var/azuracast/stations/radio_paranormalium/media/muzyka/covery/5 covers mixed together - Conquest of paradise (Vangelis).mp3".
2021/07/28 15:29:23 [ffmpeg:3] [mp3 @ 0x7fa88402acc0] Estimating duration from bitrate, this may be inaccurate
2021/07/28 15:29:23 [lang:3] AzuraCast Feedback Response: OK
2021/07/28 15:29:46 [ffmpeg:3] [mp3 @ 0x7fa87c1ab500] Estimating duration from bitrate, this may be inaccurate
2021/07/28 15:29:46 [ffmpeg:3] [mp3 @ 0x7fa87c1ab500] Estimating duration from bitrate, this may be inaccurate

[now a jingle is prepared]

2021/07/28 15:29:46 [next_song:3] Prepared "/var/azuracast/stations/radio_paranormalium/media/jingle/jingle czat.mp3" (RID 3).
2021/07/28 15:29:46 [cross_38793:3] Analysis: -30.295588dB / -14.928928dB (2.99s / 3.01s)
2021/07/28 15:29:46 [crossfade:3] Simple transition: crossed, fade-in, fade-out.
2021/07/28 15:29:47 [lang:3] AzuraCast Feedback Response: OK
2021/07/28 15:29:59 [ffmpeg:3] [mp3 @ 0x7fa87c021400] Estimating duration from bitrate, this may be inaccurate
2021/07/28 15:29:59 [ffmpeg:3] [mp3 @ 0x7fa87c021400] Estimating duration from bitrate, this may be inaccurate

[and finally time to play the song!]

2021/07/28 15:29:59 [next_song:3] Prepared "/var/azuracast/stations/radio_paranormalium/media/muzyka/covery/5 covers mixed together - Conquest of paradise (Vangelis).mp3" (RID 5).
2021/07/28 15:29:59 [cross_38793:3] Analysis: -31.089749dB / -28.217561dB (2.96s / 2.96s)
2021/07/28 15:29:59 [crossfade:3] Simple transition: crossed, fade-in, fade-out.
2021/07/28 15:29:59 [lang:3] AzuraCast Feedback Response: OK
2021/07/28 15:31:32 [server:3] New client: 172.19.0.5.
2021/07/28 15:31:32 [server:3] Client 172.19.0.5 disconnected.

To Reproduce

Expected behavior Correct track title and artist’s name should be displayed in my radio’s title bar

Version details Ubuntu 20.04 AzuraCast v.0.14.0

Install method AzuraCast installed using Docker method

toots commented 3 years ago

Thanks for this report, I will have a look shortly.

toots commented 3 years ago

Hi @ivellios1988 ! What version of liquidsioap are you using? Any chance you could try with 2.0.0?

ivellios1988 commented 3 years ago

Hi @toots ! If I remember correctly, AzuraCast uses Liquidsoap version 1.4. Though I'm not sure about it, since I couldn't find this information on their website now. I remember they plan to update Liquidsoap to 2.0.0 but they need to perform some tests and fix any issues they encounter.

toots commented 3 years ago

Okay, thanks. We are actively working on 2.0.0 at the moment so it would be best for us to be able to test and fix the issue there. As a matter of fact, this PR might be the beginning of a fix: https://github.com/savonet/liquidsoap/pull/1830

toots commented 3 years ago

I can try to backport the fix to a branch based off 1.4.4 tho if that's doable. I'm not 100% sure that this'll fix the issue but it'd be a good start.

toots commented 3 years ago

The fix is backported in the 1.4.4-metadata-replay-fix branch. Is that enough for y'all to test it? The CI doesn't build, I can fix it but I'd like to avoid spending the time 😅

ivellios1988 commented 3 years ago

I'm not quite sure how to implement this fix into my AzuraCast installation without breaking anything. Maybe @SlvrEagle23 will be able to help me with this?

ivellios1988 commented 2 years ago

Well, it looks like I accidentally found the culprit...

My radio's list of streams looks as follows: MP3 128kbps AAC 320kbps OPUS 192kbps VBR MP3 48kbps AAC+ 24kbps MP3 24kbps OPUS 24kbps OPUS 8kbps

I know there are plenty of them. I wanted to fit the needs of all my listeners. Some of them (most of my listeners live in Poland) have a bad Internet connection so they will use streams with 24kbps or 8kbps, others prefer the highest audio fidelity so they use OPUS 192kbps or AAC 320kbps. Those who still sit on Windows XP or Vista will probably choose MP3 streams.... etc.

Now, about OPUS streams. For a long time, there was an issue with the playback of OPUS streams in web players. On each metadata update, the streams were interrupted which resulted in browsers stopping the playback. I wanted to prevent this from happening so I decided to add drop_metadata to OPUS streams so that the playback won't be interrupted.

Now it turns out that probably this is what caused this 'unknown' metadata issue with some of my tracks. After I updated my installation of AzuraCast to 0.15.0 two days ago, Liquidsoap started its' work from setting metadata to 'unknown' (very funny...). Because I don't want my listeners to be annoyed by this anymore, I decided to remove the 'drop_metadata' argument. And the issue is gone, yaaaaay! I keep monitoring the title bar in my player and the song history - no 'unknowns'.

And apparently, something has been changed in how Chrome deals with OPUS streams (i haven't tested playing them in Firefox yet), because metadata updates don't cause playback interruptions anymore. So another good news is that I don't need to use drop_metadata anymore.

smimram commented 2 years ago

Great, thanks for letting us know! I am closing the issue now since it is apparently resolved.