April 14, 2006

Improve your iPod with Rockbox

Author: Tim Lord

Over the past few years, I've been ripping my CD collection to Ogg Vorbis, intending to one day find a portable player for all those tracks of synthpop, reggae, and comedy. Now I've finally found a player for my 60-or-so gigs of Ogg files which has the the ergonomics, battery life, and accessory market of the iPod. The secret to having a player that deals with so many codecs, but that looks and acts like an iPod, is that it is an iPod -- just one that I converted last night with a firmware swap to run the excellent, open source system called Rockbox. Rockbox isn't perfect -- and it sure isn't for everyone -- but I'm pleased as punch with it.

At last I can listen to the Ogg Vorbis version of Novell Open Audio podcast while trudging to the grocery store, and no one's the wiser that I'm listening to a format that's neither encumbered by patents nor vilified as a tool for ill doings. Bonus: it plays various other file formats, such as those naughty MP3s (so I can hear a download of the Penn Jillette radio program on the bus each day) and several others, including three lossless compression formats.

The long slow road to the iPod

Until last Autumn, I'd been holding out for a portable player that used AA batteries, played back Ogg Vorbis files, and could be mounted transparently as a hard drive for simple drag-and-drop file management rather than relying on any one company's proprietary, intrusive approach to arranging my files. Then, thanks to a sale at Costco, I bought an iPod instead -- despite its battery, lack of Vorbis support, and (to me, annoyance-ridden) iTunes management software.

Four factors convinced me to buy the iPod, despite my misgivings. I figured I'd be able to use it as a tool to store digital photographs on a then-upcoming family trip to China, and as a backup device generally. The Costco deal also included several nifty accessories, among them a piggyback battery pack, so the iPod could at least kinda-sorta be powered by AA batteries, even if that famously fickle original battery was still lurking inside.

Also, by that time, several options for working with the iPod under Linux were mature enough that I knew I wouldn't have to borrow or buy a machine running Windows or OS X to manage the contents of the device. (I ended up being happy with gtkPod as an iTunes-alike, at least so far as device-specific music software could make me happy.)

Finally, I figured that the iPod Linux project would sooner or later not only let me run Linux on the thing, for kicks if nothing else, but give me Ogg Vorbis playback as well.

I'd been familiar with Rockbox through postings about it on Slashdot but I didn't realize until I idly scanned the page last night that Rockbox supported the iPod at all, or (Callooh! Callay!) that it played back Ogg Vorbis on any platform at all. However, it does and it does. And while iPod Linux is churning along, creating an impressively complete software system given its unique hardware constraints, I ended up going with Rockbox instead.

Among other things, the iPod Linux project's wiki says that iPod Linux is stable only for the first three generations of iPod hardware (even if Joe Barr did manage to squeeze it onto his nano), and that Ogg Vorbis playback is thus far only at about 80% of real time. Handily enough, Rockbox's iPod support starts where iPod Linux's leaves off, with the 4th generation iPod, the model I own. So, after some downloading, fiddling, and finger-crossing, my iPod has been Rockboxed.

Rockbox for iPod, an executive summary

Rockbox started as a reverse engineered alternative firmware for certain Archos MP3 player/recorders -- now Rockbox varieties support machines from Archos, iRiver, iAudio, and Apple. What Rockbox provides for iPod users is an alternative operating system for several models of iPod. It works with the two most recent generations of (full-sized) iPod, as well as with the nano and Mini varieties.

Rockbox uses, by necessity, the iPod's click-wheel input system and employs a similar nested-menu navigation. Casual iPod users might not feel instantly at home, but will probably be comfortable enough with the menus after a few minutes futzing around to start playing music. However, once a user starts exploring those menus, he's likely to spend quite a while exploring the long lists of fonts, games, and options they offer. Among those options are several things which as far as I know are still missing from Apple's firmware, including cross-fading of tracks (so songs blend into each other, DJ-style) and gapless playback.

