February 16, 2009

Using an iPod Nano on Linux

I recently bought an iPod Nano and I’m pleased to report it works just fine with Ubuntu 8.10 (aka Intrepid) and Amarok. I’m able to sync MP3s and podcasts (including video podcasts). I’m even able to transcode videos to MP4 and copy them over by hand. The only hitch is certain special menu entries like “Videos -> TV Shows” that seem to be controlled by iTunes and are, in my case, sadly depopulated. (This isn’t a Linux-specific issue. I was never able to get Audible audiobooks into the top-level “Audiobooks” menu on my old iPod. That was on a Mac, using iTunes. I’m thinking Apple wants to nudge you towards the iTunes Store.)

The instructions here and here are for the most part sufficient, but I thought I’d try to update and boil them down to a few easy steps, if only to increase the overall quality of Google searches for “ipod linux”. The instructions below are for Amarok, but should be easily adapted to Rhythmbox or gtkpod.

[UPDATE] These instructions are for a FAT32-formatted iPod, which includes any brand-new iPod which has not previously been connected to a Mac. I don’t recommend trying to use an HFS+-formatted iPod on Linux. The support for HFS+ is flaky and the filesystem tends to get corrupted frequently. (This may mainly be a problem with going back and forth between Mac and Linux, but there’s no good reason to use HFS+ unless you are going back and forth.) [/UPDATE]

You will need to install libgpod and Amarok. Unfortunately, the version of libgpod in the stable repositories of Ubuntu, Debian, and Red Hat (v0.6.0) doesn’t support the newer (4G) Nanos. The only real consequence of this is a lack of per-track cover art (“Cover Flow” works fine), so you may be tempted to ignore it. Fortunately, it’s relatively easy to backport v0.7.0 to Intrepid. Unfortunately, you also need to rebuild Amarok/Rhythmbox/gtkpod/whatever against the new library (the Jaunty repo has the right version of libgpod, but not the rebuilt version of Amarok). Fortunately, I did this all for you, and you can grab a versions of libgpod and Amarok that support 4G Nanos on Intrepid from my PPA (click on “Follow these instructions” to add the PPA as an APT repository, or just download the .debs and use gdbi or dpkg).[UPDATE] Hardy packages are available here. Jaunty packages are here (Note: you have to use an unofficial Amarok 1.4 package, because Amarok 2.0 doesn’t support iPods at all (don’t ask)). The official Jaunty repos now have an updated version of gtkpod, but not Rhythmbox AFAICT. [/UPDATE]

The iPod’s track database is encrypted, so you’ll have to help your computer decode it. Find its serial number using

sudo lsusb -v | grep -i 'Serial.*[0-9A-Z]\{16\}'

This will output something like

iSerial 3 000A27001DE47C90

Copy-and-paste the 16 hex digits into /media/IPOD/iPod_Control/Device/SysInfo like so:

FirewireGuid: 000A27001DE47C90

(If your iPod isn’t mounted at /media/IPOD, use mount and look for an entry for /dev/sdb1, sdb2, or sdc1.)

Now, you can go into “Settings -> Configure Amarok… -> Media Devices” and add your iPod. It should be automatically detected.

If you click on “Devices” on the left-hand side of the Amarok window, you should see your iPod. Click on the iPod button and set your iPod model. Wikipedia has a handy illustrated table if you don’t happen to know which G your model belongs to (current on-sale models are the 6G Classic, 4G Nano, and 3G Shuffle).

You can connect, you can sync (“Transfer”), and you can disconnect. You may have to fiddle with the “Post-disconnect command” in the “Media Device Configuration.” This one works for me:

gnome-eject -n -p /media/IPOD

If the iPod is still mounted after disconnection (i.e., the iPod screen still says “Connected”), you can use

sudo eject /dev/sdb1

(or sdc1, or whatever. You may accidentally eject a different USB device.)

[UPDATE 4/17/2009] I’m giving up on Amarok for managing my Nano: it stopped working with videos and I can’t figure out why.

I’ve been trying for three days to get some videos on my iPod and I can’t.

I followed your instructions and still can’t…

I can put as many songs as I want but no videos… I’ve changed the format to .mp4 and everything but in Amarok I can only see Playlists and with gtkpod I can also see the Photos folder, but still no videos…

dvitto, I also had a problem with videos on Amarok, which is one reason I have stopped using it. If you have gtkpod 0.7.0, you should be able to drag .mp4 videos onto your iPod. Do you get an error message?

I don’t know how to say thank you enough! This version of Amarok in Jaunty is the ONLY one that says it works with the Nano 4G AND ACTUALLY DOES WORK! I haven’t tried videos and what not, but the cover art works great. Thank you so much!

This feed has been out for awhile and I just never found it but do you think that it is possible for you to give links to everything that was mentioned. Also I have a iPod Nano 4th Generation. Think this will work?

About

A place to document tips and tricks for the various Linux, LaTeX, OCaml, and other general computer-related topics that I encounter in my daily life and a repository for supposedly amusing observations, hyperlinks, recipes, reviews, travelogues, and political opinions written when I have a spare moment (or when I don't have a spare moment, but I don't feel like working)