Alright, I've made some progress with Audio CDs. I've successfully used the SCSI Read TOC command (0x43) to get a list of tracks and their starting position.
Now I'm having problems trying to get the raw audio data for those tracks, using either SCSI Read CD (0xBE), or SCSI Read CD MSF (0xB9).
If I request no fields at all, I get back a bunch of zeros, which makes sense. If I request no tracks, the status field (I'm using ATAPI, btw), just goes back to ready with no data request flag being set, which also makes sense.
But for some reason, if I request any fields (user data, ECC, headers, etc.), the CD spins up and then I get an error flag set in the ATA status port. Calling SCSI Read Sense Information either gives be a 0x0 sense key and sense code, or a 0x5 sense key and 0x24 sense code. According to the docs, this should be an INVALID FIELD IN CDB error, but I'm still trying to figure out which field it is complaining about. Maybe someone can give me some suggestions...
I've tried requesting just the User Data field (which is all that CD-DA has, so any other fields should be ignored anyway), and I've tried reading a single track starting with LBA 0, and LBA (75*60*9) to try to skip ahead to 9 minutes into the CD. I've also tried using the MSF version to pull from 00:00:00 to 00:00:01, and various other start/end points, and the results always seem to be the same.
I've been trying to troubleshoot this for a few days now, and I think I'm getting pretty close, but I thought I'd see if anyone has actually gotten this to work. Right now, I'm testing with Virtualbox, using the Host D: drive with "Passthrough" enabled. I may try some other VMs if I can't get this working, but I have verified that WinXP is able to play digital audio using this same configuration. (Disabling "Passthrough" causes WinXP to fail reading the audio data, however...)
I'm trying to read 2352 bytes of data (although I've also tried 2048 bytes, and 2 bytes, with the same results), but the error flag gets set before I even start reading data, so I don't think reading bytes is the issue.
Thanks guys. I'm open to any ideas or suggestions you may have.
The source is up on
http://ozone.codeplex.com/SourceControl ... dDrive.xml if you want to take a look. The code is all XML based, and is of my own design, so hopefully it is readable enough to understand. (It's essentially x86 byte codes, with an XML transform to make them readable...)