Tuesday, June 22, 2010

My digital audio guide - the perfect rip

This first part of my complete guide to digital audio covers getting your audio CDs onto your computer. This is also the part where many things can go wrong as I outlined in my previous post.

If you are like me, you treasure your music collection and plan to enjoy it for many, many years.  Therefore (to me), taking the time to make sure you get the most out of your collection is time well spent.  Fortunately, once you have a working setup, copying CDs to your computer is a totally routine task.  Do it right the first time and you'll never have to do it again (hopefully).

The actual process of reading an audio CD is called ripping and I'd like to go over the steps which should give you a "perfect" rip of your CD.

I currently use Windows for this purpose and I recommend using EAC (Exact Audio Copy) for the main ripping process and FLAC for compression.  The EAC software is a little tricky to setup, but does a really good job and is well worth the effort.

NOTE:  This post has been updated for an awesome new feature in EAC (1.0 beta 1) - specifically automatically finding album cover art!

NOTE 2:  An even newer version of EAC (1.0 Beta 2) is now out.  There are some differences.  See below for comments (especially the change in strings used for the external compressor).

There are, of course, many other ways to accomplish this same goal (on Windows and other platforms).  This process also uses my recommended audio format of Cue Sheets.  Cue sheets aren't the most convenient way to access your music, but they are (IMO) the best way to archive you music.

Step #1:  Install the software
Note: Windows 7 (32-bit) workaround:
  • Flac install (and FLAC frontend) throws an error.  Download the vb6 controls from microsoft here.  You don't have to install it, just extract the one file MSCOMCTL.OCX and place it in c:\windows\system.  You can use the program 7zip (my favorite zipping tool) to do this.  Then follow the instructions here to register the file.  Now you should be able to launch the flac frontend without an error.  See this thread as a reference only.   I don't often use the flac frontend, it just is an easy way to test that FLAC installed correctly. 
Note: Windows 7 (64-bit) workaround is similar, but paths are a bit different.  See this link.

Note: A Windows 8 workaround is needed to enable some of the plugins.  See this link.

Also, download the following helper script that I've written and place then in a folder anywhere on your computer.  I recommend creating an "Audiotools" folder.  If you follow the steps later in my guide you will be putting several more files in this Folder.
This script will take care of a few things that EAC won't do for us automatically (and keeps the ripping process as simple as possible).

Step #2:  Configure EAC

This is going to take a while, but don't panic.  It is easy as long as you go slowly.  It also gives you a bit of an appreciation for how powerful EAC really is.

When you first launch EAC, it will run through an initial setup process and ask you a few questions in pop-up windows:
  • CD-ROM Selection:  Make sure it selects your drive that you will using for ripping
  • Extraction Preferences: Select "I prefer to have accurate results"
  • Feature Database: Accept the default values for your drive (you can change them later)
  • Encoder Selection:  Select "nothing right now, I will configure it later manually"
  • freedb Configuration:  Enter your email address
  • Filename Configuration:  Accept default
  • Done:  Select "I am an expert"
After EAC is running, we are going to go through some one-time configuration steps:

Select "EAC->EAC options..." and open the "Extraction" tab

  • (optional) Check "Skip track extraction after duration longer than"
Select "EAC->EAC options..." and open the "General" tab

  • Check "On unknown CDs" and "automatically access online freedb database"
  • (optional) Uncheck "Beep after extraction finished"
  • (optional) Check "Eject CD after extraction finished"
Select "EAC->EAC options" and open the "Tools" tab

  • (optional) Check "Retrieve UPC / ISRC" codes in Cue Sheet ..."
  • Check "Automatically write status report after extraction"
  • Check "On extraction, start external compressors queued in the background"
Note:  there is a new feature (relating to album art work) called "Convert BMP image files automatically to JPG".  This appears to be checked by default and I've left it that way.

Select "EAC->Compression options" and open the "External Compression" tab

  • Check "Use external program for compression"
  • Set "Parameter passing scheme" to "User defined Encoder"
  • Set "Program..." to "c:\Perl\bin\perl.exe"
  • Set "Additional... options" to the "wav-2-cue-flac.pl" file you downloaded above, add a space, then put the string '"%m" "%s"'.  For EAC 1.0 beta 2 or newer use "%genre%" "%source%" instead.  Keep the double quotes.  See the picture at above:
  • Uncheck "Use CRC check"
  • Uncheck "Add ID3 tag"
  • Check "Check for external program return code"
(NEW feature) - configure album art work search

