FLAC playback terminates before playing all audio (final <250ms clipped) (all platforms Linux, Android, Windows)
Hello, As described here (https://forum.videolan.org/viewtopic.php?f=2&t=155066) I have a bug where FLAC codec play back stops ~250ms before it should on every song I try on every platform I try. Here is a modified copy-paste of that thread:
Bug Description The final ~250ms of FLAC tracks are skipped during audio playback on Arch Linux x64 VLC 3.0.11.1-3, on Android using VLC 3.2.12 from Google Play (model: SGS7E), and on Windows 10 x64 (HP G3 Laptop).
For those who would like an example, the popular album "To Pimp A Butterfly" makes heavy use of hard cuts at the end of tracks during spoken dialogue and it is very apparent on track 05, "These Walls". Kendrick does not finish saying the phrase "in a Hotel Room" in FLAC. He instead says "in a Hote". The sounds for [Hote]"l room" are clipped entirely.
This is 100% reproducible per listen and happens on any track I have tried -- however... that being said it's quite difficult to notice if you don't have a good track candidate to show off the problem (many tracks have silence here).
Steps to Demonstrate Bug
- Find a song with important information in the last 200ms of the song
- Rip it using (e.g.) Rhythmbox, default FLAC settings -- nothing fancy
- Play it as FLAC
- Expected: you hear this part of the song
- Actual: You do not hear this part of the song
- Workaround: Use
$ flac -d
to decode it to WAV. The track now terminates playback completely.
Irrelevant Factors
- Audio output device (using reliable hardware or aux out speakers that work with other players, it fails. On Android hardware speaker, wired headphones, bluetooth all fail)
- Platform (Linux, Android, Windows all share this defect)
- Audio import tool (used Rhythmbox, Sound Juicer, cdparanoia through
abcde -o flac
) - Playlist order or count (having more tracks before or after is irrelevant. playing alone is irrelevant)
- File source (local fails the same as network play, internal disk vs. USB irrelevant)
Didn't Try
- Lossy codecs. Wav works, FLAC doesn't. That was enough for me.
Nearby Topics
- https://forum.videolan.org/viewtopic.ph ... ty#p499193 looks like a similar playback issue but older versions and different formats. WAV works for me
- https://forum.videolan.org/viewtopic.ph ... ck#p500852 mine occurs at the end not the beginning of tracks
- https://forum.videolan.org/viewtopic.ph ... ap#p472672 potentially related?
This rabbit hole went way deeper than I thought -- I thought it was an Android-only bug.
End Copy Paste
I have prepared a file in VLC that shows off this defect quite nicely. I'm going to upload it after submitting this ticket.
I'm quite new to VLC's codebase but I'll take a look in myself and am open to pointers and running test builds. Next up here is to try building my own copy and running that so I can work on this, too.