Ripping CDs: Transforming Physical Discs Into Digital Files
This Christmas, I was fortunate to come across an old CD of my favorite childhood album, Pinocchio enligt Sås o Kopp, at my childhood home. The album was made for a musical I attended at a very young age, so I have no memory of the live performance itself. However, the music on the CD brought back vivid memories from my early years.
Of course, I wanted to create a digital copy of the CD so I could listen to it on my phone. This process is called "ripping", and is perfectly legal as long as the acquired tracks are for personal use and not shared with anyone else. I prefer to use Whipper, a Python based CD-DA ripper built on the morituri project. Whipper offers the same functionality as Exact Audio Copy on Linux, ensuring that the tracks are ripped bit-perfect. It also verifies the integrity of the tracks by comparing their checksums with those of other rips of the same CD in online databases.
I used a simple Arch Linux live environment, booted from a USB stick, on my family’s computer as my Linux setup. It’s entirely possible to run a desktop environment or window manager in a live Arch environment, either by downloading it from the internet or by prepackaging it in the ISO using the archiso build tool. While Whipper doesn’t have a GUI, I managed just fine by working with a few command-line interfaces, switching between them using the Alt + Arrow keys. Another great alternative for multitasking in a CLI-only environment is tmux.
The Tutorial Part
The following requires you to load your optical disc drive with a standard, widely available CD - something like a Pink Floyd album or a similiar choice that is likely to be listed in online disc databases.
Using Whipper is straightforward. To start, run the command whipper drive analyze
. This prompts Whipper/cdparanoia to evaluate whether it can bypass the audio cache of your specific optical disc drive. Based on my experience, Whipper accurately identified the caching behavior of two different Asus drives, making Asus my preferred optical drive vendor.
To bypass the cache, Whipper employs several strategies: it can read overlapping chunks of data from the CD, request extra sectors, re-read previously read sectors, or, if supported by the drive, send a command to disable the cache directly. The purpose of bypassing the drive's read-ahead cache is to ensure 100 % accurate error detection, resulting in high-quality, reliable rips.
Next, you'll need to determine your drive's offset. You can do this by searching for your drive in AccurateRip's CD Drive Offset database or by running the command whipper offset find
. The most common drive offset seems to be +6, which has also been the case for my two Asus drives. Whipper automatically saves your drive's caching behavior and offset in its user-specific configuration file, located in the .config folder within your home directory.
All that remains is to run whipper cd rip
to start the ripping process. Before doing so, you might want to change your working directory to the location where you'd like the output tracks to be saved. Whipper automatically compresses the audio using the Free Lossless Audio Codec (FLAC), producing .flac files.
Thanks to advancements in digital storage, the days of relying on lossy formats like MP3s or OGGs are behind us. Keeping your rips lossless also ensures you can create a bit-perfect copy of the CD if you ever need to.
I used Secure Shell File System (SSHFS) to mount a directory from my Linux laptop to a directory on the live system. This can be done as long as an SSH server is running on the remote machine. Mount the directory like this: sshfs user@remote_machine:/path/to/folder /path/to/mountpoint