Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ethan (3163)

ethan
  reversethis-{ed. ... rap.nov.olissat}

Being a 25-year old chap living in the western-most town of Germany. Stuying communication and information science and being a huge fan of XS-related things.

Journal of ethan (3163)

Monday January 05, 2004
05:15 AM

Grabber

[ #16640 ]

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I think LBA is the acronym for Logical Block Addressing [webopedia.com], 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.
    • 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.