Reading Sub-Channels from Lead-In

vbimport

#1

Hi,

I’m currently trying to read raw Sub-Channels from a CD-R’s Lead-In.
MMC-3 says, I should use LBA F0000000h, but it failed.
So I tried to use the address stored in the ATIP, but also failed.
My drive reports that it can read Sub-Channels from the Lead-In.
The CDB looks like this:

for LBA F0000000h and 1 sector per read:

cdb[0] = 0xBE                 ReadCD OpCode
cdb[2] = LBA >> 24 & 0xFF     (240)
cdb[3] = LBA >> 16 & 0xFF     (0)
cdb[4] = LBA >> 8 & 0xFF      (0)
cdb[5] = LBA & 0xFF           (0)
cdb[6] = sectors >> 16 & 0xFF (0)
cdb[7] = sectors >> 8 & 0xFF  (0)
cdb[8] = sectors & 0xFF       (1)
cdb[9] = readflags            (0)
cdb[10] = subch               (1, RAW P-W)

transferlength is 96 bytes

Does anybody know, what I’m doing wrong?
It returns SK: 5h, ASC: 21h (LOGICAL BLOCK ADDRESS OUT OF RANGE)
I use Windows XP and the SPTI.


#2

Maybe this also meant that if could read the 1st pregap (which before some considered this to be in the lead in area).

What drive are you using?

The error you get ‘LOGICAL BLOCK ADDRESS OUT OF RANGE’ is normal for drives that cannot read the leadin using readcd with LBA F0000000h.


#3

My drive is a “Samsung CD-R/RW SW-252B”.
Reading LBAs -150 to -1 also fails :confused:
So I guess, there is no other way of doing this?
If I wanted to copy a CD-R in DAO, I’d have to create the subs myself?


#4

If it cannot even read the 1st pregap then it’s probable that the report was false. I myself had success with only Plextor drives.

You mean RAW DAO(i.e. with subchannel data), then yes, you’ll have to generate the CD TOC, your self, which you can do with information from the READ TOC command.


#5

Alright, thank you.


#6

I myself had success with only Plextor drives.

Do you mean you can use READ CD command inside lead-in (not pre-gap)?

Thanks in advance.


#7

It was pointed out by someone on this forum can’t remember, who, but, yes, with my Plextor only, I can use it to read sectors inside the lead-in, which includes subs (2448 bytes), using special sector addresses: starting from F0000000h. Where I think F0000000h represents the starting address of ATIP (first lead-in) and increasing it obviously walks through the lead-in.

Not to be confused, but I can also read the 1st pregap, by specifying sector addresses -1, -2, … -139. For some reason on my Plextor I can’t read addresses -140 to -150.


#8

LBA in the range of -45150 (FFFF4FA2h) to -1 (FFFFFFFFh) shall be encoded as a two’s complement negative number. Values in the range 0 through ffff4fa1h shall be considered positive values. Values -45150 through 404849 are valid for CD media. Table 173 shows the MSF to LBA mapping.

I can’t introduce hexadecimals in LBA field in your tool, but have a 716 and a Premium, can you help me retrieve some TOC iterations?



#9

The MMC specs doesn’t really go into detail on addresses for which -268435455 (F0000000h) to -45151 (FFFF4FA1h) represents. But in my tests, it seems that F0000000h is a constant to represent the starting ATIP address, which is different on each CDR manufacturer. If you keep increasing, you will endup reading the first pregap and some track 1 data, before you reach the max -45151 (FFFF4FA1h). Going further, i.e. -45150 (FFFF4FA2h) will be in another range, which is not in lead-in because it’s 90:00:00 (m:s:f) as in the above table and they want that to mean the outer edge of cd.

Procedure to read sector in lead-in (try with your Plextor):

In “View Sector” turn on raw subchannel reading option, then and in the sector viewer, enter $F0000000, then $F0000001, increasing, etc, or just press “>” button.

It should give you funny looking sectors mostly 0s. If you look at the subs (turn on deinterleave subch data), the first 8 bytes are Ps, so should be all 0, next sets of eight bytes are Qs, it should be a recognisable TOC entry. You’ll notice that the TOC entries will repeat 3 times each. Normally the sectors are encoded as CDDA, but, sometimes on data discs the sectors are in CDROM format and you’ll see the sync header at the top.

If you go into “View TOC” select “Full TOC info”, which should give you interpreted Q raw TOC info. If you select “Display in raw Q format”, you’ll notice that these are the Q subchannel data and these can be compared to the ones you get in “View Sector”.


#10

Thank You Truman. You’re very patient.