Strict Standards: Redefining already defined constructor for class wpdb in /home/jzero/public_html/troy/wpblog/wp-includes/wp-db.php on line 56

Deprecated: Assigning the return value of new by reference is deprecated in /home/jzero/public_html/troy/wpblog/wp-includes/cache.php on line 36

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /home/jzero/public_html/troy/wpblog/wp-includes/cache.php on line 384

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl($output) in /home/jzero/public_html/troy/wpblog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl($output) in /home/jzero/public_html/troy/wpblog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el($output) in /home/jzero/public_html/troy/wpblog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el($output) in /home/jzero/public_html/troy/wpblog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el($output) in /home/jzero/public_html/troy/wpblog/wp-includes/classes.php on line 560

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl($output) in /home/jzero/public_html/troy/wpblog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl($output) in /home/jzero/public_html/troy/wpblog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el($output) in /home/jzero/public_html/troy/wpblog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el($output) in /home/jzero/public_html/troy/wpblog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el($output) in /home/jzero/public_html/troy/wpblog/wp-includes/classes.php on line 684

Deprecated: Assigning the return value of new by reference is deprecated in /home/jzero/public_html/troy/wpblog/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/jzero/public_html/troy/wpblog/wp-includes/theme.php on line 540
The Hizzle of T-Fizzle » Blog Archive » A Linux Tale

A Linux Tale   


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jzero/public_html/troy/wpblog/wp-includes/formatting.php on line 82

I have not uploaded MP3s to my player in over a year.  I have a Rio Karma which at the time of its manufacture was one of the most amazing DAPs available.  It actually still is pretty impressive - 20GB of storage and the ability to play just about any audio format - ogg, mp3, wma, flac, etc.  It even came with a dock that has an ethernet port on it that allows you to stream music from it to a web browser.  I got it for dirt cheap on Overstock around the time Rio quit the DAP business.  A sad sidenote is that I bought it concurrently with a Rio Pearl for X.  I decided not to get the Karma for X becuase I read that there were some reliability issues with the Karma and I didn’t want to get her a dud.  Well the Pearl started flaking out in a few months, the Karma has been fine for years.  Go figure.

One quirk of the Karma: it does not communicate as a normal USB device.  You can’t just plug it into your computer and drag files onto it.  It needs its own driver and you have to use the Rio Music Manager program to load music onto it, because it has its own file system and maintains its own index database (it doesn’t just index the media files).  Rio claimed it to be “linux supported” but what this means is that you can manage it via the web interface which is cumbersome and somewhat slow.  Rio never actually released a linux driver or a linux version of RMM. 

Older non-standard hardware?  No support from the manufacturer?  This has “Linux Disaster” written all over it.  After my Windows box went belly-up, I briefly researched this and determined that someone had actually cooked up a linux driver for the Karma, but it seemed a little sketchy and it’s a safe guess that just about anything of this nature in linux is going to be totally kludgy, not ready for prime time, and that’s assuming it even works at all.  But I was OK because I had a Windows virtual machine and I could just use that when I needed to, and I did occasionally but it was kind of a pain which caused me to stop ripping my CDs and loading my Karma up.

Then I decided to switch to Ubuntu, the relative success of which has been documented on this blog.  I had always intended to get all of this MP3 business working again so that I could rip CDs and populate my Karma, but just hadn’t sat down to work on it.

Actually I did at some point and came up with a solid gripe about Ubuntu - figuring out how to rip CDs to MP3 is bizarre.  I could never get the default ripper or music manager to rip to any thing but Ogg and maybe FLAC.  MP3 support is not enabled by default because its not open source and technically requires a license.  I believed I had enabled all of the correct packages to get it working, but it was never an option in any of the menus.  I ended up installing GRip since I had experience with it and knew that it didn’t care what packages were installed - if you had an encoder and could supply it with a path to it, it would work.  And it did, but it was classic Linux kludge - you put in a CD and it autolaunched one of the programs that could not rip to MP3 and then you had to close that, open GRip and then rip.  A workable solution but annoying enough that it demotivated me from ripping any CDs especially since I had not set up any way to get them on to my Karma anyway.

Then X asked for an MP3 player for her birthday to replace that ne’er-do-well Pearl.  I got her a Sansa, having gotten a general consensus that if you’re not going to spring for an iPod, the Sansas are a good alternative.  But now she has this MP3 player and she wants to put music on it.  I went to show her how to do it.  “Put in the CD.  OK now close this window.  And open that….”  This should not be more than 3 steps tops and I hadn’t even showed her how to transfer the MP3s to her player yet!

