Linux and Your iPhone / iPod Touch

by John Mark Walker - Jan. 08, 2010Comments (13)

DRM and AppleNot content with the roadblocks Apple had erected for users who wanted to connect to their digital devices (that they had paid for, natch), Apple decided to up the ante with its iPod Touch and iPhone series. This meant that a whole new round of reverse engineering was necessary just so that, and this bears repeating a thousand times, users could connect to a device that they paid for and actually access content they legally possess. Does that make sense to you? Me neither. Welcome to the 21st century.

First the good news - with recent developments in the libgpod library, as well as ifuse and iphone libraries, it's relatively simple to enable your Linux box for iPhone content syncing with gtkpod. The bad news is that things are still a bit rough around the edges, but I'll demonstrate the workarounds. 

 For the sake of this post, I was using a 2nd generation iPod Touch with firmware listed as version 2.2. The first thing to do is make sure you have a recent versions of libgpod, libusb, usbmuxd, libplist, libiphone, and ifuse installed. Below is a list of the versions you'll need. The really great news is that I found functional .debs for all of these:

  • libusb 1.03
  • usbmuxd 1.0.0
  • libplist 0.16
  • libiphone 0.9.4
  • ifuse0.9.4
  • libgpod 0.7.2 (maybe - more on this later)

If you're using the most recent version of any distribution, libusb and libgpod should be fine. For the rest, add this repo to your sources.list:

deb http://ppa.launchpad.net/jonabeck/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/jonabeck/ppa/ubuntu karmic main

Then add the repo key and install some packages:

$ sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com F0876AC9
$ sudo apt-get install ifuse
$ sudo apt-get install libiphone-utils iproxy

(for some other tips, see this blog comment)

Now you should be able to connect your iPhone / Touch with a USB cable and mount it with this command:

ifuse <mount point>

You'll have to have root privileges unless you modified your user permissions as explained in the blog link above.

If you find that you're unable to mount the device with ifuse, you'll need to clone the libgpod git repository and compile from source. One thing this has that the libgpod included in Karmic does not is the automatic creation of a mount point in /media. That is, with the vanilla libgpod in Ubuntu, I had to create a directory in /media, and with the fresh from git compiled libgpod, I didn't. I honestly couldn't tell any other difference, but I was using an iPod Touch with generation 2 firmware. If you're using 3rd generation firmware, you may need the git repository regardless. In any case, if you find you need the bleeding edge libgpod, you'll need these packages: git-core, autoconf, libtool, libglib2.0-dev, intltool, gtk-doc-tools, sqlite3, libsqlite3-dev, zlib1g-dev, libxml2-dev, checkinstalldo and (if you want to be able to manage album covers) libgtk2.0-dev. Next, run this:

$ git clone git://gtkpod.git.sourceforge.net/gitroot/gtkpod/libgpod
$ cd libgpod
$ CFLAGS="-g -O0" sh autogen.sh --prefix=/usr
$ make
$ sudo make install

 Now we get to disclaimer territory - the following steps will probably work fine. Then again, they may not. *Follow them at your own risk!*  If I were you, I'd make a backup of whatever you like to store on your device. For the following instructions to work, you'll need to have a music library already created by iTunes. If not, you'll want to stop now and create one before proceeding.

Make sure your device is still mounted and create the iTunes_Control/Device/ directory. Next, get your device UUID and use it to create a file called "SysInfoExtended" by running

$ lsusb -v | grep -i iSerial

$ ipod-read-sysinfo-extended <uuid> <mountpoint>

 The "ipod-read-sysinfo-extended" binary is included in the libgpod-common package. Without it, you'll need to compile libgpod from source. 

The resulting file - iTunes_Control/Device/SysInfoExtended - should be a relatively large XML file, and should not be empty. 

And now for the fun stuff - start with gtkpod. You should now be able to load your iPod Touch or iPhone and see your music database. You should also be able to sync music to your music database. You'll need to test what happens when you go back to iTunes to make sure it recognizes your newly synced music from gtkpod. Beyond basic syncing and playlists, you may run into bugs. Buyer beware :)

One thing I noticed is that, for whatever reason, my mounted iPod was not recognized by any KDE apps, including the Dolphin file manager and Amarok, even though the 'df' command showed that it was definitely there. In Gnome, Nautilus did recognize the newly mounted volume, although rhythmbox, like Amarok, still couldn't find the iPod. I attribute this to the fact that this is still fairly fresh code and multimedia software hasn't quite adopted to volumes mounted by ifuse.

For more details and lots of great commentary, see this blog post at marcansoft.com, which was the inspiration for this post and the source of my info. 



Jason Shao uses OStatic to support Open Source, ask and answer questions and stay informed. What about you?



13 Comments
 

How much software and music does a community (with a less than 2% market share) based on "FREE" buy? Natch. That's why Apple and Microsoft don't produce anything for the FREE and open source community.


0 Votes

Your premise is wrong, because you assume that Mac and Windows users somehow deserve less. Information rights are for everyone, and Mac and Windows users are adversely impacted by DRM. Thus, the need for reverse engineering.


