Reading the Lead-in and Lead-out of a CD

vbimport

#1

I was recently searching for a program that would enable me to shift the location of the Lead-in and Lead-out values of a CD. I came across a program called CDTOOLS.EXE that seems to fit this description created by Jeff Arnold(Goldenhawk). CDTOOLS.EXE is a newer program that includes the program TOC.EXE, which is the program in the bundle that I would be interested in. TOC.EXE supposedly allows the user to change the beginning and end values of where the Table of Contents of a CD would be located to allow this operation. My dilemma is that all links I’ve come across to download this software lead me to a non-existent ftp or http host site that has been removed(so it appears). If anyone has any related information as to where I could find a copy of either of the two programs or an alternative program that could perform a similar opperation their comments would be greatly appreciated.


#2

Do you want to read the lead-in and lead-out of a CD or are you interested in specifiying where they are written when you burn a CD-R? Not many drive’s firmware will allow reading lead-in or lead-out directly (raw). It’s probably similar when writing.


#3

Yes, I was interested in the reading capability of reading a lead-in or a lead-out directly(raw). From my understanding the Table of Contents is repeated three or so times in the Lead-in portion of the CD, which is located in the first two seconds of the CD which is not permitted for user data. Some CD writing softwares due to error can write the lead in slightly before or after due to some type of “jitter”(probably not the correct term for this description since that’s usually for a read) or write shift. I was trying to do a low level data read of that area. From what I’ve found when searching the subject Plextor seems to have the best drives for reading something along these lines. I was also interested in a program that would extend the read of a CD past where the CD said it’s end was in the Primary Volume Descriptor(LBA 16) or in general to allow a read past the defined end point of data.


#4

The lead-in of a CD is typically 2-3 minutes long. Inside this area, the TOC repeats itself over and over for the full duration of the lead-in. The TOC tells where all index 1 points of all tracks are. It also tells where lead-out starts and if there might be another session on the CD.

The first thing after lead-in is the index 0 point (pause) of the first track. According to CD spec, this must be no less than 2 seconds long. There is no valid user data in the first 2 seconds of pause. Tracks may or may not have a pause (except the first track as mentioned above). Tracks other than the first track may contain valid user data in their pause (even the first 2 seconds). One exception to this is when the disc is written as track at once (TAO). In TAO, every track must contain at least 2 seconds of pause that can not contain valid user data. After the first 2 seconds of pause of TAO discs, there can be valid user data in the pause.

I have not found a drive that allows me to issue read commands in the lead-in where I want. All I can do is ask for the TOC and get what the drive returns. We mostly use Plextor drives for our systems and some of the models will allow us to read lead-out sectors. The amount of lead-out sectors that I can read depends on the drive model and firmware of the Plextor drive.

The PVD (LBA 16) only describes the sectors that belong to the ISO-9660 file system (what if the CD was audio only and contained no ISO). There could be times where only 1 minute of the CD is part of the ISO and the other 70 minutes are not (as an example). So, the end of the CD according to the PVD is not where lead-out will always start.

Hope this makes sense. If not, just post your questions.

RichMan


#5

A very nice description RichMan.

Just to add a little… as for first 2 seconds of pause (pregap), it’s true for CDROM spec, but not CDDA. With most audio CDs the music actually start in the first pregap and the specs allows this. I can’t remember but I think it’s also for the postgap as well.

For lead-in, lead-out, I don’t know of another program that allows for some one to read those areas. I have my own tool which does, but only if your drive supports it:
http://www.cdtool.pwp.blueyonder.co.uk/downloads.htm

I’ve only tested it working on a Plextor drive.
Most of the newer Lite-on drives only support reading first pregap and lead-out.

To read first lead-in:
Go into ‘Sector viewer’ and type in $F0000000 for the sector input box. You’ll notice the address in the data, at the top corner, 3 hex values indicates that you are some where between 90:00:00 to 99:59:74 (MSF) and there may be an A(hex) prefix. This is lead in area.

To read lead-out:
You’ll need to find out where the lead-out starts. Go into ‘View TOC’ and click ‘Read TOC’ write down the ‘Lead-out Starting LBA’ value. Go back to ‘Sector viewer’ and put this value in the sector input box. With luck you drive may be able to display the sector.

To read first pregap:
Enter a sector no. between -150 to -1.


#6

Thanks for the detailed descriptions guys. Truman, I’ll see if I can get ahold of a Plextor CD drive to work with your program.


#7

Truman, would you be able to tell me the model of your Plextor drive you have that is compatable with your software? I tried your software and found it very useful and interesting for the TOC read, Disc info, and Sector Read, but with the three CD drives I had on hand I was unable to read at the defined lead-in and lead-out positions returned from your software.


#8

I have an old Plextor CD rewriter model 8432T. But I think any Plextor rewriter should do the trick. Maybe it’s because you are using Plextor reader only versions.


#9

Of the three CD drives I have in my possession one was a CD Read only, one was a DVD/CD Read only, and was was a CD ReWritable. Unfortunately, none of the three were capable of reading the lead-in or lead-out sectors. I’ll work on getting ahold of a Plextor CD ReWrite drive so I can finally access the specified sectors. Thanks for all the help with your comments/software. If you or anyone reading this post can identify their CD drive as a drive that is compatable with your program for reading the lead-in/lead-out values I would be interested in that information as well so I have an idea of a few drives I could purchase.


#10

Thanks Truman.

The CD-DA spec I’m looking at shows that the first piece of music can not start before the index 01 of the first track. It also shows that this first pause area (index 00) must be 2-3 seconds long. This comes from a drawing showing the layout of an audio CD. It is labled “EXAMPLE OF ENCODING IN CHANNEL P AND Q”. It is on page 45 of my spec.

On page 42 it states “The first piece of music is preceded by a pause encoding of 2-3 sec…”.

I’ve seen many discussions about music in the first pause. But it is a violation of the spec in my opinion. One has to consider the fact that the Q channel and main channel are not locked and therefore have a skew. This is perhaps why there appears to be audio in the pause. If after proper CIRC decoding there is audio in the first pause, then I feel this is wrong.

Rich


#11

Oh I see. I take back about being in the spec - my source was from disscussions I had with various programmers in the past.

Yes you’re right it has some thing to do with the skew of CD readers. But the problem is that how come some audio CD’s give different skew for the same CD reader? What I mean is that I have found some have actually more samples in the pause area than others.


#12

I have wondered the same thing about varying skew. I discussed this with some of our engineers and the answer was that the CIRC decoding circuitry/logic on a drive causes this. Some drives have more/less delay in the main channel decoding. It sure seems to cause a lot of confusion :confused: It would have been better if the spec would have mandated some parameters in this area. But hey, back then there were only crude CD audio drives that could care less about such things.


#13

Yes. I have to say, even now it’s not really a big deal since many of my music CDs start of silent anyway.