I resolved myself to figure out a better way and get Amarok or even the built-in music manager to rip to MP3 and populate her MP3 player.  But somehow I got distracted.  I wanted to figure out how to get new music onto my Karma again!  First I set up a Windows virtual machine again, although I primarily wanted this to rescue some music and photos that had been orphaned on an NTFS partition that linux refused to mount.  I pondered just installing Rio Music Manager on the VM and just using that, but I really wanted to do everything natively in linux if possible.

So I started searching about Karma compatibility and I decided I hadn’t abused myself with a linux challenge in awhile so I was due.  The linux Karma driver still seemed a little kludgy but if it got the job done, I could at least stick to my current crappy ripping process and have a crappy way to populate both MP3 players.  Problem solved even if it’s in a crappy linux way.  I grabbed the driver and went to compile it and, predictably, it failed.  Before I decided to go nuts searching for dependency after dependency, I decided to (duh) see if this was in the official Ubuntu repository, and remarkably it was!  I grabbed the necessary packages, hit “apply” and a few seconds later it reported success.

I plugged in ole’ Karma, and tried to mount it and - classic Linux! - it failed to mount because OMFS is not one of the available file systems (even though I had just installed OMFS support in the previous step).  Cue a few hours of troubleshooting.  Best I can figure is that when you “install” this particular package it downloads the source code to your src directory and reports this as “success” even though it hasn’t actually done anything!  I found a tutorial that tells you to execute some program to build and install the package - failed with the same error when I tried to compile directly from source.  I found another tutorial that claims the repository package is broken (more typical Linux behavior) and recommends downloading the current source code and overwriting the files in the src directory.  Same error.  No luck at all.

Just about to give up, it occurred to me that somehow these other people got it to work.  Maybe the driver had been updated (and broken) since they wrote their tutorials?  Package updates causing epic failure is another typical linux behavior, btw.  I decided to try building the previous version of the driver from source.  I’m sure you can imagine my utter amazement when it actually compiled successfully on the very first try!  All that means is runtime errors are guaranteed, though.

I plugged in the Karma and ran the mount command.  If I was utterly amazed that it compiled, I was completely astounded that it actually mounted successfully and I could browse the cryptic proprietary file system!

The main technical barrier overcome, I just had to figure out how to actually use the accompanying programs to actually add songs to it.  I had a feeling they weren’t pretty.  When I configured it to automatically mount when plugged in, I noticed some typical linux behavior - sometimes it mounts as removable storage (and automatically launches a nautilus session) and sometimes it mounts as an MP3 player (and automatically launches the built-in music manager).  When the latter occurs, it actually appears in the music manager AND it displays all of the music!  Amazing!  Unfortunately, it appears to be reading the contents of the Karma by brute force and takes about a half hour to read in a few thousand songs.  And it doesn’t store the database so it does this every single time you start the music manager.  Not a showstopper, though - if I want to see what’s on the Karma I can do that by looking at the display on the Karma.  As long as I can put songs on it, I’m fine.  I tried to load an album.  It reported success!  I unplugged the Karma and went to find the album…nowhere to be found.  Whatever the built-in music manager was doing, it was doing it WRONG!  So close, yet so far.

But thinking of music managers, I remember seeing something in the Linux Karma how-to about a guy named Bob Copeland who had cooked up a Karma plug-in for a music manager called Banshee.  The installation looked a little troubling…you had to use the patch command to install a diff onto the source code and then there’s all the dependency nonsense that comes with trying to compile it. 

Ever the optimist I searched for it in the repository and there it was.  A couple of clicks later I had launched Banshee and without any further prodding, it spotted the Karma and queried the database displaying all of the songs!  Amazing!  I started looking at the settings and I noticed that it had the same “no MP3 encoder” syndrome as the built-in music manager.  Evidently they are both referencing the same thing even though it’s not clear what that might be.  Some research said it was a gstreamer plugin, but as far as I could see in the package manager, I already had a bunch of gstreamer plugins installed and one of them *had* to be MP3 support, right?  Apparently not.  Then I noticed a package called something like “ubuntu-restricted-extras.”  The name is a little bit cryptic in that while it’s apparently extras that are restricted (not open source) it doesn’t really clearly say “Install this package to get an MP3 encoder” but it does obliquely reference MP3 support in the description.  I gave it a whirl and suddenly MP3 appeared as an option in the config of Banshee.  Just to test, I loaded the built-in ripper and music manager and they also had MP3 now.  Apparently this problem could have been solved fairly easily if only there was some solid document telling you to simply install that package.  I’m sure it’s on some wiki or forum somewhere but it didn’t come up very high in a Google search!

