Tuesday, June 27, 2006

Getting a Grip

One of most useful thing your computer can do is to take a giant slew of CDs, compress all the songs into mp3 format, and put a couple hundred songs on one disk, all playable from your car stereo.

This is especially useful when you can shock your children by showing that you know all the words to Dancing in the Dark (which for some reason is considered modern).

The key to this trick, of course, is that you need to convert the songs into mp3 format. This isn't the preferred compression trick in the Open Source world, where we'd rather use something like ogg, but my Ford doesn't speak caveman, so mp3 it is.

In the past, I've used sound juicer, which worked well in both Fedora Core and Ubuntu's Hoary Hedgehog, once the proper libraries for mp3 conversion were installed. But once I upgraded to Dapper Drake, Sound Juicer stopped ripping to MP3s, and would only rip to OGG or an uncompressed format. The problem seems to be with the various versions of the gstreamer pluggins available in the Ubuntu Multiverse. I've got a conflict somewhere.

I could yank all of the gstreamer stuff and rebuild, but gstreamer is at the heart of Rhythmbox, my preferred Linux music player. Under Hedgehog, Rhythmbox had trouble playing MP3s that were, in its humble opinion, undersampled. This doesn't occur in Dapper, and the reason is the updating of the gstreamer MP3 libraries.

So what to do? File a bug report and wait for a fix? There have been various fixes discussed in the Ubuntu forums, but none worked for me. So the answer is to look for another CD ripping program. I did, and found grip. It's available from Ubuntu's warehouse of fine software, so I did

$ sudo apt-get install grip

and there it was. (Well, if you want to be picky, it's at /usr/bin/grep.

Grip works fine, but it takes a bit of configuration and a bit of getting used to. The getting used to part is one of the hard parts. Grip rips the files on the CD to .wav format and then "encodes" them to MP3 or OGG, erasing (if you want) the .WAV file. That's fine, but you have to remember that the encoding is still going on after the CD has been ejected, so you need to keep Grip running until the encoding is finished.

The configuration isn't much worse than Sound Juicer. First, you have to pick a directory and a format for the Wave files, Config => Ripper => Rip file format. I chose ~audio/albums/%A/%d/%t_%n.wav, where "%A" is the artist, "%d" the album title, "%t" the track number, and "%n" the song title. (All of this is explained in the Grip on-line help. It's actually useful help, unlike many open-source projects.)

Second, we need to get the "encode" options right (Config => Encode). The defaults work pretty well, grip looks for the lame utility. We just need to pick a file name format, and I chose (duh) ~/audio/albums/%A/%d/%t_%n.mp3. You can also look at the Options tab here and click the ones you like.

Finally, we go to Config => ID3 and click the "Add ID3" and "Add ID3v2" boxes. This puts all of the song title/track/artist/album information into the MP3. This lets the Ford display this information, meaning the Child can figure out what the Hell song Dad's singing.

OK, there are a lot more options, but those are the basics. And it works. Grip rips CDs to MP3s in about the same time as Sound Juicer, and Rhythmbox plays them just fine.


Anonymous said...

You could read the help for soundjuicer which explains how to add ripping to mp3s to soundjuicer. The instructions are very clear, too.

rcjhawk said...

Yes, I could. In fact, I think I mentioned I did it before under Fedora. However, something isn't working right.

For one thing, when I did, as required, Edit Profiles => New, an editing box pops up for, oh, about ½ second, and then vanishes. At which time sound-juicer locks up.

I can edit the "Lossy CD" box to change the ogg format to mp3, and put in the appropriate strings, but that gives MP3s that play incomprehensibly.

Yes, I should report this, and someday, when I have time to really track the bug, I will, but it was a heck of a lot easier to get grip set up. Consider it a market-place win for the gripper.