Re: CD-ROM Driver Design

From: Jens Axboe (axboe@image.dk)
Date: Wed Jan 12 2000 - 00:36:50 EST


On Tue, Jan 11 2000, JM Geremia wrote:
> Is it possible to perform reads through the block_dev interface with an
> audio CD in the drive? I have been playing around with this for a little
> bit and can't get ll_rw_block() to do it. I have only been able to read
> data off an audio CD using CDROMREADAUDIO. Is that correct?

Yes, you can only get the CDDA sectors through that ioctl.

> The reason I ask is because I'm in the processes of writing an audio CD
> filesystem. The tracks are available as .wav or .au files. So far,
> everything is working, but I cannot use the block buffer infrastructure
> because of the block reading problem.

Even if you could use the regular ll_rw_block infrastructure to
get to the data, you still have a big problem regarding returned
data. CDDA blocks are not a multiple of 512 (they are 2532 bytes)!
The CD-ROM driver itself can quickly be hacked to do this, but
that would get you nowhere.

> It seems to me that the kernel should be able to recognize and deal
> with audio CDs. Don't get me wrong, I'm not suggesting that the kernel
> should provide obvious user space functionality such as doing mp3
> encoding, etc, but the need for CD rippers seems extraneous.

What about jitter correction etc? To me an audio ripper is indeed
"obvious user space functionality".

> Any thoughts?

Yes, don't do it. There are other audio-fs variants around,
the only one I have looked at uses the CDROMREADAUDIO ioctl
internally and thus doesn't go though the block layer. Still
bad.

-- 
*  Jens Axboe <axboe@image.dk>
*  Linux CD-ROM Maintainer
*  http://www.kernel.dk

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:19 EST