8-current + USB CD-ROM drive + CAM layer audio extraction from CD

Hans Petter Selasky hselasky at c2i.net
Sat Sep 26 10:39:15 UTC 2009


Hi,

It turns out the xmms is not able to read audio from CD's due to a removed 
IOCTL. cdparanoia is however able to read audio from CD's after a recompile 
including libcam.

static int
cdrom_read_audio(int cdfd, int lba, char *buf, int btw)
{
        int rtr = 3;
        do {
                struct ioc_read_audio ira;
                ira.buffer = buf;
                ira.nframes = btw;
                ira.address_format = CD_MSF_FORMAT;
                ira.address.msf.minute = lba / (75 * 60);
                ira.address.msf.second = (lba / 75) % 60;
                ira.address.msf.frame = lba % 75;
                if (ioctl(cdfd, CDIOCREADAUDIO, &ira) >= 0)
                        return ira.nframes;
        } while (--rtr >= 0);
        return -1;
}

The "CDIOCREADAUDIO" is not implemented in the FreeBSD 8/9-current kernel from 
what I can see.

--HPS


More information about the freebsd-current mailing list