andresch / trackfs

A FUSE filesystem that splits FLAC+CUE files into individual tracks
Other
55 stars 4 forks source link

trackfs.flactracks.FlacSplitException: failed to extract track #1 from file #32

Open beuguissime opened 2 years ago

beuguissime commented 2 years ago

Hi,

This is a very neat tool. Congratulations and thanks! I have been able to mount a single WAV+CUE file as a list of individual FLAC tracks and it plays just fine! ;-)

However, when I try to do the same with the single FLAC+CUE file (for the same album, the FLAC file being derived from the above WAV file), I get this error as soon as I try to play one track with ffplay from another terminal.

Any help or idea is welcome!

Cheers

Tested on Ubuntu 20.04 and with trackfs built using pip3.

$ trackfs /home/beuguissime/riptest /home/beuguissime/ripfs
Type "flac" for a usage summary or "flac --help" for all options
failed to extract track #1 from file "/home/beuguissime/riptest/WZi7lDz2DeUOBowkh8DNLwHcH5A-.flac"
Uncaught exception from FUSE operation open, returning errno.EINVAL.
Traceback (most recent call last):
  File "/home/beuguissime/.local/lib/python3.8/site-packages/fuse.py", line 734, in _wrapper
    return func(*args, **kwargs) or 0
  File "/home/beuguissime/.local/lib/python3.8/site-packages/fuse.py", line 834, in open
    fi.fh = self.operations('open', path.decode(self.encoding),
  File "/home/beuguissime/.local/lib/python3.8/site-packages/trackfs/fuseops.py", line 60, in __call__
    return super(TrackFSOps, self).__call__(op, self.root + path, *args)
  File "/home/beuguissime/.local/lib/python3.8/site-packages/fuse.py", line 1076, in __call__
    return getattr(self, op)(*args)
  File "/home/beuguissime/.local/lib/python3.8/site-packages/trackfs/fuseops.py", line 94, in open
    path = self.tracks.prepare_track(path, fp)
  File "/home/beuguissime/.local/lib/python3.8/site-packages/trackfs/flactracks.py", line 273, in prepare_track
    return self._extract_flac_track(path, fp, album_info)
  File "/home/beuguissime/.local/lib/python3.8/site-packages/trackfs/flactracks.py", line 196, in _extract_flac_track
    raise FlacSplitException(err_msg)
trackfs.flactracks.FlacSplitException: failed to extract track #1 from file "/home/beuguissime/riptest/WZi7lDz2DeUOBowkh8DNLwHcH5A-.flac"
andresch commented 2 years ago

Hi,

the error indicates that trackfs is not able to extract the first track from the flac file. Without access to the flac file the root cause is hard to diagnose. Any chance that you can provide me access to the flac file (or even better one just with white noise, so that we don't run into copy-right issues? Then I could have a look. I'm only using flac with embedded cue sheets, so in general it works.

Best, Andreas

beuguissime commented 2 years ago

Hi,

Thanks for giving me a bit of your time. Since my message, I did a bit a investigation, helped with the debug messages of trackfs, and understood that the command flac was indeed in cause. The issue is that my locale LC_NUMERIC is set to fr_FR and flac expects times in the format mm:ss,ss (note the comma, used in French as decimal separator) while trackfs passes times in the format mm:ss.ss whatever the locale is.

I fix the bug by temporary changing LC_NUMERIC to en_GB in the terminal. Maybe could you force the value of LC_NUMERIC in flactracks.py?

Best,