world leader in high performance signal processing
Trace: » cd_ripping

CD Ripping

With the ability to interact with IDE devices now, a common topic that comes up is ripping CDs. Lets dive in.

Hardware Setup

There is a quirk at the moment with the addon card where you cannot hook up a slave device (typically a cdrom) without a master device (typically a hard drive). So if you are only hooking up one device, make sure your jumper settings has it set as master.

A typical setup is to have a hard disk hooked up as master with the cdrom hooked up as slave. That way you can rip the full cdrom to the hard drive before encoding.

For in depth hardware details, please see this page.

Software Setup

The standard ripping program in the Linux world is cdparanoia. However, since this application uses floating point and the Blackfin has to emulate all floating point instructions, we will use a fixed point implementation called dagrab.

This has been integrated into the uClinux-dist already, so you just need to select it in the user/vendor customization menu.

Miscellaneous Applications  --->
  --- Audio tools
  [*] dagrab

Ripping a CD

Running dagrab is pretty straight forward.

root:~> dagrab --longhelp
dagrab S0.513 -- dumps digital audio from IDE CD-ROM to riff wave files
Usage: dagrab [options] [track list | all]
        -v      verbose execution       --help          short help
        -i      display track list      --examples      examples of using
        -d device       set cdrom device (default=/dev/cdrom)
        -n sectors      sectors per request (8); beware, higher values can
                        *improve performance*, but not all drives works fine
        -J              turn jitter correction filter on
        -j delta        delta for jitter correction filter (24)
        -f file         set output file name: (-f - outputs to stdout)
                                embed %02d for track numbering (no CDDB mode)
                                or variables in CDDB mode (see below)
        -m mode         default mode for files (octal number)
        -s              enable free space checking before dumping a track
        -e string       executes string for every copied track
                                embed %s for track's filename (also see -f)
        -C or -N        use CDDB name, changes behavior of -f's parameter
        -H host         CDDB server and port (
        -D dir          base of local CDDB database
        -S              save new CDDB data in local database (implies -C)

        CDDB variables for -f and -e: (use lowcases for removing slashes)
                @TRK Track name
                @FDS Full disk name (usually author/title)
                @AUT Disk author (guessed)
                @NUM Track number
                @DIS Disk name (guessed)
                @GNR Genre
                @YER Year

To grab all the tracks:

root:~> dagrab -d /dev/hdb all
dagrab: Track 1 dumped at 8.23x speed in 00:00:24, jitter corrections off

dagrab: Track 2 dumped at 10.73x speed in 00:00:13, jitter corrections off

To grab track 1 and listen to it:

root:~> dagrab -d /dev/hdb -f - 1 | vplay


At the moment we don't have any documentation for encoding the raw wav files produced by dagrab into another format (like mp3, flac, ac3, etc…). You could use something like lame, but that is floating point based and so is quite slow.

Keep in mind that any encoding software you use should be fixed point based if you want significant performance. Floating point implementations will work, but again, not very well.


We have some pictures of the hardware in action.

cd-ripper-side.jpg cd-ripper-front.jpg cd-ripper-bottom-expanded.jpg cd-ripper-top-expanded.jpg