The iPod Shuffle and Linux

This page has not been maintained in years because I don't use the Shuffle anymore. This information may be out of date and hopefully wholly unnecessary for current Shuffles.

The iPod Shuffle is Apple's tiniest and most minimalist iPod. It is basically a stylish USB flash drive with minimal music playing capabilities and features, all at a surprisingly low price. Using a Shuffle, however, is not the same as its big brothers: usage is more akin to a radio station loaded from your music collection rather than a jukebox with all your music.

Now, for what you're here for: yes, the Shuffle does work on Linux. It works quite well save for the lack of iTunes and the Autofill feature. But if all you want is to load playlists of music onto the Shuffle, Linux can do that.

Setting Up Software

The iPod Shuffle is basically a USB flash drive. You put music on it by putting the files in the correct places and regenerating the iTunes database on the Shuffle. Although the necessity of a database on a device with no screen and no menus is questionable, it wouldn't be an iPod without iTunes integration capability.

Your first step is to figure out how to get it to mount somewhere as a USB removable storage device. There are many ways to do this depending on your distribution. Mandrake 10.1 will automatically mount on insert at /mnt/removable, other versions and distributions might do something else.

For software, you need gnupod 0.98 or newer. Installation is straightforward if you have all the required Perl modules.

If you have never used the Shuffle with Linux before, you'll need to generate the gnutunes database first. Run gnupod_INIT.pl -m mountpoint (where mountpoint is wherever the Shuffle is mounted).

Unfortunately gnupod isn't exactly that user-friendly. For one, it is a huge pain to add a list of files. It isn't smart enough to read a m3u playlist and just load all the songs in order. Ugh. Fortunately, I've written a handy script that automates all that nonsense. Download my ipodshuffle script somewhere. At this point you're good to go.

Using the iPod Shuffle

The Shuffle is an exceedingly simple device, so most of the complications associated with normal iPods don't apply. Pretty much the only things we need to do with it are erase everything and add a list of songs to the playlist (and there's only one playlist). Any other sort of management isn't really necessary; the Shuffle wouldn't know what to do with it anyway.

My script assumes M3U playlists, which are probably the most common cross-platform playlists. The file format is very simple; it is just a list of files with absolute or relative paths.

To erase all the songs on the Shuffle, do
ipodshuffle --wipe

To add a playlist to the end of the Shuffle's playlist, do
ipodshuffle --add=playlist

To make the music contents of the shuffle exactly match a given playlist (same as a wipe then an add), do
ipodshuffle --load=playlist

If you need to specify a different mount point for the Shuffle, the --mount option exists. If you get tired of having to specify this, the environmental variable IPOD_MOUNTPOINT can be used instead.

If you wish to see what GNUpod is doing under the hood, use the --debug option.

To suppress the helpful status messages that I print out, use the --silent option.

To see the various other options, do
ipodshuffle --help

For more information, see the source code.

After ipodshuffle is run, things are safe for unmounting.

If you want a feature like Autofill that selects songs from your library for you, you'll have to write one yourself. If you have your music in a database, it shouldn't be too bad to write scripts that select music and output the result to a playlist.

Important: there are a couple of caveats worth mentioning. First, iTunes doesn't want your Shuffle to get around. If you put music on it from another computer (such as your Linux machine) and then let iTunes have at it, iTunes will erase all music on the Shuffle. In short, the Shuffle "binds" to only one iTunes library at a time, and if iTunes detects that a Shuffle that it "owns" has been mucked with, it erases all music on the Shuffle. This is intentional (I suspect it was done to limit music copying and appease the RIAA) and is an iTunes issue, not a Linux issue. This is somewhat annoying if you use it for data storage and plug it into a machine that has iTunes installed; you must make sure that iTunes does not claim ownership of that Shuffle.

Second, gnupod keeps changing the name (the one that gets displayed in iTunes) to "GNUpod 0.98" regardless of what it was originally. My script has an option for supplying a more suitable name. The value of this is questionable anyway, since iTunes likes to wipe your Shuffle if it has been in another computer.

A graphical alternative

gtkpod is a graphical tool for managing iPods. Version 0.88 and newer include support for the iPod Shuffle. If you prefer a graphical utility, you may try this instead.

While gtkpod is probably a superior solution for full-blown iPods, it is overkill for something as ridiculously simplistic as the Shuffle. Synchronization isn't really necessary, and it is significantly more troublesome to use the graphical interface to load a single playlist than to issue one simple command. Nevertheless, if you absolutely have to point and click, it is an option.

More about the Shuffle

There is only one playlist on the Shuffle, named IPOD. In addition to the usual iTunesDB stuff that all iPods have (and which is mostly redundant on the Shuffle), there is an iTunesSD file that only the Shuffle uses. More information on iPod file formats can be found at here.

The Shuffle itself is amazingly light. It actually feels rather insubstantial and plasticky as a result. It is very easy to lose track of because you can't feel it in your pocket. Other flash players that use AAA batteries don't have this "problem" because a single AAA battery weighs as much as the entire Shuffle.

The design is also very spartan. A more accurate description of the Shuffle would be a USB flash drive that happens to have basic music playing capabilities. The lack of an LCD and removable batteries is probably what lets Apple get away with making them so cheap.

Quibbles with the design: First, the USB cap is far too easy to loose. It would have been nice for Apple to include a spare, because these things are begging to be misplaced. Second, the rear slider is much too slick and won't work well with greasy fingers. A few ridges or stippling on the slider would provide vastly better traction.

Integration with iTunes is often cited as an advantage that the Shuffle has over other comparable flash players. I can't really speak about that because I do not use iTunes with my Shuffle, mostly on account of the absence of a Linux version.

Oh yeah, all that stuff about "Enable disk mode" and the like isn't terribly relevant to Linux. That option exists to tell iTunes not to hog the Shuffle and to let the OS see it as a flash drive. In Linux, it is a plain flash drive; we just happen to be monkeying around with some files on it.

I don't know how many others have noticed this, but the USB on the Shuffle has extra pins. Looking at my SanDisk USB key, I see the expected 4 USB pins. However, the Shuffle has 9 (the 4 normal ones, plus 5 extra). This suggests that this is also an interface for Shuffle-specific peripherals. It'll be interesting to see how it gets used.

The Shuffle represents an interesting balance of considerations in the flash player market. There are flash players with far more features (like voice recording and FM radio). There are cheaper flash players. There are flash players with removable batteries. But there isn't much in the way of flash players that are that tiny with large capacity at that price. And most importantly, there are no other flash players that have Apple's marketing machine behind them. Leave it to Apple to make the Shuffle's lack of features ("simplicity") a key selling point...