Cool, I am making nice progress with accessing my CDROM drive (see last journal). The key was understanding CDROM_LBA and CDROM_MSF. These two are address formats. The first one (not yet totally sure about that, though) means the position on the CD is given as a frame-number, whereas CDROM_MSF is minute/second/frame.
So now I can grab the audio data on a CD and play it with play --channels=2 --rate=44100 --format=s --size=w cd.raw
. I have yet to figure out how I can grab the beginning of a CD. The first few seconds are missing. Also, it wont grab anything when I use CDROM_LBA. All this is right now living in a preliminary Perl module Device::CDROM
. Once it is done (and I should decide to put it on CPAN), I need to rename it to Device::CDROM::Linux
. I always give them the wrong name in the beginning.
Re:LBA
ethan on 2004-01-05T17:10:40
I encountered LBA for the first time, I think, when I was using fdisk. But I never bothered to figure out what it would mean.
LBA on CDROMs is exactly what you described: addressing happens only by frames and not through minutes, seconds and additionally frames. Those two can easily be transformed into each other (one second consists of 75 frames according tolinux/cdrom.h
) and so I am now using LBA internally because dealing with just one value is more convenient than with three of them.