Goodbye CDparanoia, hello Icedax

I had a simple task to complete today. I had to digitize a few CDs into flac files. I had been putting this off for so long that I wanted to get this over with.

Fortunately, KDE provides the audiocd:/ kioslave for this very purpose. What this does is when the audio CD is opened in the file manager, instead of showing the actual cdda files, it shows a bunch of virtual files and folders that looks like this.

audiocd

As you can see, it does a CDDB look up to get the track names and metadata and tries to make things very easy. The settings for the encoders and the naming scheme used for the tracks and folders are configured in System Settings. One merely need copy the files or folders to a local destination and the computer will rip the CD and transcode the contents transparently.

In theory, this should make for a very pleasant experience. However, in practice, I encountered several bugs. First, the audio CD kioslave needed the package cdparanoia to be installed. Since this wasn’t automatically handled by the package manager, I filed a bug report and installed it manually.

Next, for some odd reason, the tenth track of every CD would issue an error saying the flac file wasn’t found. I couldn’t figure out why this was happening. So, since the kioslave was not working perfectly, I decided to do this from the cli. Here is a simple script to rip flacs from a CD.

#!/bin/bash

TEMP=`mktemp -d`
cd $TEMP

cdparanoia -B -s
for file in *.cdda.wav
do
  flac "$file" --delete-input-file --output-name="${file%.cdda.wav}.flac"
done

rm -f track00.flac

mv $TEMP $HOME/Desktop/kcdrip$$

exit 0

This simple script copies over the CD contents as wav files to a temporary location, uses the flac encoder to produce the final flac files and drops the folder in my Desktop directory. Great.

This worked pretty well, until I hit my Wednesday Night, 3 AM album. Now, cdparanoia simply refused to read from the CD, giving an output as shown below.

cdparanoia III release 10.2 (September 11, 2008)

Ripping from sector       0 (track  1 [0:00.00])
          to sector  182759 (track 15 [2:46.57])

outputting to track01.cdda.wav

 (== PROGRESS == [                  +++VV| 012679 00 ] == :^D * ==)

The progress bar shows several errors towards the end of the first track. Normally, this shouldn’t be cause for too much undue concern, but for the following reasons.

  • First, my CD is in pristine condition. There’s not a single scratch on the surface. The source of these errors is mystifying.
  • Second, it took about two hours to copy the first track alone. Yes, really.
  • Finally, vlc had no trouble playing the first track.

The same issue repeated for the second track, too, with even more errors detected by cdparanoia. I spent the better part of an afternoon and barely had anything to show for it! Falling back to the kioslave fared no better. I still didn’t have my flacs. Digging up the source code on the project website projects.kde.org revealed that the kdemultimedia-audiocd-kio was using cdparanoia, too. In hindsight, this is rather obvious. I just filed a bug about this!

So, as long as the cdparanoia package isn’t fixed, my chances of digitizing this CD weren’t looking too good. A bit of googling led to an alternate solution. The command icedax (or its symlink, cdda2wav) is provided by the cdrkit package. I tried it and it worked much better than cdparanoia. It reported zero errors for this CD and in fact, even worked faster than cdparanoia. The modified version of my simple script is as follows.

#!/bin/bash

TEMP=`mktemp -d`
cd $TEMP

icedax -D /dev/sr0 -B -s
for file in *.wav
do
  flac "$file" --delete-input-file --output-name="${file%.wav}.flac"
done

rm -f *.inf

mv $TEMP $HOME/Desktop/kcdrip$$

exit 0

Fixing KDE’s audio CD kioslave to use icedax instead of cdparanoia is somewhat beyond my skill level at the moment. I’m not sure if I should report this as a bug.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s