Music file management on the standard iPod is simple -- if you're using iTunes or one of the several iPod-management tools available under free operating systems. These programs can access the iTunes database that lives on each iPod, and are designed to deal with Apple's system of hiding music files with obfuscated filenames scattered among obliquely named folders. However, if you mount your iPod as a mass storage device, you get the same logical layout for file management as you would with any other removable drive.

Unlike the original user interface (UI), Rockbox uses this simpler, nested-folder system to manage music as well as other types of data, so you can drag and drop music straight to the window representing the drive's contents. Rockbox will not read the obfuscated format used by the original iPod software. For good or ill, that means no longer relying on an application like iTunes or gtkPod to manage your music.

The scary part: Installation

There's a lot of information on the Rockbox documentation page; the directions which led me through installing Rockbox on under Linux are well-written and concise, though still I managed to goof up a few times before getting things right. Bear in mind that swapping the firmware that came with an iPod is theoretically risky -- but if a klutz like me can do it successfully, odds are good that you can, too.

First, you'll need a FAT32 formatted iPod, not an HFS+ version -- the Rockbox site has instructions on converting the iPod if it is an HFS+ formatted device.

I won't go into the procedure in detail, but it takes just a few steps to install Rockbox on the iPod. Note that I've broken the steps down somewhat differently than the directions page on the Rockbox site does. My desktop is running Debian 3.1, but the outline below should hold for any recent Linux-based operating system:

  1. Download some pieces of software from the Rockbox site: You'll need a bootloader and a zipped copy of Rockbox proper, both of which are device specific (grab the latest daily build of the appropriate version of Rockbox), and a utility called ipod_fw.

  2. After backing up the iPod's partition table, use the dd command to copy the Apple bootloader to your Linux machine, and meld it with the Rockbox bootloader, with a command sequence approximately -- but only approximately! -- like this one:

    dd if=/dev/sdx1 of=bootpartition.bin
    ipod_fw -o apple_os.bin -e 0 bootpartition.bin
    ipod_fw -g 4g -o rockboot.bin -i apple_os.bin bootloader-4g.bin

    This is the phase where I made some missteps, none of which were fatal to the enterprise, by confusing partion.bin and apple_os.bin, and therefore creating a botched bootloader. However, reading the directions more carefully set me straight.

    Very important: The commands here are for illustration only! The letter your system assigns to the iPod will vary; on my machine, it was mounted at /dev/sdf, rather than /dev/sda as in the examples at the Rockbox site.

  3. Use the dd command again, this time to write your new bootloader to the iPod: dd if=rockboot.bin of=/dev/sdx1. Again, be very careful that you're writing that boot image to the right place -- your iPod is almost certainly not actually mounted at /dev/sdx -- that's just an example.

  4. Reboot the iPod; I'd suggest booting into disk mode, by holding down the Select (center) button and the Play (lowermost) button as the iPod turns on. Now that the bootloader's in place, you're ready for the final step: unzip the Rockbox image itself into the root directory of the iPod. If you'd like some almost instant gratification, drag a few Ogg Vorbis files onto the drive as well. Reboot once more, and if all's gone well, you should now be in Rockbox!

Quirks, options, downsides, and glitches

The biggest downsides to using Rockbox, rather than the original iPod firmware, are in the UI and file compatibility, with a few audio glitches as well. Why file compatibility, after all the praise I heaped on Rockbox for being so very liberal in what it accepts? Because while Rockbox plays well with MP3, Vorbis, FLAC, ALAC, WavPack, and a few other audio formats, it doesn't play encrypted AAC files, which iTunes Music Store (iTMS) users have been paying for, nor does it play any version of the Audible format, leaving some audiobook fans out in the cold.

I don't mean to be dismissive of these file-format shortcomings, but since I've never used the iTunes Music Store and don't have any Audible files, they were easy for me to ignore. And if you've spent hundreds of dollars on tracks from iTMS, you might not be overcome with joy just because you can reboot into the Apple firmware whenever you want to listen to them.

Similarly, that Rockbox doesn't work with iTunes Music store is going to be a deal-killer for some, even though, again, you can reboot into Apple's firmware instead. For me, this is no big deal; my music is mostly drawn from the CDs I've bought over the last 18 or so years, and obscurities from the Internet, like old radio shows hosted by rusc.com. I've even joined the 21st century lately by downloading recent radio shows from the BBC and elsewhere.