It's not about Apple catering to Ubuntu users. It's about Apple respecting my goddam rights. We don't need their software - we can write the software, but only if we're allowed.


0 Votes

based on "FREE" - like the BSD elements in Mac?

Khurt, I think the author is highlighting free "as in liberty" rather than your narrow free "as in cost".

My daughter has an iPod Touch (but third generation) and I hope to give your recipe a try. Hopefully more devices based on Android will lessen the hype around the restrictive iPods. I don't think Apple will open up much.


0 Votes

Hi John,


the problem that you don't get the ipod recognized in Amarok and Rhythmbox can probably get solved by putting a ".is_audio_player" file into the root of the ipod filesystem.


Refer to the link for details.


http://bigbrovar.aoizora.org/index.php/2009/09/14/transcode-and-sync-mus...


Cheers !


0 Votes

Exactly what did Apple do to infringe on your rights?


YOU bought THEIR product knowing full well the limitations it would impose on you.

YOU retain YOUR right to return the device.

YOU are absolutely welcome to reverse engineer YOUR device and have it do whatever you want it to do. Apple, on the other hand, has no obligation to make THEIR devices or THEIR software do anything you want. They simply are addressing the demand of the consumer and, unfortunately, the vast number of consumers are not using Linux on their PCs.


See the trend here... YOUR rights are not infringed upon. YOU are just upset that a device YOU paid money for does not meet YOUR expectations. Whose issue is that?


I bought an Apple IPod Touch - but I did it because I like the device, the interface, and its simplicity. I did not buy it to interface with anything beyond the supported platforms.


All this being said - I applaud the efforts of the developers to get the IPod working with Linux. However, buy doing this all that is being done is letting Apple off the hook for not supporting Linux as a platform. If the "community" does the work, what incentive does Apple have to play along? YOU are still buying the devices.


0 Votes

I bought a first generation iPod Touch in July 2008. Apple has charged me $10 twice for two firmware upgrades. Well, at least that's more reasonable than Windows upgrades.


I have a laptop that dual boots Ubuntu/Windows. The one and only purpose of the Windows partition is to enable the firmware upgrades on the Touch. I have close to 100 apps installed on the Touch but no music. In fact, I don't like iTunes very much and I am pleased that some people are finding a Linux work-around. Maybe my Touch will get some music after all!


0 Votes

@JeffH0821 - any company that doesn't respect my right to access content on a device that I own is an asshole. Period. We should have the right to interface with our devices as we see fit, not the manufacturer. Also, the iPod was a gift, but that's really beside the point.


You do realize that if I release tools that allow others to circumvent Apple's "protection" scheme, I can be criminally prosecuted. Excuse me, but why are you defending Apple? You have not thought this through.


It's no wonder that companies screw us over in the digital space - because people like you are all too willing to bend over for them.


0 Votes

John,


This: "You do realize that if I release tools that allow others to circumvent Apple's "protection" scheme, I can be criminally prosecuted." is not the fault of Apple, why are you blaming the corporation for following the law and protecting their business interests?


Look, if you are upset with the law, contact your elected officials to amend the law so that you can "release the tools" blaming people on the internet for disagreeing with your self-righteous indignation inevitably makes them less willing to help your "cause" especially over something as trivial as a simple disagreement over rights that, arguably, you do not have.


0 Votes

to "nobody special"


Fair enough. Excoriating people for their point of view probably won't win me any friends. However, I don't think calling our reps will do much of anything, and I don't see a problem with holding the perpetrators, ie. Apple, et al., responsible for their actions.


There are many, many precedents for this. Were union activists wrong to protest companies that exploited them? Were civil rights leaders wrong to protest companies that exploited minorities? In all cases of significant change wrt recognition of rights, it took significant actions on the part of protesters and other common folk before politicians took notice.


Your point about my actions not sounding the right tone is, however, spot on.


0 Votes

wow ! its amazing technology. Linux is in very demand now a days.

How to get pregnant


0 Votes

If I buy a vehicle - I have the right to modify the exhaust, headers, pumps, valves, filters, interior, exterior, add wings, skirts, change the color, install turbo, supercharger, or rip everything out and completely start from scratch.


Why shouldn't I be able to do that with an iPhone?


0 Votes

not only do you have the right to mod your car, as mike b points out, but you could also distribute instructions on how you did so without concern for prosecution. so explain to me, apple fanboys, how this is any different?


0 Votes

RE: "There are many, many precedents for this. Were union activists wrong to protest companies that exploited them? Were civil rights leaders wrong to protest companies that exploited minorities? In all cases of significant change wrt recognition of rights, it took significant actions on the part of protesters and other common folk before politicians took notice."


Your comparing the exploitation and discrimination of ethnic minorities to the fact you can't interface with linux?


It's linux mate....just linux. I think someone needs to take a deep breath and stop throwing your toys on the floor.


0 Votes
Share Your Comments

If you are a member, to have your comment attributed to you. If you are not yet a member, Join OStatic and help the Open Source community by sharing your thoughts, answering user questions and providing reviews and alternatives for projects.


Promote Open Source Knowledge by sharing your thoughts, listing Alternatives and Answering Questions!