Saturday, April 14, 2018

CD - RIP

Anybody out there still ripping CDs?  Or is it just me. ;)

Last weekend I figured that a track was missing.

OK. Quick decision taken. ReRip that CD. 
Yep - I still keep my CDs in the attic. 

ReRipping "quickly" turned out into a major exercise. 




Intro  

I've been using dBPoweramp for the job in the past. I havn't been ripping CDs for a couple of years though. 

I do have dBP installed on a virtual Windows10 client on my Ubuntu server.

I quickly figured, beside having an outdated version and related license key. I'd have to pay $30 for an upgrade!?!? Hmmh. No better not.  I just need to rip once in while. I'll manage.
I then figured it'd be useless anyhow. Why?

The cdrom-drive is not properly recognized by it's HW identifier through Virtualbox and therefore "AccurateRip" fails to set the right drive-offset. A key feature to me.
There's no way to enter the required drive-offset manually into dBP. That's really bad.
After getting a rather bitchy feedback of that dBPoweramp designer, I left that path alone altogether.

No, I didn't feel motivated to give EAC under W10-Virtualbox a try after this. 

What a mess!

I kept going.

Next question. How is the situation on the Linux ripper market? It has never been great.
And I doubted that the market evolved a lot. I rather expected that the situation got worse.

I wasn't wrong with that expectation...

There are/have been several, some of them quite promising, projects out there, such as

ripperX, Rubbyripper, Morituri, Asunder and some more...

I learned, these are all pretty much dead - since years - by now. 
Some projects are still alive.  The most advanced of the bunch is ABCDE
However. 
ABCDE is not offering Accurate Rip support. You can apply a drive-offset though!
You'd need another tool that verifies the rip results against the Accurate Rip database.

Again. What a mess!!!

I then stepped over my potentially final chance - a fork of Morituri called Whipper.
It seemed to be maintained. Latest commits dated a couple of days back! Great.

OK. Decision taken. Let's try Whipper.

Whipper comes with two - to  me -  key features:

1. Accurate Rip
2. Automatic tagging 

It's a command line tool. Fair enough!

Whipper offers MusicBrainz tags only. Hmmh. 
However. Whipper at least tells you if there is a CDDB entry. It won't make use of these tags though. 
MusicBrainz tags are supposedly of better quality. On the other hand the MusicBrainz database is much smaller then CDDB. 
I read a user remark about Whippers "feature" of neglecting CDDB tags on the web: 
He said: "...better a low quality tag, than no tag - please, give the user the choice".  
I couldn't agree more to that!

I kept going.

On github I then saw numerous Whipper issue reports
Many of them still in progress or enhancements. 
Something like that is usually not a good sign. 

Anyway. I thought - keep going!

I then tried to install it manually. I failed. Another hour wasted. I didn't really intend to spend more time at this point on this manual-build-from-sources task.

Anyway. I thought - keep going!

Luckily I found a repo for Ubuntu. Last entry from January 2018. Wow. 
And even support for the latest Ubuntu. Let's give that a try.

Guess what!?!? It worked!

So far so good. At this point I could have called it a day.

I kept going.

Now the fun parts starts. 

The ripping!


I then was hit by the pretty much not existing Whipper documentation. 

What a mess!


Anyway. I thought - keep going.

Googling Whipper didn't help much. 
Googling Morituri did help a bit. 
The trial and error approach also helped a bit. 
And looking inside the code also helped a little.

I figured:
* Whipper rips flacs by default. Good. Check.
* Coverarts I'll fetch myself. That's not a big deal. Check.
* The AccurateRip Offset of my drive I had written down. Check.
* You can also  look it up. Fair enough. Check.


Hint: Don't try to use the useless "offset autodetect feature" of Whipper - it'll drive you nuts!

I kept going...

...and then after more than half a day of annoying digging and trying - I managed to get a Accurate RIP verified CD ripped and tagged under Linux.

The (MuiscBrainz-) tagging is all but satisfactory though. You need to use a tag editor to get your tags properly shaped up.

I strongly recommend puddletag for the job.  It's one of the rare Linux tools which is very well made.
The nice thing with puddletag: You can fetch and apply CDDB tags based on the CD
raw data. If MusicBrainz doesn't offer tags, you can apply CDDB tags afterwards with puddletag. 

WrapUp.

Looking at the bumpy road I've been walking during the day, I hope next time it'll 
take me just 10 minutes to get a CD flawless respectively accurate ripped under Linux.


To spare you (and me - next time) some effort I've written up a Whipper HowTo to be used on Ubuntu systems. 

It'll be command line from a terminal only! 

*******************************************************************************************************
Whipper HowTo (Ubuntu)

Process:

1. Install whipper
2. Find out the drive-offset of your drive
3. Define your target formatting - directory and files
4. Rip your CD
5. Rework the tags with puddletag
6. Fetch the coverart by running Google images search 

***************************************************************


1. Install whipper


sudo add-apt-repository ppa:spvkgn/whipper
sudo apt-get update


sudo apt-get install whipper


2. Drive-Offset

Look up your drive model and search for it on Accurate Rip.
Note: A positive offset will be used without sign later on!

3. Formatting

These are your formatting options for whipper:

**** track file variables  - applicable for the audio track file only

%t: track number
%a: track artist
%n: track title
%s: track sort name

Note: The extension .flac will be added automatically.

***disc variables applicable to cuesheet .cue, playlist .pls, logfile .log  + directory structure

%A: album artist
%S: album sort name
%d: disc title
%y: release year
%r: release type, lowercase
%R: Release type, normal case
%x: audio extension, lowercase
%X: audio extension, uppercase

My choice of variables for the directory and track is:

%A-%d-%y/%t-%a-%d-%n

Example:
Norah Jones-Come Away With Me-2002/01-Norah Jones-Come Away With Me-Don't know why.flac

The other files need the same directory setup and whatever other variables:

%A-%d-%y/%A-%d-%y

Example:
Norah Jones-Come Away With Me-2002/Norah Jones-Come Away With Me-2002.pls


Now, you're ready to rip.


4. Rip your CD

Fill in your data in below variables and then copy/paste them into the terminal:

######################################################################## OUTDIR="/tmp/whipper"
WORKDIR="/tmp"
DRIVEOFFSET="696"
TRACKFORMAT="%A-%d-%y/%t-%a-%d-%n" ## naming for target dir/audiofile
DISCFORMAT="%A-%d-%y/%A-%d-%y"          ## naming for target dir/.log/.pls/.cue
########################################################################

And now the actual rip command:
Below lists a single command line! Just copy/paste it.

########################################################################
whipper cd rip --offset="$DRIVEOFFSET" --unknown --output-directory="$OUTDIR" --working-directory="$WORKDIR" --track-template="$TRACKFORMAT" --disc-template="$DISCFORMAT"
#################################################################################

Note: The output-directory will be created by whipper!


Now you can move the new audio directory, to be found under OUTDIR = /tmp/whipper in above example, to your audiofile tree.


Task 5. and 6. of the process go beyond the scope of this article.


########

I hope you'll manage to make it work.

Good luck.


Enjoy.



######################################################################

Annex:  

whipper and flac compression

whipper applies the default compression level 5 of the flac conversion tool to the track
CL5 is not my preferred choice. I usually go for CL0. I'll show you quickly how to make 
CL0 the default compression level of whipper.

It's just a one-liner:

########################

sudo sed -i "s|'--silent',|'--silent', '--compression-level-0',|g" /usr/lib/python2.7/dist-packages/whipper/program/flac.py
###########################


And now you can enjoy flacs with compression level 0. ;)











No comments:

Post a Comment