The Rockbox UI isn't quite as friendly as the original iPod UI, in large part because it's laden with more options than the iPod, and thus more complicated. I was a bit confused at first about how to navigate through the file system. Generally, though, the left arrow (the "previous track" / "rewind" button) takes you to a higher level in the file tree; I kept hitting the "menu" button instead, the usual way up the menu hierarchy in the conventional iPod interface.

Rockbox's everything-optional approach is glorious, complicated overkill compared to Apple's Zen-garden simplicity; check out Rockbox's highly customizable sound meters and five-band parametric equalizer. I like them, but you might not. Other options let the user choose fonts that look much like the stock iPod fonts, or from quite a few others, some of which are downright tiny. I settled on a clean, small and futuristic font called "snap."

When looking at the files and folders, you can choose (options again!) to display them with case sensitive file names, with folders and files mixed together or separately, alphabetically or by size, and so on and so forth. It's not infinitely complicated, but it's certainly more than merely tweakable.

Beside each file name that Rockbox recognizes as one it can deal with is a small icon, such as a musical note for playable audio files. Remember, since this is still a mass storage device, you could have stashed files in any given format -- CAD drawings, OpenOffice.org files, Excel spreadsheets -- and you can only deal with certain things, like plaintext documents and audio files, through Rockbox itself. Those icons are useful when scrolling through a long list of files dumped straight from a folder of scattered documents, but sometimes they're misleading -- my greyscale iPod can't do anything useful with mp4 files, but that note icon appears next to them nonetheless.

There's one more problem worth mentioning: once I had Rockbox playing for a few minutes, I noticed audio dropouts, lasting perhaps half a second, on certain files. Since this was happening on both MP3s and Vorbis files, and these of varying bit rates, I didn't see anything obvious on which to pin the blame. However, I thought this might have to do with too little caching, so (squirreling through menus again), I bumped the anti-skip buffer from 10 to 30 seconds and likewise increased the time to hard drive spin-down time from 10 to 30 seconds -- and since then I've bumped into no more dropouts. I suppose this will cost me some battery life, but I haven't yet given it a battery endurance test.

And, though it's not truly a flaw, I can't help mentioning that Rockbox is a work in progress; there are new builds every day -- with admirably human-readable changelogs. The developers are creating Rockbox for their own enjoyment and use, and can't guarantee the safety of your iPod if you join their experiment. If you can't deal with that risk, it makes sense to avoid it. On the other hand, previous-generation iPods like mine are widely available online; consider getting one of these, or at least back up the contents of your iPod, before playing with Rockbox.

The happy upshot

My iPod is suddenly of much greater use to me. In the several months since I bought it, it's been used mostly as an external hard drive, moving files place to place and as a simple backup for important files. Now I can use it the way Apple intended, or something close to it anyhow, without being tied to Apple's vision of file management, or the short list of supported codecs as shipped in the box.

I haven't mastered all of Rockbox's features yet, but I'd be hard-pressed to judge the UI too harshly, considering that it squeezes in functions like audio bookmarks for all files. The stock iPod software, exclusive of clever hacks, provides bookmarks only for Audible files, which is a pain when listening to long audiobook MP3s. Frankly, there's an embarrassment of riches, and I'm not even certain that I've explored every menu option yet.

Even if you're not planning to make the swap I did, it's instructive to see the potential that your iPod holds that Apple's firmware doesn't exploit -- the PDF manual documenting Rockbox for the iPod (look for it on the daily builds page) is a draft version, but complete enough to give a tour for the timid. It's certainly better than some product manuals I've gotten with retail hardware.

And if you're feeling even slightly adventurous, go ahead and install Rockbox. You can always revert to the Apple way of doing things if you don't like it, and in the meantime you can enjoy the blessings of creativity expressed through reverse engineering. There's no charge for downloading the distribution, but the Rockbox developers do take donations via PayPal; I've been well pleased with the switch, and consider it well worth the few bucks I'm about to send them.

Click Here!