Monday, 11 November 2013

Rip CDs at the Command Line Using ABCDE

Ripping CDs at the command line is clearly the manly way to do it, so let's puff out our chests and take a look at ABCDE - A Better CD Encoder.

The package install installed by default on any distributions that I've ever used, but it is in the repositories for most. You can install it as I have on OpenSuSe using Zypper but if you are on a Debian based system you can use "apt-get" or "yum install" it on a Red Hat based system. You can also download the source code here.

 linux-97l1:~ # zypper install abcde  
 Retrieving repository 'devel:languages:perl' metadata ....................[done]  
 Building repository 'devel:languages:perl' cache .........................[done]  
 Retrieving repository 'openSUSE-12.3-Update' metadata ....................[done]  
 Building repository 'openSUSE-12.3-Update' cache .........................[done]  
 Loading repository data...  
 Reading installed packages...  
 Resolving package dependencies...  
 The following NEW packages are going to be installed:  
  abcde cdparanoia   
 2 new packages to install.  
 Overall download size: 117.3 KiB. After the operation, additional 315.4 KiB   
 will be used.  
 Continue? [y/n/?] (y):   

You will notice in bold that the abcde package is going to be installed along with cdparanoia. This is used to match your CD to an entry in the CD Paranoia database in order to give you the ID3 tags that all MP3 users have come to expect. There's very little more annoying about ripping CDs than finding that your CD doesn't have a matching entry, so no ID3 tags. Well CD Paranoia has probably delivered for me than any other service, although your mileage may vary.

You can launch abcde from the command line, simply by typing "abcde". With no options specified, it will use the defaults specified in the configuration file, from /etc/abcde.conf. The default option to rip your cd is using the ogg vorbis codec, which is fine if you have a player that supports it. I prefer the freedom hating mp3 codec, so you will need to ensure you have the LAME package installed if you want to export your files as mp3. Instructions for this and other restricted formats are here for OpenSuSe users.

When you run the program, the CD will spin up in the drive and the cdparanoia database will be queried for a match:

 mugwriter@linux-97l1:~/Music> abcde  
 Grabbing entire CD - tracks: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15  
 Retrieving 1 CDDB match...done.  
 ---- Various / The Best Of Blue Note ----  
 1: Miles Davis / Rocker  
 2: Art Blakey & The Jazz Messengers / Moanin'  
 3: Bud Powell / Un Poco Loco  
 4: Charlie Parker / Omithology  
 5: Count Basie / The Kid From Red Bank  
 6: Sonny Rollins / Tune Up  
 7: Thelonious Monk / Criss Cross  
 8: Donald Byrd / Witchcraft  
 9: The Horace Silver Quintet / Finger Poppin'  
 10: Kenny Burrell / This Time The Dream's On Me  
 11: The Paul Chambers Quintet / Softly, As In A Morning Sunrise  
 12: John Coltrane / Lazy Bird  
 13: Cannonball Adderley / Dancing In The Dark  
 14: Jimmy Smith / The Way You Look Tonight  
 15: Clifford Brown / Cookin'  
 Edit selected CDDB data? [y/n] (n):   

If you're happy with the metadata that has been sourced for your music, press enter. If you have a multi-artist CD you will be asked how you would like the ID3 tags to be organised:

 Looks like a Multi-Artist CD  
 1) Artist / Title  
 2) Artist - Title  
 3) Title / Artist  
 4) Title - Artist  
 5) Artist: Title  
 6) Title (Artist)  
 7) This is a single-artist CD  
 Which style of multiple artist entries is it? [1-7] (1):   

Once you have chosen your desired formatting for tagging, the encoding process will begin:

 Grabbing track 01: Miles Davis / Rocker...  
 cdparanoia III release 10.2 (September 11, 2008)  
 Ripping from sector    0 (track 1 [0:00.00])  
       to sector  13900 (track 1 [3:05.25])  
 outputting to /home/simon/Music/abcde.ec11610f/track01.wav  
  (== PROGRESS == [               | 013900 00 ] == :^D * ==)    

If you have the necessary codec installed, you can edit /etc/abcde.conf and change the default option from ogg to mp3. Open the configuration file using a text editor, remove the comment and change "OUTPUTTYPE=ogg" to "OUTPUTTYPE=mp3." Another default option is the quality of the output. Disk space is cheap nowadays, so I always rip at 320kbps. To do the same, look in the /etc/abcde.conf and uncomment the line that begins "LAMEOPTS=" and change it to "LAMEOPTS='-h -k -b 320' " (being careful to surround the options in single quotes).

Now when you run abcde you should find that you are ripping your CD at 320kbps mp3. By default abcde outputs to "pwd", so whichever directory you are in when you run abcde is where you are going to see the directory of temporary wav files and also the finished output. This is something you can change in your /etc/abcde.conf if you so desire, however I tend to just change into my Music directory before I start.

Welcome to Jazz Club. Nice. 

There are lots of options in the abcde configuration file so have a good look around. It's very well commented and you may find something you would like to change to suit your needs. It's sometimes easy to forget that the program is essentially a bash script, it's capable of so much. It's a great tool and what I use all the time for ripping CDs with a minimum of fuss.

Saturday, 9 November 2013

How to: Install Google Music Manager on OpenSuSe

I like OpenSuSe, it's pretty much what I always have installed on my laptop.

I also like listening to music while I'm working and Google Music is where I keep all of my music. I've got it all on a USB hard drive at home as an additional copy but I like to stream it in Chrome so that I don't have to carry the drive around. That means I need to be able to upload to Google. Whenever I try to install the .rpm for Google Music Manager from the Google website, I run into dependency errors that prevent me from completing the installation.

I've tried installing libqtwebkit from the repository but the installation still fails with the same error. I've also installed qtwebkit from an rpm to see if that will fix it, but still the installation process fails. Is there anything I can do to get this installed? I've got lots of CDs to rip and upload, as well as lots of mp3 files that I've bought (yes, really) from Amazon that I need to get up to Google Music. Is there any other way of doing it without having to build a Windows VM.

Well actually, yes there is. We can just install it without qtwebkit from the command line using the "no dependencies" option:

linux-97l1:~ # rpm -i --nodeps /home/mugwriter/Downloads/google-musicmanager-beta_current_x86_64.rpm

So while it has now been installed with a missing dependency, it still works and I can still get my music up to the Google flavoured cloud and I can still download my entire library if I wish. Everything seems to work fine, I believe QTwebkit is only used for rendering and formatting web pages. So while the installation perhaps isn't as stylish as it may be with all dependencies, it does work. 

That's really all we need right?