libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libcdio-devel] CD_MSF_FORMAT vs LBA on NetBSD


From: Thomas Schmitt
Subject: Re: [Libcdio-devel] CD_MSF_FORMAT vs LBA on NetBSD
Date: Sun, 09 Dec 2018 23:15:57 +0100

Hi,

> Are you able to do the Linux testing?

In principle, yes.
But you need to give me instructions about what to do exactly.

-----------------------------------------------------------------------

Working in advance:

  git clone https://github.com/vext01/libcdio-paranoia
  cd libcdio-paranoia
  git checkout start-track-num-not-one
  sh ./autogen.sh
  make

There is now a program
  ./src/cd-paranoia
which shows me its options when run.
("-d /dev/sr4", i guess. But how do i set an output file name ?)

  $ ../src/cd-paranoia -d /dev/sr4 -Q
  ...
  ++ WARN: error in ioctl CDROMREADTOCHDR: No medium found
  ...

(A souvereign CD program should be able to load the tray and to work
 around the Linux bug from january 2008 which disabled waiting after
 automatic loading. :))
Ok. Once again with loaded tray

  Table of contents (audio tracks only):
  track        length               begin        copy pre ch
  ===========================================================
    4.     2682 [00:35.57]        0 [00:00.00]    no   no  2
    5.        0 [00:00.00]     2682 [00:35.57]    no   no  2
    6.        0 [00:00.00]     2682 [00:35.57]    no   no  2
  TOTAL    2682 [00:35.57]    (audio only)

This looks quite wrong for now.

The code is in src/cd-paranoia.c, function display_toc():

    for( i=1; i<=d->tracks; i++)
      if ( cdda_track_audiop(d,i) > 0 ) {

        lsn_t sec=cdda_track_firstsector(d,i);
        lsn_t off=cdda_track_lastsector(d,i)-sec+1;

        report("%3d.  %7ld [%02d:%02d.%02d]  %7ld [%02d:%02d.%02d]  %s %s %s",
               i,
               (long int) off,
               ...
               (long int) sec,

I assume that track numbers 1 to 3 were not classified as audio tracks.
But why does "i" loop up to 6 when there are only 3 tracks?
Why is track 4 shown with the correct start and size ?

Something is wrong with the conversion of LBA and MSF.
MMC-3 table 333 prescribes:

   00/00/00 <= MSF <= 89/59/74 :  LBA = (M * 60 + S) * 75 + F - 150

   -150 <= LBA <= 404849       :  M = floor((LBA + 150) / (60 * 75))
                                  S = floor((LBA + 150 - M * 60 * 75) / 75)
                                  F = floor(LBA + 150 - M * 60 * 75 - S * 75)

I.e LBA 0 is 00:02:00, not 00:00:00.

The same cd-paranoia run with a test CD that has tracks 1 to 3 and
CD-TEXT keeps the drive blinking busily for 42 seconds before telling

  Table of contents (audio tracks only):
  track        length               begin        copy pre ch
  ===========================================================
    1.     2682 [00:35.57]        0 [00:00.00]    no   no  2
    2.     2682 [00:35.57]     2682 [00:35.57]    no   no  2
    3.     2682 [00:35.57]     5364 [01:11.39]    no   no  2
  TOTAL    8046 [01:47.21]    (audio only)

(Same track source files as with the CD that has track 4 to 6, obviously)

-----------------------------------------------------------------------

For comparision the output of cdrskin (which works by SCSI/MMC commands
emitted by libburn):

  first: 4 last 6
  track:   4 lba:         0 (        0) 00:02:00 adr: 1 control: 0 mode: 0
  track:   5 lba:      2682 (    10728) 00:37:57 adr: 1 control: 0 mode: 0
  track:   6 lba:      5364 (    21456) 01:13:39 adr: 1 control: 0 mode: 0
  track:lout lba:      8046 (    32184) 01:49:21 adr: 1 control: 0 mode: -1

I.e. sizes should be 2682 each. (I think i used three times the same file.)

The other CD looks the same, just with other track numbers.

-----------------------------------------------------------------------

I will try to solve this riddle in the next days.
If you have particular runs for me to test, then tell me (and also tell
what you expect to happen).


Have a nice day :)

Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]