DeaDBeeF-Player / deadbeef

DeaDBeeF Player
https://deadbeef.sourceforge.io/
Other
1.6k stars 175 forks source link

Saving playlist that uses cuesheets is broken #2094

Closed deseven closed 5 years ago

deseven commented 5 years ago

Steps to reproduce the problem

  1. Add any album with cue (cue + flac/ape/etc).
  2. Try to save playlist to anything other than dbpl.

What's going on? Describe the problem in as much detail as possible.

M3U, M3U8 and PLS playlists will contain incorrect data if your active playlist contains any cuesheet files. Also, it looks like there is no way to load this data too (or i just don't know what format deadbeef wants to see).

Information about the software:

Deadbeef version: 1.0 (master) OS: macOS 10.14.3

Oleksiy-Yakovenko commented 5 years ago

Last time I checked, pls and m3u formats didn't support a concept of sub-tracks. Therefore deadbeef doesn't attempt to save anything crazy into them for the cuesheets (or other subtrack variations, like chiptune subsongs). I can see that a normal image+cue file gets saved just as a reference to the image file, and it can even load them correctly under perfect conditions, which is not a worst case scenario.

Anyway, do you have any suggestions what deadbeef could save in there instead?

deseven commented 5 years ago

Not sure about PLS, but there is no real specification for M3U/M3U8, so basically you can do anything you want :)

However, i tested cue+flac combination in m3u playlist in a couple of players.

CMUS (correctly saves/loads everything, including track positions in album):

cue:///Users/deseven/mus/Elliott Smith/1994 - Roman Candle/Roman Candle.cue/1
cue:///Users/deseven/mus/Elliott Smith/1994 - Roman Candle/Roman Candle.cue/2
...

Foobar2000 (incorrectly saves multiple cue entries by number of tracks, on loading you'll get a lot of dupes):

M:\Elliott Smith\1994 - Roman Candle\Roman Candle.cue
M:\Elliott Smith\1994 - Roman Candle\Roman Candle.cue
...

Clementine (saves/loads correctly, it probably looks for cue file with the same name and then compares track names in EXTINF against its contents):

#EXTINF:216,Elliott Smith - Roman Candle
M:/Elliott Smith/1994 - Roman Candle/Roman Candle.flac
#EXTINF:213,Elliott Smith - Condor Ave
M:/Elliott Smith/1994 - Roman Candle/Roman Candle.flac
...

I think Clementine does the best and closest to something you are expecting to see in a m3u file. However, this leads to a pretty complex internal logic and also not really bulletproof, so i'd suggest to go CMUS way as it's the most reliable and easy to implement.

If you don't want to do anything with it, at least adding a warning prompt (something like "you're saving your playlist in a format that doesn't support all of your playlist items. Some data will be lost, continue?") can be a good idea.

Oleksiy-Yakovenko commented 5 years ago

i'd suggest to go CMUS way as it's the most reliable and easy to implement.

it only stores the cue name, which is not enough. Deadbeef's algorithm uses heuristics to associate audio files with cue tracks, which depend on what files or folder the user has selected when loading the files into a playlist.

A better storage format for deadbeef would be to specify audiofile + position + length for each track.

deseven commented 5 years ago

it only stores the cue name, which is not enough

It saves cue file and a track number from it, i'm not sure what else you need from a playlist. The problem is that right now deadbeef just skips some data completely when saving to some specific formats, that way user loses their data.

Oleksiy-Yakovenko commented 5 years ago

yes, cue and track number is not enough.

because deadbeef finds cue tracks based on:

cue file(s) selected + audio file(s) selected. this information has to be saved in order to be loaded back.

however, this is inconvenient, and in the native playlists deadbeef just saves position+duration.

deseven commented 5 years ago

But cue file contains an audio file name (in a FILE command), why do you need to save it anyway?

deseven commented 5 years ago

Here: http://wiki.hydrogenaud.io/index.php?title=Cue_sheet

All cue sheets contain the following info:

  • The name & type of at least one file being indexed (an audio file, normally);
Oleksiy-Yakovenko commented 5 years ago

But cue file contains an audio file name (in a FILE command), why do you need to save it anyway?

Because deadbeef detects the file name based on the files present in selection, instead of blindly trusting the cuesheet.

Many if not most of the cuesheets just reference .wav file, while in reality the file has been re-encoded into whatever.

deseven commented 5 years ago

I've checked like a half of my collection, there are no cue files with incorrect references and personally i think it doesn't make much sense.

I tried to manually edit a random cue file and change the audio file extension inside it. Foobar2000 refused to play it with an error "Unable to open item for playback (Object not found)". Clementine failed to play it too (no errors, just skipped all tracks). In CMUS i wasn't even able to add this release anymore.

Oleksiy-Yakovenko commented 5 years ago

I don't understand what point you're trying to make.

Oleksiy-Yakovenko commented 5 years ago

After some discussion, we agreed that this is not a bug, and from perspective of supporting such feature it would be a duplicate of #1983