Skip to main content


Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Regarding cdparanoia terminology and computation (Read 548 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Regarding cdparanoia terminology and computation

I'm querying a CD as follows:

Code: [Select]
cdparanoia -sQ -d /dev/sr1

 11.     2603 [00:34.53]   256097 [56:54.47]    no   no  2
 12.    15655 [03:28.55]   258700 [57:29.25]    no   no  2
 13.    30220 [06:42.70]   274355 [60:58.05]    no   no  2
TOTAL  304575 [67:41.00]    (audio only)

That 'TOTAL' figure of 304,575 is measured in, what? exactly? Sectors? Bytes? Something else? If I divide 304,575 by the 4061 seconds of the recording, I get 75 -and I believe there are 75 sectors per second on Red Book CDs, so I *think* it's sectors, but I would appreciate confirmation from someone who knows what they're talking about!

I then rip the CD with the command:

Code: [Select]
cdparanoia -B -e -d /dev/sr1 --never-skip=40 -O 6 1>/tmp/rip.log 2>&1

...and when I tail the resulting log file, I see this at its end:
Code: [Select]
##: -2 [wrote] @ 358177847
##: -2 [wrote] @ 358179023
##: -2 [wrote] @ 358180199
##: -2 [wrote] @ 358180200
##: -1 [finished] @ 358180199


What are these numbers? They are several orders of magnitude greater than the number of sectors, so is it bytes read or something? When I divide the 358,180,199 by the earlier 304,575, I get a result of 1,175.999... and when I repeat this for other CDs, the same ~1176 multiplier comes up.

For example, using a second CD:

Code: [Select]
  4.    71291 [15:50.41]   187759 [41:43.34]    no   no  2
TOTAL  259050 [57:34.00]    (audio only)

...and then...

Code: [Select]
##: -2 [wrote] @ 304642800
##: -1 [finished] @ 304642799

And 304642799÷259050=1176, near enough.

So the ~1176 multiplier appears to be a constant, but I haven't been able to find any reference to what it is or what it represents. Can anyone shed light, please?!

By way of explanation, I'm trying to take the last number contained in the log file as it's produced and dividing it by some denominator that represents the maximum amount of work needed to rip the entire CD. So, in that last example, I want to take 259,050 and turn it into the 304,642,799 so I have a denominator. I am currently doing that by multiplying the 259,050 by 1176 and then subtracting 1175... and it seems to work OK and I could just keep on doing it 'blind', I guess. But I'd like to understand what each of the numbers I'm using actually represents and why the 1176 number keeps appearing.

Appreciate any insight, anyway.


Re: Regarding cdparanoia terminology and computation

Reply #1
Answering my own query (but would still be grateful for confirmation I've got the terminology and reasoning right!). I found this article:

If a frame or sector lasts 1/75th of a second, then a CD reporting a TOTAL of 304575 frames would last 304575÷75= 4061 seconds, which is 67 minutes and 41 seconds. The back cover of the CD that number came from says the music lasts for 67 minutes and 33 seconds -which, accounting for gaps, lead-ins and lead-outs seems close enough to me. So that "TOTAL" number would indeed appear to be a count of 'sectors' or 'frames' (and 'frames' seems to be the more correct terminology).

That article also mentions that "each sector (called a frame) consists of 2352 bytes of audio data (1176 16-bit samples, or 588 stereo samples)" -and that's the first mention of the magic 1176 number I've found. It would appear to mean that the numbers in cdparanoia's log output are of the *samples* being read, and since there are 1176 samples per frame, you multiply the TOTAL number by 1176 to derive the maximum number of samples contained on the disk.

It seems to all make sense in my head for the moment, anyway!