[Abcde-users] Problem with 'abcde -d disc.flac'

Matthias König mk at silverserver.at
Thu Nov 15 23:00:26 GMT 2018


Bjørn,

According to the MB data, your CD should have a pregap. The track
offset of track 1 is 182. I think with a leadin of 150 this should give
a pregap of 32.

https://musicbrainz.org/cdtoc/yuMJjTbdlu.0Ob4HtyobpewtX8U-


With this command you can test if your CD has a pregap:

$ cdrdao read-toc cd.txt


For a CD with pregap, the output looks like this:

Track   Mode    Flags  Start                Length
------------------------------------------------------------
 1      AUDIO   0      00:00:32(    32)     09:32:48( 42948)
 2      AUDIO   0      09:33:05( 42980)     09:29:05( 42680)

Found pre-gap: 00:00:32


And for a CD without pregap:

Track   Mode    Flags  Start                Length
------------------------------------------------------------
 1      AUDIO   0      00:00:00(     0)     20:44:45( 93345)
 2      AUDIO   0      20:44:45( 93345)     07:02:40( 31690)


On Thu, 15 Nov 2018 21:14:03 +0100
Bjørn Forsman <bjorn.forsman at gmail.com> wrote:

> Hi Matthias,
> 
> On Wed, 14 Nov 2018 at 11:44, Matthias König <mk at silverserver.at>
> wrote:
> > [...]
> > According to the data for your CD on the Musicbrainz website, the
> > disc ids and track offsets are correct when you read from the CD.
> >
> > You now know that the disc ids and also the track offsets are not
> > correct when you read from the flac file. (Number of tracks and
> > leadout are correct.)
> >
> > The offsets differ by 32 sectors. (1 second = 75 sectors, if I
> > remember correctly) There are CDs with a so-called pregap, which
> > means that the first track does not start at sector 0 but at sector
> > 32, for example.
> >
> > With the option -VV you can see if the CD has a pregap. Search for
> > this line:
> > makeids: PREGAP 0, LEADIN 150, LEADOUT 309237
> 
> With -VV option, from CD:
> 
>     Getting CD track info... makeids: PREGAP 32, LEADIN 150, LEADOUT
> 185053
> 
> With -VV option, from disc.flac:
> 
>     makeids: PREGAP 0, LEADIN 150, LEADOUT 185085
> 
> Ok, so it miscalculates PREGAP and LEADOUT from disc.flac.
> 
> I wonder if this error comes from writing the flac in the first step,
> or from reading the flac in the second step.
> 
> > You can also see in the cuesheet if the CD has a pregap.
> 
> I don't see any pregap-like text in the .cue file.
> 
> $ head -7 U2-October/October.flac.cue
> PERFORMER "U2"
> TITLE "October"
> FILE "October.flac" WAVE
>   TRACK 01 AUDIO
>     TITLE "Gloria"
>     INDEX 01 00:00:00
>   TRACK 02 AUDIO
> 
> $ grep -i gap U2-October/October.flac.cue
> [no output]
> 
> Does this mean the bug is in writing the flac and/or cue file? What
> does a .cue file with pregap look like? (According to the -VV run
> above, the original disc does have PREGAP 32.)

An example cuesheet from a CD with pregap:

PERFORMER ""
TITLE ""
FILE "" WAVE
  TRACK 01 AUDIO
    INDEX 00 00:00:00
    TITLE ""
    INDEX 01 00:00:32
  TRACK 02 AUDIO
    TITLE ""
    INDEX 01 09:33:05
  TRACK 03 AUDIO
    TITLE ""
    INDEX 01 19:02:10


And from a CD without pregap:

PERFORMER ""
TITLE ""
FILE "" WAVE
  TRACK 01 AUDIO
    TITLE ""
    INDEX 01 00:00:00
  TRACK 02 AUDIO
    TITLE ""
    INDEX 01 09:33:05
  TRACK 03 AUDIO
    TITLE ""
    INDEX 01 19:02:10


You can export the cuesheet contained in the flac file with this
command:

$ metaflac --export-cuesheet-to=- cd.flac


> 
> > I own a few CDs with a pregap. But with these only the disc ids are
> > calculated incorrectly when reading from the flac file. The track
> > offsets are calculated correctly.
> 
> And in my case, since I got this from original CD:
> 
> $ cat abcde.a309a30b/cddbdiscid
> a309a30b 11 182 19082 35557 57645 74005 91327 112280 122847 141040
> 158885 171790 2471
> 
> and this from disc.flac:
> 
> $ cat abcde.a109a30b/cddbdiscid
> a109a30b 11 150 19050 35525 57613 73973 91295 112248 122815 141008
> 158853 171758 2471
> 
> ... I have wrong track offsets too?

When reading from the CD and reading from the flac file, all numbers in
these files should be the same (disc id, number of tracks, track
offsets).


> 
> > In your first email you mentioned a patch. I wrote this patch. With
> > this patch all my CDs work, even when reading from a flac file and
> > even if the CD has a pregap.
> 
> Ok, so that patch solved the problem with _all_ your CDs? I've been
> running abcde-2.9.2 + that patch, but as you can see, my first CD
> (U2-October) doesn't work right. How lucky am I? :-)
> 
> > As far as debugging is concerned, I think the function makeids() is
> > a good starting point. I can not help you with debugging. I do not
> > own your CD. And besides, I am an abcde user and not a developer.
> 
> OK, thanks.
> 
> > Have you already tried other CDs? Maybe this problem only occurs
> > with this particular CD.
> 
> I haven't tried other CDs. This was my first CD to be ripped, I'd like
> to have a stable/working ripping process before continuing. Or at
> least a better understanding of why this cannot be fixed, if that is
> the case.
> 
> The flac image gets the same sha1sum on all runs (I have about 7
> copies now), so I think the CD drive reads it OK.
> 
> But you're probably right. The smartest thing is to rip whatever can
> be ripped and leave the difficult CDs for later. I'm just stubborn.
> 
> - Bjørn

Matthias



More information about the Abcde-users mailing list