April 20, 2011, 3:48 p.m.
posted by void
Get a Grip on CD Ripping
Use the Grip program to automate ripping audio CDs into music files.
The command line is definitely a powerful tool, particularly for automation, but it can also make doing a task like ripping a CD more trouble than it's worth, especially if you plan on tagging the resulting audio with metadata such as ID3 tags. While there are several frontends for command-line tools, Grip, in our opinion, is an excellent example of a GUI frontend that balances the power and configurability of the command line with the ease of use of a GUI interface. After you get to the end of this hack, your CD-ripping process will be so automated that once you start, you won't even have to pick up a mouse.
It is simple to install Grip: just install the grip package using your preferred package manager. Grip is a frontend in that, for the most part, it uses other command-line utilities behind the scenes to do all of the work and simply provides an easy-to-use interface to configure the commands it passes down to those tools. Because it is a frontend, Grip can make use of many different command-line CD-ripping and audio-encoding programs, and, as such, it supports ripping to a number of popular formats including MP3, Ogg Vorbis, FLAC, or even a custom encoder of your choosing. This also means that to take advantage of those tools, you will need to already have them installed, but Ubuntu's package manager will take care of the major dependencies.
Configure Ubuntu to Default to Grip
You could manually launch Grip each time you want to use it, but you can make Ubuntu launch it for you whenever it detects that an audio CD has been inserted. To do so, click SystemRemovable Drives and Media to open the "Removable Drives and Media Preferences" window. Then, where it says Command under Audio CD Discs (on the Multimedia tab), replace sound-juicer (and its arguments, if any) with grip.
To configure Grip, click the Config tab to reveal a number of subtabs that configure different Grip settings. The tabs you are interested in are CD, Rip, Encode, ID3, and DiscDB.
Configure CD options
The first tab, CD, lets you configure your CD device. For the most part, the default settings will work, but for the purposes of automated ripping, make sure that the "Auto-play on disc insert" option is off. To test whether Grip has the correct CD-ROM device, insert an audio CD and see whether Grip sees and can play it. If not, make sure /dev/cdrom is pointing to your correct CD-ROM device, often /dev/hdc or /dev/scd0.
Configure ripping options
The Rip configuration tab is where things start to get interesting. Because so many people are used to automated programs that turn their CDs into MP3s, they often don't realize that ripping is a two-stage process: first ripping the tracks from the CD into WAV files, and then encoding the tracks to MP3, Ogg, or whatever other format you wish. This tab controls the ripping stage of the process, and most of the options are pretty self-explanatory.
The first subtab, Ripper, lets you configure which CD-ripping program to use. Grip now includes its own version of cdparanoia by default, and we recommend that you use it unless you have a good reason not to. cdparanoia by default rips more slowly than most other ripping programs (on most of our CD-ROM drives, it rips at 2x), but what it loses in speed, it more than makes up for in accuracy. cdparanoia is slow because it is particularly thorough about getting every bit it can from the CD. If you rip with faster but less thorough ripping programs, you may notice pops or gaps in your tracks. Even on many of our scratched-up CDs, cdparanoia has been able to recover the track.
Once you choose your CD-ripping program, you can configure it further in the Ripper tab. In the case of cdparanoia, you can disable a number of its default options, including what it calls "paranoia" and "extra paranoia"how thorough it is about reading the CD. We recommend you leave these and the scratch-detection and repair options alone. The primary option in this subtab you should be interested in configuring is the "Rip file format" option. Here, you can tell Grip where to put and how to name the WAV files it rips. Grip uses a number of variables that correspond to metadata from the CD. Figure lists a number of the common variables and what they represent.
For example, if you stored your MP3s in a directory called mp3 in your home directory, you might put in the "Rip file format" field:
Decoded, that line would turn Track 10 of the London Calling CD by The Clash, called "The Guns of Brixton," into the file ~/mp3/the_clash/1979-london_calling/10-the_guns_of_brixton.wav.
With this subtab configured, click the Options subtab to get to other ripping options. There are a few options here that we like to enable, particularly "Auto-rip on insert" and "Auto-eject after rip." With these options enabled, when Grip is running it will automatically start ripping a CD for you when you insert it and then eject it when it's done. This means that once the rest of Grip is configured, you can set up a stack of CDs at your desk, start Grip, insert the first CD, and then minimize it and do something else. When you see that the CD has ejected, you can just replace it with another CD to rip and go on with what you were doing. Grip will handle the rest. It doesn't get much more automated than that!
Configure encoding options
The next main configuration tab is Encode. This tab lets you configure what kind of audio files Grip will encode the WAV files into. The first option, Encoder, lets you choose what encoding program to use. What you choose here depends heavily on what encoding programs you have installed and what kind of audio files you want. For instance, if you want to make MP3s, you will likely choose LAME, mp3encode, or your favorite MP3 encoder. We usually stick with LAME because it is fast and produces decent-quality MP3s. If you want to create Ogg Vorbis files, choose "oggenc." If you want to create FLAC files (a lossless audio codec so there is no degradation in quality), choose "flac." After you have chosen the encoder to use, make sure the encoder executable path points to the location of your encoder (the default should be fine here). The defaults for the next two options, the encoder command line and file extension, should be fine unless you choose to use a special encoder not directly supported by Grip. The next field, "Encode file format," takes the same type of information as the "Rip file format" field in the Rip tab. In fact, if you make sure to use %x as the file extension, you can likely just directly copy and paste from this.
In the Options subtab for Encode, you can configure some specific options for your encoder. Probably the most important option here is the "Encoding bitrate" option, which determines the bitrate at which to encode your audio file if you use a lossy encoding such as MP3 or Ogg. What you put here is largely a matter of taste, although the higher the number, the larger your resulting file will be. In the case of MP3s, some people can't tell the difference between 128 and 256 kilobits per second. For other people, the distinction is great. We usually use 192 or 256 kilobits per second here, but you may want to experiment with the output for your audio files and determine what bitrate is best for you; your choice may vary depending on the type of music you are encoding. In this tab, you also have the option to create an .m3u playlist file for each CD you rip and choose where to put it. Generally, the only other option we enable in this subtab is "Delete .wav after encoding." (.wav files are quite large, and once Grip has encoded them to MP3 or another format, there's no reason to keep the .wav around.)
Configure ID3 options
The next major configuration tab, ID3, lets you control whether Grip inserts ID3 tags into your audio files. Generally, this is a good thing, and you will want all these options enabled unless you want to go back later and manually set ID3 tagsan often tedious process.
Configure DiscDB options
The final configuration tab you might want to configure is the DiscDB tab. This tab lets you configure the primary and secondary CD database servers that Grip will query when you insert a CD. These servers contain information on many CDs, based on CD signatures. When you insert a CD, Grip will query this database and retrieve artist, disc, and track information for the CD so that it can automatically fill out the ID3 tags and name the files appropriately. We would recommend sticking with the default servers listed here unless you know what you are doing. Make sure that the "Perform disc lookups automatically" option is enabled here.
Rip a CD
Once you have configured Grip, the process to rip a CD is rather simple: just insert the CD into the CD-ROM drive. Grip will automatically scan the CD, retrieve the track information from your CD database servers, select all tracks for ripping, and start the ripping and encoding process. You can click on the Rip tab to monitor the progress of both the ripping and encoding to see how far along in the process you are. If for some reason you want to stop the ripping process, click the "Abort Rip and Encode" button.
As mentioned before, the nice thing about configuring Grip in this way is that you can let it run virtually unattended and just feed it new CDs until all your CDs are rippedwhich certainly beats typing long commands and editing ID3 tags by hand!