Grabber

ethan on 2004-01-05T10:15:52

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.


LBA

bart on 2004-01-05T13:35:09

I think LBA is the acronym for Logical Block Addressing, a term anybody who has ever messed with hard disk settings in the BIOS, will already have encountered. As opposed to the old style cylinder/head/sector addressing, where a sector is accessed via 3 integer identifying numbers, all with a limited range; in LBA, each sector only has one unique integer ID, with no gaps in the range.

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 to linux/cdrom.h) and so I am now using LBA internally because dealing with just one value is more convenient than with three of them.