fooyin / fooyin

A customisable music player
https://www.fooyin.org
GNU General Public License v3.0
605 stars 18 forks source link

FLAC subset tests don't work completely #183

Open kode54 opened 4 months ago

kode54 commented 4 months ago

Describe the bug The FLAC conformance subset files from here: https://github.com/ietf-wg-cellar/flac-test-files/tree/main/subset

Fail to decode properly. A resampler with track start/end padding with LPC (and subsequently removing padding from resampler output), or a resampler which already makes this sort of guarantee for gapless decoding, may be needed for the mixed sample rate cases to play gaplessly. (Though this is an edge case.)

Sample 22, 12 bits per sample, crashes the player. I can supply a backtrace if needed. Sample 45, no total number of samples set, fails to decode, because presumably the lack of a total sample count is treated as zero length?

All the rest of the samples decode fine, though the embedded CUE sheet samples don't display their CUE sheets in the playlist. They do use the FLAC binary cue system instead of embedded "CUESHEET" tags with textual CUE sheets, though.

To Reproduce

  1. Download the above linked test file set.
  2. Play them all in sequence.

Expected behaviour All files should play sequentially, with minimal fuss. Maybe a resampler option to make the mixed sample rate files play seamlessly. And maybe a downmixer to handle the channel count changes among the surround files.

System:

Additional context This is probably an infamous test file set, since they're all such weird quirks of the FLAC format subset.

ludouzi commented 4 months ago

Thanks for making me aware of those test files; I'll go through each of them later.

Downmixing/upmixing and resampling options will be added once I get around to implementing DSP chains, so I'll see about handling those cases then.

Regarding embedded CUE sheets, fooyin currently looks for the CUESHEET tag. I will investigate supporting binary CUEs as well.

ludouzi commented 4 months ago

Okay, I've tested each of the files and found the following issues:

Sample 22 plays fine using all audio outputs. A crash occurs at the end of sample 21 (or switching to a different track mid-playback) when using the PipeWire output.

Fixing playback of sample 45 will be easy - we can just use a maximum value for duration. Samples 21 and 27 need more investigation.

kode54 commented 4 months ago

Sample 21, I'll file another issue, as I experienced this issue with PipeWire output on a different format.

kode54 commented 3 months ago

I just tested these again, the PipeWire output isn't even gapless any more on the identical format files demonstrating block sizes at the start.

Using 22c416ee

ludouzi commented 3 months ago

Looks like it's due to the buffer queue size, the calculation for which was recently changed. Resolved for me with https://github.com/fooyin/fooyin/commit/d4fca2e3852a72439b74f5f741e2687813d146a9.