Bugzilla – Bug 8877
MP3 cue sheets are not gapless
Last modified: 2010-06-08 14:36:33 UTC
Created attachment 3685 [details] Flac file A customer is running into an issue where he has a long MP3, that contains multiple tracks in one file. He then has a Cue sheet in the same folder as the file that virtually splits the mp3 into seperate tracks, mainly to display what track is playing and not to split it to add gaps. The issue he is seeing or hearing is there is a sort of glitch between each track. It sounds almost like a sloppy transition between songs. This issue is occuring with a mp3 file + cue sheet, but not with flac files. I have tested a couple sample files from the customer and have heard this glitch or skip sound. I tried the MP3 file on a software based mp3 player and you cannot hear this glitch. I have attached a couple sample files and their corresponding cue sheets. There is an MP3 version of the file and a flac version of the same flle.
Created attachment 3686 [details] cue sheet for flac file
Created attachment 3687 [details] mp3 file
Created attachment 3688 [details] cue sheet for mp3 file
What version of SC did this happen with?
SqueezeCenter Version: 7.0.1 - 19705
Please retest with SqueezeCenter 7.1-22170 as I am unable to hear any issue with the attached sample files.
I have tested with the new version today and the problem still exists. You'll need to really listen carefully to all the transitions... the problem differs for each transition and is a "glitch" sound as if a few frames of the mp3 have been skipped.
Yeah there is definitely a bug, probably related to samples being dropped for LAME gapless.
Turns out the problem is that the location where we split the original file is not determined properly, it needs to avoid cutting an mp3 frame in half.
Ben, did this work with any previous version?
(In reply to comment #10) > Ben, did this work with any previous version? > I'm afraid I only bought the Squeezebox fairly recently so I have only had chance to test it with 7.0.1 and 7.1. Ah, I thought it would be to do with splitting the MP3, apologies for not mentioning that on the bug report. I mentioned it on the support request but forgot to on here. Out of interest, why does the mp3 ever need to be physically split/changed (assuming that is what's happening - maybe it's not)?
Here is a good thread on why splitting mp3 files without decoding is tricky to do correctly. http://www.hydrogenaudio.org/forums/index.php?showtopic=34848 The way SC does cue sheets is to split the track up into smaller 'virtual' tracks and send those to the player separately. So this has never worked correctly and will require more work to fix than we can do for 7.2. The reason we do it this way is that our architecture really only deals with individual files. Sending a single file to the player while displaying virtual tracks on top of it is possible but more work than the right fix for this bug. I will commit what I have so far which is to split mp3 tracks on a frame boundary and skip LAME headers in the first chunk which avoids gapless handling when it isn't needed. The additional work that needs to be done is to split the tracks accounting for the bit reservoir by dynamically adding a silence frame as well as dynamically writing a new LAME tag to skip the silence frame at the start of these chunks. Related to this bug is a new enhancement I filed, bug 9036, which is to support proper split points for VBR files.
Yeah, I'm aware of the difficulties with splitting mp3s. I read loads of stuff about it on hydrogenaudio a while ago. Thank you for the detailed response on how the Squeezebox currently handles this and what the resolution is. I appreciate it. I look forward to version 7.3 in the future then! :) Thanks again and good luck.
A workaround if you are willing to split your files until we can get this resolved. The pcutmp3 tool on HA cuts properly, rewrites the LAME tags, and results in perfect gapless playback with SC 7.1+. http://jaybeee.themixingbowl.org/other/pcutmp3.jar Discussed at great length in this thread: http://www.hydrogenaudio.org/forums/index.php?showtopic=35654
== Auto-comment from SVN commit #30854 to the slim repo by agrundman == == http://svn.slimdevices.com/slim?view=revision&revision=30854 == Fixed bug 8877, gapless playback for MP3 cue sheets