This is an old revision of the document!


Linux and the iPod Touch

Linux support for the iPod Touch is quite good. However, the latest versions of Apple software are not always completely compatible. Here is how I managed to get my new iPod Touch with iOS 4.2.1 working with Ubuntu.

Jailbreak

Jailbreaking opens up an infinite new world to iPod Touch and iPhone users. I highly recommend it and I cannot guarantee that this set of instructions will work on non-jailbroken devices.

I used the GreenPois0n jailbreak for my iPod. Unfortunately, I was forced to find a windows box to run the jailbreak. Come on, guys. At least make it work in a VM. Note: you need to connect the iPod to iTunes to initialize it first. This can take place in a VM. For whatever reason, GreenPois0n disagreed with virtualbox when I tried it, though. Your mileage may vary.

Install Ubuntu Software

As of this writing (3/17/2010), the default Ubuntu packages do not work with the latest hardware and software combination. Therefore, you will probably need to add ppa:pmcenery/ppa to your software sources. This is most easily done through Synaptic by clicking SettingsRepositories, then Other Software, then Add… and pasting in ppa:pmcenery/ppa and clicking Add Source. Then close the dialog and click Reload.

Now, install or update ifuse (>= 1.1.1), libgpod4 (>= 0.8.0), libimobildedevice (>= 1.0.4), usbmuxd (>= 1.0.6), and banshee (>= 1.8.0). Then reboot.

Install iPod software

Start up the Cydia app. Search for an install openssh and vim. iFile will allow the change to be carried out locally; however iFile costs $4.00 the last time I checked.  The instructions below are for SSH.  

===== iPod configuration =====

The latest database version is incompatible with the latest linux drivers.  Therefore, the database version of the device must be downgraded.  The process is quite simple.  

  - Log in to the ipod via SSH as root with default password "alpine".  
  -- su to root
  .. <code>$ su</code>

  1. Edit Checkpoint.xml to change DBVersion to 4

    # vim /System/Library/Lockdown/Checkpoint.xml

    You'll see something like this:

    798
            <key>DBVersion</key>
            <integer>5</integer>

    Change it to this:

    798
            <key>DBVersion</key>
            <integer>4</integer>
  2. Delete /var/mobile/Media/iTunes_Control

    # rm -rf /var/mobile/Media/iTunes_Control
  3. Change password (optional, but highly recommended)

    Root password:

    # passwd

    User 'mobile' password (default non-root user):

    # passwd mobile
  4. Reboot device

    # reboot

Initialize Database

Connect the device to iTunes and transfer at least 1 song to the device. This will initialize the database for use with linux.

Transfer songs with Banshee

If everything has been done properly so far, the iPod should now work properly with Banshee. If you haven't already, you might want to install the gstreamer0.10-plugins-ugly-multiverse package for the lame mp3 encoder. This will allow Banshee to convert tracks to mp3 automatically.

Open up Banshee with the device connected. Banshee should detect your device and display it in the side panel. Try dragging a song onto the device in Banshee. Once it is finished transferring, wait another 10 seconds or so and quit banshee (media → quit). Check the music player on the device to make sure the file appeared. If so, you're done. Banshee will now be able to transfer all of your music. If not, well, back to the old drawing board…

Debugging Notes

Run banshee –debug and transfer a song. See if one of the errors below appears.

Wrong Database Version

If banshee –debug yields this error, the device is configured with database version 5 (too new).

Failed to save iPod database - GLib.GException: Failed to generate sqlite database (in `libgpod-sharp)

To check the current configured version, run

ideviceinfo -q com.apple.mobile.iTunes -k DBVersion

.

The solution is to edit Checkpoint.xml and change DBVersion. If you have already done this, make sure to delete the iTunes_Control directory and reboot the device. Do not allow it to sync with anything and do not start the music player before rebooting.

Old Driver Software

If opening up the device in Nautilus only yields a folder called DCIM, then you are running the incompatible packages. Please add the ppa listed above, upgrade, and reboot.

The below error messages are also indications that the drivers are the wrong version. If any of these messages show up in dialog boxes or debug outputs, please check the versions. Also make sure that the computer was rebooted after updating the packages.

The ogg format is not supported by the device, and no converter was found to convert it.
The mp3 format is not supported by the device, and no converter was found to convert it.
[5 Warn 03:07:58.970] Caught an exception - System.ApplicationException: The ogg format is not supported by the device, and no converter was found to convert it (in `Banshee.Dap')
  at Banshee.Dap.DapSource.AddTrackAndIncrementCount (Banshee.Collection.Database.DatabaseTrackInfo track) [0x00000] in <filename unknown>:0
  at Banshee.Sources.PrimarySource.AddTrackList (System.Object cached_list) [0x00000] in <filename unknown>:0
[5 Warn 03:07:58.970] Caught an exception - System.ApplicationException: The mp3 format is not supported by the device, and no converter was found to convert it (in `Banshee.Dap')
  at Banshee.Dap.DapSource.AddTrackAndIncrementCount (Banshee.Collection.Database.DatabaseTrackInfo track) [0x00000] in <filename unknown>:0
  at Banshee.Sources.PrimarySource.AddTrackList (System.Object cached_list) [0x00000] in <filename unknown>:0