On Fri, Aug 12, 2011 at 9:45 AM, Stef Bon <[email protected]> wrote:

> Hi,
>
> I've written a FUSE fs to read tracks on a cd, using licdio. I used to
> work with cd-paranoia, till I've found libcdio.
>
> More info about it you'll find here:
>
> http://linux.bononline.nl/wiki/index.php/Fuse-cdfs
>
> Basically in this fs there is one read to read the cdrom, and it
> processes read requests (from the fuse fs read call) in a queue, and
> calls
>
> cdio_cddap_read()
>
> to read the requested sectors.
>
> Maybe you should try it.
>
> (as you can read I'm not ready with it, but it works )


I just tried compiling from git sources.  I get
    make: *** No rule to make target `cdfs-io-thread.h', needed by `cdfs.o'.
 Stop.

And there is no C header file cdfs-io-thread.h. Perhaps you meant to add
this to the git repository? (As I write this there is only one initial
commit to the git repository.)

As far a the C coding style and organization, the code looks good!

>
> Now I have some questions:
>
> a. is there a way to identify the cd uniquely.

Right now it stores
> cached files in
>
> %cache_directory%/tracknr-xx.wav
>
> Now when I unmount, I ant to be able to keep the cached file. I would
> like to have an unique id per readable cdrom, like an uuid per
> partition on a harddisk. Is there one?
>

A CD can have a ISRC also known as a MCN
<http://www.gnu.org/software/libcdio/libcdio.html#SEC61> (Media
Catalog Number). In practice many CDs do not have this. If I wanted to
ensure uniqueness, I'd probably create a SHA1 hash for each track and do
something with combining that for each of the tracks to form a disk hash.



>
> b. the command above just reads the sectors requested. Is there a
> better way to read from a cdrom. Remember my fs caches everything, so
> possibly "in between" results (which are not requested and thus
> ignored in the final result) maybe used in my fs, as long as it's
> clear which sector is read.
>

The libcdio call
read_audio_sectors<http://www.gnu.org/software/libcdio/doxygen/read_8h.html#390c39f5b9cbeaebb14c94cc013ffba3>allows
you to read a large number of sectors in one call. Depending on the
CD-ROM driver this may wind up into several smaller calls. If the CD-ROM
support MMC, then read_audio_sectors turns into a MMC READ_CD call. I don't
know that one can be more direct than this.


>
> Thanks in advance,
>
>
> Stef
>
> _______________________________________________
> Libcdio-help mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/libcdio-help
>
_______________________________________________
Libcdio-help mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/libcdio-help

Reply via email to