Reading TOC

Hi,

Now you’d have thought this one would have been simple, well yet again i find myself confused. I can happily read the TOC with the format set to 0, so it just returns start address and adr / ctrl information. However to extract audio from, for example, a CD-Extra the start address of the lead-out won’t give the end of the last audio track. So i’m trying to experiment to reading the full TOC.

So my command block is:

0x43, 0, 2, 0, 0, 0, 0, 0x10, 0, 0, 0, 0

(which is also an example in the Fuji6r091.pdf datasheet). But from this i get varying results.

0x00 0x7b 0x01 0x01 0x00 0x00 0x00 0x00 0xc8 0x14 0x05 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

Or this,

0x00 0x7b 0x01 0x01 0x00 0x00 0x00 0x00 0xc8 0x14 0x05 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xcc 0xf4 0xff 0xbe 0x84 0xf4 0xff 0xbe 0x1a 0x6e 0x36 0x40 0x70 0x04 0x00 0x00 0x2c 0x8e 0x39 0x40 0x94 0xf4 0xff 0xbe 0x77 0x6e 0x36 0x40 0x68 0xa4 0x0a 0x08 0x70 0x04 0x00 0x00 0x94 0xf4 0xff 0xbe 0x3f 0x3d 0x36 0x40 0x9c 0x6e 0x39 0x40 0x00 0x00 0x00 0x00 0xa4 0xf4 0xff 0xbe 0xfc 0x6e 0x36 0x40 0x00 0x04 0x00 0x00 0xcc 0xf4 0xff 0xbe 0xf4 0xf4 0xff 0xbe 0x9c 0x6e 0x39 0x40 0x00 0x04 0x00 0x00 0xc8 0xc5 0x09 0x08 0xf4 0xf4 0xff 0xbe 0xcd 0x4a 0x36 0x40 0x20 0x8e 0x39 0x40 0xcc 0xf4 0xff 0xbe 0x00 0x04 0x00

seemingly randomly with exactly the same command block.
Apart from the first 4 bytes the rest doesn’t match the datasheet at all, so i canget at the info i need.
Any ideas of what i might be doing wrong??

thanks
Andrew

Hi knuckles,

I could be way ‘off’ here, but…

You seem to have 0x10 in byte 7. I believe this should be in byte 6 instead. Byte 6 is the track/session byte field. I believe I just put 0x00 in this field as well when I read ‘full’ TOC. Sorry I can’t check right now though. If I remember correctly, the first A2 point you get back will show the leadout of the first session, if that is what you are needing.

Good luck.

I just checked (in debug).

I have “43 00 02 00 00 00 00 09 30 00” in my CDB. This gives me back TOC data for both sessions of a CD-Extra. There are 2 sets of A0, A1 and A2 pointers returned (one set for each session). I am using a Plextor SCSI 40/12/40. Not all drives support the read TOC ‘full’ command.

Hope this helps.

Hmmm guess mine doesn’t support it then - that CDB gives the same results i was getting with the last one - i.e. pretty much rubbish. I’m using whats reported as matshita cw-8123 - anyone know if these definitely don’t do it?

I’m a bit stuck as to how to work out all the tracks and sessions on the disc if i can’t get a full toc reading, any ideas? I’d like it so that no matter whats on the cd in terms of sessions etc, if there’s an audio track i’d like the program to recognise it…

Thanks for trying for me anyway - its much appreciated.

Andrew

OK i apologise for any wasted time! It was me, i’d just changed that function from an internal char array buffer to passing in a char pointer and hadn’t changed the scsi command from sizeof(buffer) in the bytes field - looks like the drive does support full toc reading - when you can actually program properly!

Thanks again

Andrew