AdSense Mobile Ad

Saturday, January 17, 2009

Ripping audio CDs on Solaris

Tonight I decided to make the usual FLAC backup copy of the CDs I recently bought. Usually, I performed this operation from a Debian laptop from where I moved the FLAC files into the NFS-shared music directory. Tonight, after some libscf-related C programming I'll tell you about in a future post, I decided to do it on my Sun Ultra 24 running Solaris Express Community Edition build 104. I inserted the CD into the reader and typed:

$ cdda2wav -B -O wav -paranoia

Unfortunately, the ripped wav files were completely unuseful: there was only silence and some clicks in them. During the ripping process I indeed had noticed a strange behavior. Despite one CPU was constantly at 100%, ripping was slow compared to the ripping process which I usually perform on my laptop, which is much less powerful than my workstation. The CD, moreover, didn't spin up at full speed, it remained pretty quiet. Those things caught my attention while cdda2wav was ripping the first song. I then killed the process and removed the -paranoia flag. In less than 10 seconds the CD was ripped successfully and I knew it was not possible. I listened to the wave files and they appeared empty, despite the size which instead was the expected. I tried again with the -paranoia flag and the first song took more than 2 minutes to be ripped. There was clearly something wrong and libparanoia output left no doubt.


100% track 1 recorded with audible retry/skip errors (206.1% problem sectors)
100% 0 rderr, 8 skip, 8631 atom, 1835 edge, 377 drop, 5 dup, 0 drift
100% 3149 overlap(0.5 .. 74)

This output was no good. After half an hour of:
  • playing with cdda2wav options
  • installing cdrtools from Blastwave
  • thinking about substituting the CD reader
  • banging my head against the wall
I finally did what I should have done from the beginning. Reading the manual. In the Solaris documentation cdrw is used to rip audio CDs. I knew it. I always use cdrw to write audio CDs, but not to rip them and I didn't think about it. One more chance to it:

$ cdrw -x -T wav 1 01-track.wav

and there was the ripped wav file, absolutely perfect. I don't know what's the problem with cdda2wav and I'm not spending one minute more to discover it. It seems to be broken somehow and cdrw perfectly works. With a couple of lines the job was done:

$ for i in `seq number-of-tracks` ; do cdrw -x -T wav $i $(printf %02d $i)-track.wav ; done
$ for i in *.wav ; do flac $i; done

No comments: