Re: Digital Audio Extraction with ATAPI drives far from perfect

Jens Axboe
2006-01-09T09:28:30Z

On Sat, Jan 07 2006, Brad Campbell wrote:
> Sebastian wrote:
> >(please, don't forget to me and axboe@suse.de)
>
> Did I? I'm sorry, I was *sure* I hit reply-to-all.
>
> >>Yes, but now we need to find out why one interface fails while another
> >>works.. I have the same problem here using cdrdao when ripping entire
> >>disk images. I'd love to fix the real issue rather than work around it by
> >>having userspace use another interface.
> >>I would have thought that both interfaces should return the same data..
> >>
> >>Brad
> >
> >I think cdrdao can use SG_IO if you tell it to. Check their documentation.
> >Or did I misunderstand what you're saying?
>
> Slightly.. If I'm not mistaken, we have a piece of software (for arguments
> sake let's call it cdparanoia). The stock software uses the ATA or ATAPI
> interface and produces bodged reads, the modified version you have uses
> SG_IO and produces accurate reads.

It's the cdrom CDROMREADAUDIO vs SG_IO interface, there's not ata/atapi
specific interface.

> What I'm wondering is why the difference, and is there a problem with the
> ATA/ATAPI interface that leads to this that needs looking into.

Definitely, that's the big question. It could just be that cdparanoia
enables extra error correction/checking, which it can do since it
tailors the SCSI commands to its liking. Where as with CDROMREADAUDIO,
you're basically stuck with whatever is coded into the cdrom layer.

> *or* is it an inherent problem/limitation with that particular interface

Could very well be. Once could use blktrace to see what the commands
submitted to the drives look like and get some data out of that.

Sebastian, care to try one more thing? Patch your kernel with this
little patch and try ripping a known "faulty" track again _not_ using
SG_IO. See if that produces the same faulty results again, or if it
actually works.

diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 1539603..2e44d81 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -426,7 +426,7 @@ int register_cdrom(struct cdrom_device_i
cdi->exit = cdrom_mrw_exit;

if (cdi->disk)
- cdi->cdda_method = CDDA_BPC_FULL;
+ cdi->cdda_method = CDDA_BPC_SINGLE;
else
cdi->cdda_method = CDDA_OLD;

--
Jens Axboe