I’ve got to say this part is an amazing success story and a glimmer of how fun and easy to use linux could be.  This Banshee program supports Karma right out of the box!  Amazing!

The rest of the saga is more linux headache, albeit entirely of my own doing..  I had at some point gone looking for the user manual for Banshee thinking that maybe I had to make a setting change somewhere to enable MP3 support.  I noticed on the Banshee website that the package in the repository is pretty far out of date and the new version has some really nice-looking features.  Seeing as Karma works right out of the box, I might as well give this new one a try!  In defense of linux, I have often lamented running into problems with Windows when trying to “get more out of something.”  Not just a linux problem there.

In any case, I followed the instructions to hook up to the Banshee repository and install the package and dependencies.  Went off without a hitch.  Score another one for linux!  I launched the program and there was my Karma nestled in the pretty updated user interface.  Clicked on it…a progress bar came up…a little bit of time passed…the progress bar disappeared.  No music listed.  It doesn’t actually work.

A little more research.  A post from Bob Copeland - Karma support had somehow been omitted from the release.  Attached was a diff file to be used with the patchcommand, but you had to apply it to the source code and then compile.  More adventures in building.  Fortunately they’ve got things set up so that you can automatically download the build dependencies, so it was actually straightforward.  The patch seemed to work except on the changelog which, as far as I know, should not matter.  But when I compiled it, it did the same behavior.  I tried a few different ways without success.  I sent an e-mail to a guy who seemed to have had success with this and he confirmed that my steps looked correct but that patch wasn’t working.  His best offer was to try the latest development version since the Karma support had been re-added there already.  I figured the “old” Banshee works either way so I’ll just give it a try and if it works great, if not I’d just go back to the old one until the next major update of Banshee.

Building from the development svn source is a little different than the regular source, but mostly the same.  Once I figured it out and resolved a few dependency problems related to my local configuration, not Banshee, it built successfully.  Score another one for linux (or perhaps open source in general this time).  When I first launched the new Banshee it crashed.  No idea why…the second time it launched just fine and has been fine ever since.

But more importantly, the Karma was back and working correctly!  As I explored the UI I noticed a cool feature.  I’m sure other music managers already do this, but this was new to me.  You can set a preferred file format for each DAP that you have and it will automatically transcode whatever file format is on your hard drive into the one you want for your MP3 player.  You see I had run into some issues when I first got the Karma and Pearl - the Karma can play ANYTHING, the Pearl can only do MP3 and WMA.  Not realizing this I had ripped a bunch of stuff as Ogg only to have to re-rip it as MP3 for the Pearl.  Not wanting to have multiple file types, I just stuck with MP3 even though I think the Ogg format is a little better.  With the transcoding feature, it doesn’t matter.  I can rip the CDs using lossless FLAC and then automatically transcode them to MP3 for X’s Sansa and Ogg for my Karma! 

After a little further tweaking and removal of the crappy default ripper and music managers (why don’t they use Banshee as the default?  Even the older repository version is much nicer!), I was ready for a final test of the process.

Inserted a CD.  Banshee launched automatically and automatically ripped the CD to FLAC.  Plugged in the Karma.  Dragged/dropped the album onto the Karma icon.  It converted the FLAC to Ogg and transferred them to the Karma.  Unmounted and unplugged the Karma and the music was there and played!  Success!  Now X can easily rip and manage her Sansa using a single intuitive program.  This is actually a pretty nice solution!   

More importantly, for the first time in over a year I’ve got new music on my MP3 player and I can start ripping CDs again!

If you look overall at this process, aside from the problem with the newer version of the driver mysteriously not working at all, getting this piece of nonstandard hardware working was remarkably straightforward.  Most of the headache came trying to install the newer version of Banshee not in the repository - headaches that are one of the main reasons we use repositories now.

Overall it’s a sign of how far Linux has come and how close it is to being ready for prime time.  Not quite there, but ever closer.  Banshee is a really nice program and of course I’ve got to shout out Bob Copeland for the Karma integration and Benjamin Jao Ming for the Ubuntu-specific help.

Leave a Reply