Select "EAC->Metadata Plugin Options..."

I changed the setting "Open cover designer after successful freedb retrieval" to "Always".

This setting will do as it says and automatically allow you to search for and select album cover art when you first load a CD that you want to rip.

Note:  there is no "OK" button for this options window.  I assume this is a bug that will be fixed later.  I simply closed the window and the setting seemed to stick.

 Now you need to do a one-time configuration of AccurateRip
  • Pick a common pop CD and put it in your CDROM while EAC is open.  You should get a pop-up about accuraterip.
  • Select "Configure" and wait for the results.  If the CD you selected isn't in their database, you may have to repeat the process with another CD.  If it is successful, select OK and your drive information (read offset) will be configured automatically.
Just a few more steps are we will be finished configuring EAC.

Select "EAC->Drive options and open the "Offset / Speed" tab

  • You should see that some options are grayed out due to AccurateRip's configuration"
  • (optional) Check "Overread into leadin and Leadout only if your drive supports this feature (mine doesn't) - see below.
  • (optional) Check "CD-Text Read capable drive if you drive supprts this (mine doesn't).  If your drives can read CD-Text, you can extract track information from certain CDs directly instead of retrieving them online (e.g. freedb)
Note:  Since CDs with CD-Text may be hard to find, the easiest way to see if you drive supports this feature is to try to create one.  I'll cover this in the post on burning CDs.  Usually, if your CD burner supports writing CD-Text, it will also support reading it.   Once you create a CD, just let EAC read it, then select "Database->Get CD information from->CD-Text".  If this option is gray-ed out, then the CD doesn't have CD-Text (and therefore your burner doesn't support it).

Select "EAC->Driver options" and open the "Gap Detection" tab

  • Change "Gap/Index retrieval method" to "A"
  • Change "Detection accuracy" to "Secure"
NOTE:  On some rips, you may find that gap detection takes too long.  Simply abort the extraction and try changing the of these values.  First try different methods "A, B or C".  If that doesn't work, try backing off the accuracy to "Accurate or Insecure".  All this means is that the pre-gap before each track might not be detected correctly if you have to drop the accuracy (a minor annoyance).  Leave it on "Secure" if you can.

Configure secure mode

Click on "EAC->Drive options" and select the "extraction tab".

    • Part #1: Use a known good audio CD and click on "Detect Read Features".  This will take a few minutes while it tests the features of your drive.  When it is done, apply the results.
    • Part #2: Find (or make) a scratched CD.  I just take a small bit of tape an put it on a CD near the middle.  Click on "Examine C2 Features" and let EAC examine the CD.
    • If EAC says that your drive reports C2 errors, then you can leave the C2 option checked.  This will speed up the ripping process without loss of quality.
    Step #3: Ripping procedure
    • Launch EAC
    • Put a CD in the CDROM drive, it should auto-detect it and begin to load the track information
    • If there are multiple matches in the track database, EAC will let you choose the one that you want.
    • (NEW) the "CD Cover Art Downloader" window will pop up and allow you to search for album art.  Select the image size you prefer (e.g. medium) to start the search.  If you find the album cover want, just select it and click on "Transfer selected cover to EAC".
    • Next, if the track, title, artist, year, or genre fields are not correct (see image below), it is best/easiest to correct them now before starting the rip.
    • Ignore the "freedb" field, it will not be used nor saved in the cue sheet.
    • If you are ripping a compilation album, make sure "Various artitst" is checked.  You should also have each track title include BOTH the artist and title separated by a "/".  Try ripping a common movie soundtrack and you should see what I mean.
    • If all of the CD information (and cover art) looks good, select "Action->Copy image & create CUE sheet->Compressed"
    NOTE:  If you don't like any of the values above, (before starting the rip) - you can simply select "Database->Get CD Information from->remote freedb".  This will clear the CD information (including artwork) and allow you to reload it.
        • A "Save Waveform" window will then pop-up.  Select the top-level directory where you want your music stored.  Leave the filename/type alone, only the folder you select is important.
        • During extraction, you will see EAC progress, along with any errors it encounters

        NOTE:  When the extraction is finished, you will see a black command window pop up at the end and FLAC compressing the resulting WAV file.   You will also see that the EAC extraction window has an OK button.  You may click on the OK button anytime, but note that the log file isn't written until after you click OK.  Do not close the other command window as it will close all by itself when done.  If you don't hit OK before the compression finishes (don't worry) the command window will wait for you and exit when it finds the log file.

        When you click on OK, you will get a status window from the rip.  This info and more will be automatically saved permanently in the log file.  Notice that AccurateRip reports that we have a perfect rip (with a high confidence).  Just click on OK.

        If EAC has any trouble running the external compressor script, go back and check that you entered the correct information in the EAC->EAC Compression Options (External Compression) Tab".  See above.  You can always run it by hand to debug it if you like.

        If all goes well, EAC and my external script will automatically create a folder hierarchy for storing your ripped CD(s).  The files will be stored under a Genre folder, followed by an Artist Folder, and finally an Album folder.

        BTW:  If you don't like this folder hierarchy, you can change it.  For example:  to organize your library by artist and album (w/o genre), use the -d option.  In this case, the command-line options of wav-2-cue-flac.pl should be '-d artist\\album "%m" "%s"'.  The string after the -d tells the script what folders to create.

        The resulting album folder will contain four (or five) files:
        1. An edited cue sheet (named the same as the album title - with a .cue extension)
        2. A single compressed FLAC file (named the same as the album title - with a .flac extension)
        3. A log file reporting the success and accuracy of the rip.  Having a log of the rip gives you something to look at later if you think there is a problem (or to compare two rips).
        4. The original (unedited) cue sheet produced by EAC (named CDImage_CUE.txt).  This is for your reference only.
        5. NEW - "folder.jpg" (cover art image)
        If EAC doesn't find the right cover art, after rip is done, you can still go to your favorite album art web site and save a copy of the album cover in the album folder manually.  I always name the file "Folder.jpg" or "Folder.png" as appropriate (a standard Windows naming convention).  I have used Google images to find most of my artwork.

        You now have a cue/flac pair that is a nearly perfect replica of your original CD.

        Wait a minute! Why isn't it perfect?

        One side effect of the read offset (assuming it is not zero) is that some of the beginning (or ending) audio data is shifted into what is called the lead-in or lead-out area of the audio CD.  This area is not always readable by a CDROM.  Ignore for the moment that we are talking about only a handful of audio samples that are most likely zero anyway.  Note this has no effect on data between tracks, just the few samples at the very end or beginning of the CD.  Who cares, right?  Well, I do and I'm a perfectionist!

        So, to get a truly perfect rip your CDROM needs to support the ability to overread into the lead-in/lead-out areas.  There is an option (under EAC->Drive options... Offset/Speed tab) to allow overread (disabled by default), and fill missing samples with silence (enabled by default).  You can try changing these values if you CDROM supports overreading.   To test this you'd need a CD with non-silent samples in the beginning/end (hard to find).

        If your CDROM doesn't support this, the only thing you can do is shop around for a better CDROM.  Most detailed reviews of CDROMs report if this features is supported.  Also look for the ability to report accurate C2 errors and, in general, good DAE performance.   This is one reason that I've always opted for Plextor drives in the past.  However, with DVD and BluRay obsoleting CDROMS, it is harder to find a good drive for ripping audio.  Keep in mind though, that this issue is relatively minor even for obsessive people like me.

        Final Step:  Enjoy some music!

        If you want to play the cue file directly right away, the simplest program that I've found is foobar2000.  Just make sure you enable Cue file playback by deleting the "*.CUE" exclude under preferences in Media Library and Shell Integration.

        VLC, surprisingly enough, plays cue files just fine (and it is a darn good video player too!).

        Winamp also works using a (rather dated) plugin (cueplayer), but it is a pain to setup and buggy.  You can, of course, just play the flac file, but you won't get any of the track information that way.

        However, my favorite way to play Cue Sheets is via SqueezeCenter.

        I'll cover transcoding, burning and other tools in upcoming posts.


        1. I really like this software: http://www.smartcdripper.com. You can try it for free. It lets you rip CD with just a couple of clicks.

        2. Great intstructions, wonderful and clear detail! Thanks so much for getting me up and running on this wonderful and powerful and confusing program but simple with you directions! You saved me so much time!!!

          Thanks so much!


        3. Your script could be made to work with the new EAC V1.0 beta2 with the simple addition of a line to rename *.jpg to folder.jpg before attempting to move "folder.*" (or maybe just make it *.jpg) into the target directory.
          Just a suggestion. I would prefer folder.jpg but it's your script, I will leave it to you as I do not know Pearl.
          Thanks for your great work! Keep it up.

        4. I've updated the post and script to support EAC V1.0 beta 2 as well as Windows 7 64-bit. Enjoy!


        Copyright (c) 2010 CuttingTheBills.com. All Rights Reserved.