Ripping Yarns – Music, Samba, Ubuntu and Various Discworld Characters

Yes, I know this is supposed to be a blog about Oracle stuff. It’s just that, well, Larry’s been busy this week upsetting large chunks of the Open Source Community – MySQL; OpenSolaris; even James Gosling has had T-shirts printed up urging Oracle to “Let Java Go”. Suffice to say that, given all of this furore, I’ve concluded that I could do with improving my Open Source Karma a bit.
Fortunately, I’ve been busy this week, loading all of my newly inherited music collection onto by Ubuntu Server to enable playback from any other machine on the network. What follows is an account of my adventures.
It was a simple plan – rip all of the CDs to an existing Samba Share on the server and then find software that can read the format and allow playback on both Windows and Linux.

To start with, I had to choose a format to store my music.

Rythmbox and Vorbis

Rythmbox – Ubuntu’s default Music Player, itself defaults to a format called Vorbis ( files with a .ogg extension).
That seems an odd name for a sound format. Surely there’s no connection with Exquisitor Vorbis from the Discworld Novel Small Gods ?
Extensive research ( well, Wikipedia) confirms that this is, in fact, the case. Chris Montgomery ( the guy who started the project), must be a Pratchett fan.
Incidentally, the .ogg extension is not, apparently, a reference to Nanny Ogg which means you will be spared any references to The Hedgehog Song in this post ( apart from that one).
It would appear that Vorbis is a pretty good format when compared the other options available. It’s also pure open source and the Linux default to boot, so it’s a bit of a no-brainer in karmic terms to use it.
Incidentally, Rythmbox will happily play wma files if you’re so inclined ( and probably mp3s as well).

It’s pretty simple to configure Rythmbox to use a Samba share as it’s Media Library. Simply open it up and then go to the Edit menu and select Preferences.
Then click on the Music tab, click the Browse button next to the Library Location field, and select the relevant share from the available list.

You can use Rythmbox to rip CD’s to the Library. However, it does get a bit temperamental at times. It’ll decide that it doesn’t like a certain CD or track and start complaining about Invalid Mime Types.
At this point, I decided to look for something that would be a bit less judgmental about my musical taste.

Sound Juicer

More open source goodness – this app is primarily a CD ripper and it certainly has none of Rythmbox’s foibles on that score.
Installation was by means of Synaptic ( System Menu / Administration/ Synaptic Package Manager – enter sound-juicer in the Quick search field).
Once installation is complete, you have a new entry in the Applications / Sound and Video menu called…Audio CD Extractor. Er, not Sound Juicer then. Well, actually, it is. I’ve no idea why it’s not called that in the menu, but heyho.
Insert a CD and then open with “Audio CD Extractor”, and Sound Juicer pops up

Now go to the Edit Menu, select Preferences and set the Music Folder to the Samba share.
This setting is persistent so you only need to do it the first time you open Sound Juicer.
Now just click Extract, and Sound Juicer goes to work.

Rythmbox and Library updates

Despite having the option to “Watch my library for new files” set in Rythmbox preferences, it doesn’t seem to pick up when anything has been added to the library other than by Rythmbox itself.
To get around this, I had to open Rythmbox after ripping each album and go to the Music Menu, select Import Folder and navigate to the new album on the share.
To make this a little bit easier, I set the file listing in the Import File to Library Dialog to be by date ( latest first).

Music Brainz

Both Sound Juicer and Rythmbox use Music Brainz for downloading track information. Music Brainz is a freely available database of Album and Track information. For the most part, this means that both applications can instantly recognise the CD that you’ve just loaded and all of the tracks.
Sometimes however, there are CDs that are not in the Music Brainz database and both applications give you the opportunity to add it.
Another chance for big karmic plus points.
A couple of points to note about the screenshots that follow.
First, I’ve just learned something new about the Take Screenshot Application – when you tell it to grab the entire desktop, it does so….including itself. I really should’ve checked.
Secondly…you will no doubt be thinking “Barbie Girls 2. Interesting selection Mike, is there something you’re trying to tell us here ?” I found it in the street. It was a present from my mother…. look, do you want to know about this Music Brainz thing or what ?

Sound Juicer asking if I really want to own up to possessing this CD

The Music Brainz site

Enter the album or artist name

Does the track list match...and whatever happened to Jojo ?

CD Added....we promise not to tell anyone your secret

VLC

I’ve got all of my music onto the share ( and avoided any more awkward questions about my “musical” proclivities), now I need something that’ll run on Windows and Linux and recognise the Vorbis format.
Enter VLC – plays video as well as music, available for both OS’s, and is Open Source.
In Ubuntu, you can use Synaptic again ( type vlc in the Quick Search). For Windows, you can download it here
Now, I haven’t worked out exactly how you point VLC at a library ( it does have a huge range of configuration options), but I do know that, in Windows at least, you can just open a directory and it’ll happily play you’re vorbis files.
At this point, I could happily end the story. Rythmbox is a more than capable Music Player and I have a Windows application that’ll play the same files from the same source. However, if you wanted to standardize on VLC for all of your machines – whatever the OS, then things get a bit more tricky for VLC on Linux.
Whilst both Rythmbox and Sound Juicer will happily talk to the share, VLC refuses to see anything that’s not mounted locally. It’s a bit odd, because if you open the share in Nautilus and then right-click and open a directory with VLC, it works fine.
After a couple of hours wandering around the VLC interface vainly trying get it to see the share, I decided that the best way to achieve this would be just to mount it to the local filesystem.
At this point I can hear Blackadder saying “Am I mistaken Baldrick, or are the words ‘I have a cunning plan’ marching with ill deserved confidence in the direction of this conversation ?”
For “I have a cunning plan” read “Open a Terminal Session”.

Mounting a Samba Share locally

To mount a samba share locally, you require two packages – smbclient ( which I already had) and smbfs.
As we’re at the command-line anyway :

apt-get install smbclient smbfs

Note – after this, I had to reboot to get it all working. I’m not sure if this was something to do with these particular packages or whether there was some other issue, but I thought I should mention it, just in case.

Now you need to find out what shares are available

mikes@mikes-laptop:~$ smbclient -L mikeserver -U%

Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.4.0]



	Sharename       Type      Comment

	---------       ----      -------

	share           Disk      Samba Share

...

NOTE: you need to replace mikeserver with your server name or it’s IP address.
Next step is to create a mount point and mount the share.

First the mount point ( or “directory” to you and me) :

mkdir /home/mikes/server_share

Now mounting the share :

mikes@mikes-laptop:~$ sudo mount -t cifs //mikeserver/share /home/mikes/server_share -o iocharset=utf8,file_mode=0777,dir_mode=0777

[sudo] password for mikes: 

Password: 

mikes@mikes-laptop:~$

As if by magic, an icon now appears on the desktop for server_share.
There’s a pretty good guide to all of this here
which also goes into detail about mounting automatically on startup. I’ve not gone down this route as I don’t always have the server running when I boot the laptop.
To round off, if you want to unmount the drive :

sudo smbumount /home/mikes/server_share

Anyway, once it’s mounted on the local filesystem, VLC treats it the same as any other directory.
After all that, I’m off to relax and listen to a bit of Abba…er…I mean Motorhead.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s