After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 506537 - iPhone Support
iPhone Support
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: Device - iPod
git master
Other Linux
: Normal enhancement
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
: 574556 583539 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-12-31 05:53 UTC by Johnny Proton
Modified: 2010-09-13 22:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Log of Banshee 1.7.5 and iPhone detection (30.54 KB, text/x-log)
2010-09-06 23:57 UTC, Keith Gable
Details
Another log (17.21 KB, text/x-log)
2010-09-07 00:09 UTC, Keith Gable
Details

Description Johnny Proton 2007-12-31 05:53:02 UTC
I can update my iPod and shuffle quite well with Banshee but when I plugin my iPhone it doesn't show up as a mounted device.  What do I need to do?
Comment 1 Aaron Bockover 2007-12-31 16:47:10 UTC
The iPhone and iPod Touch are not typical iPods. They are not standard mass storage devices and as such cannot be mounted in any standard way. Nothing on the iPhone/iPod Touch acts like any other iPod in existence.

I have no estimate of when we will start working on iPhone/iPod Touch support. 
Comment 2 Andrew Conkling 2008-01-04 00:01:11 UTC
Aaron, I'll leave it to you or Gabriel to set the priority. :)
Comment 3 Rory McCann 2008-09-24 13:55:06 UTC
It is possible to mount an ipod touch using sshfs. it then shows up as a portable storage device. Many music players (eg rhythmbox) are able to see this and you can transfer songs to it fine.

In ubuntu the ipod-convience package provides a command line programme ipod-touch-mount to mount an ipod.
Comment 4 Matt Philmon 2008-10-03 16:53:27 UTC
If I was interested in helping this along (I'm buying an iPhone 3G next week) where would I need to start?
Comment 5 Gabriel Burt 2008-10-03 17:03:42 UTC
I would look at http://matt.colyer.name/projects/iphone-linux/index.php?title=Main_Page
Comment 6 Bertrand Lorentz 2009-03-08 16:42:35 UTC
*** Bug 574556 has been marked as a duplicate of this bug. ***
Comment 7 Keith Gable 2009-03-24 05:13:33 UTC
Firmware 2.0+ uses a new hash algorithm that's tied with FairPlay (my guess is because of the mobile stores?). You can turn that off by editing a file on the device:

http://marcansoft.com/blog/2009/01/using-amarok-and-other-itunesdb-compatible-software-with-the-iphone-2x/

This may help you all get somewhere.
Comment 8 Scott Wallace 2009-04-20 01:45:25 UTC
As it's been said before, one can use sshfs to mount an iphone, which isn't really hard to set up.  Also, the problem about FW 2.0 using a different algorithm can be worked around, and that workaround can even be automated.

I really don't see how hard it is to add support for detecting sshfs-mounted iphones, or for letting the user choose a custom mountpoint.
Comment 9 Jan Hofmann 2009-04-23 07:45:17 UTC
Yes, it's very easy to mount the iPhone over sshfs or even via USB Cable with ifuse, like mentioned above. I actually do it with ifuse over USB and gtkpod and it works excelent!

i wrote myself two tutorials (in german)

iFuse:
http://www.virtualpixel.de/linux/iphone-und-linux-fast-ohne-jailbreak

sshfs:
http://www.virtualpixel.de/linux/amarok-rockt-das-iphone-musik-synchronisieren-ohne-itunes

so please, please bring it to banshee :)

btw, the new hash for the iTunes DB in FW 2+ is maybe hacked: (last comment)
http://sourceforge.net/tracker/index.php?func=detail&aid=2056905&group_id=67873&atid=519276
Comment 10 Alexander Kojevnikov 2009-05-22 11:07:39 UTC
*** Bug 583539 has been marked as a duplicate of this bug. ***
Comment 11 Alexander Kojevnikov 2009-05-22 11:09:06 UTC
See also duplicate bug 583539, it mentions libiphone which can be used to interact with iPhone/iPod Touch.
Comment 12 Martin Szulecki 2009-08-07 08:34:41 UTC
GVFS is gaining iPhone/iPod Touch support with bug 591005.
Comment 13 Alex Hixon 2009-09-20 05:34:17 UTC
I've done some investigating today, and sync against the iPhone on 3.0 firmware should be possible; it no longer appears to use iTunesDB. \o/

I'm going to attempt development on a iPhone DAP source (it works completely different to the old iPods, so trying to merge the two source code will just be plain ugly and pointless) and see how far I get.
Comment 14 Martin Szulecki 2009-09-20 14:53:26 UTC
(In reply to comment #13)
> I've done some investigating today, and sync against the iPhone on 3.0 firmware
> should be possible; it no longer appears to use iTunesDB. \o/

The iPhone uses iTunesCDB. A compressed version which only iTunes uses as song database. The device has a "mirror" of the database as special crafted sqlite databases. However those require special interaction using libiphone with the device in order to make the device "merge" any changes you do to those databases (sync notifications).

> I'm going to attempt development on a iPhone DAP source (it works completely
> different to the old iPods, so trying to merge the two source code will just be
> plain ugly and pointless) and see how far I get.

Here is code which is able to read/write 3.0 firmware music databases of the iPhone: http://cgit.freedesktop.org/~teuf/libgpod/log/?h=iphone30

Apart from that everything related to music syncing for iPhone/iPod Touch has been reversed already including the newer hash process.

There is a private libgpod branch which supports full iPhone 3.0+ music database syncing including cover art support and even iTunes recognizing all changes fine. 

All that even works on non-jailbroken so called "out-of-the-box" devices.

If you need more information (and save you precious time) you should probably join the libiphone mailing list.
Comment 15 Alex Hixon 2009-09-21 02:14:39 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > I've done some investigating today, and sync against the iPhone on 3.0 firmware
> > should be possible; it no longer appears to use iTunesDB. \o/
> 
> The iPhone uses iTunesCDB. A compressed version which only iTunes uses as song
> database. The device has a "mirror" of the database as special crafted sqlite
> databases. However those require special interaction using libiphone with the
> device in order to make the device "merge" any changes you do to those
> databases (sync notifications).

After a bit more investigation today, I can confirm that iTunes on the phone does not actually read iTunesDB or iTunesCDB at all. In fact, I've succesfully added tracks to Library.itdb and the phone has picked up these new tracks just fine, without having to modify the other databases.

I've also tested this during sending sync notifications to the device, and iTunes didn't seem to re-read the old database.

I suspect iTunesCDB is in fact the mirror that gets used after the initial migration to the SQLite database, rather than the other way around?

Do note that this only using the 3.0 firmware. Looking at the link to the code you posted below, I suspect yours will also work for the firmware earlier (specifically 2.0 where the extra hashing algorithm was added; I remember 1.x firmware working fine with libgpod).

> > I'm going to attempt development on a iPhone DAP source (it works completely
> > different to the old iPods, so trying to merge the two source code will just be
> > plain ugly and pointless) and see how far I get.
> 
> Here is code which is able to read/write 3.0 firmware music databases of the
> iPhone: http://cgit.freedesktop.org/~teuf/libgpod/log/?h=iphone30

Thanks very much! :)
Quite helpful for the sync notification bits, as well as just having a look how the hashing algorithm was implemented.

> Apart from that everything related to music syncing for iPhone/iPod Touch has
> been reversed already including the newer hash process.

> There is a private libgpod branch which supports full iPhone 3.0+ music
> database syncing including cover art support and even iTunes recognizing all
> changes fine. 
> 
> All that even works on non-jailbroken so called "out-of-the-box" devices.
> 
> If you need more information (and save you precious time) you should probably
> join the libiphone mailing list.

Will do. :)
Comment 16 Alex Hixon 2009-09-21 08:29:41 UTC
I stand corrected; Martin is right. 
The device does more often than not read the compressed iTunesCDB. If you don't write to it, it's a very finky solution and breaks a lot (ie you have to open the iPod app in a particular sequence, send the (in)correct sync notifications, etc).

So, in that case, I'm thinking the following work needs to be done?
1) ipod-sharp updated so that it is possible to read and write with the new iTunesDB version (>0x28?)
2) Add support to compress the database down and stick a header on it, so we can have our iTunesCDB.
2) podsleuth updated to detect iPhones and iPod touch devices
3) a small library linking against libiphone to facilitate sync notification and copying files (and perhaps device detection?). Trying to get it working with ifuse sucks a bit, mainly since it doesn't appear to be mounted by HAL (even though I can see it is. I'm not sure if this is the FUSE callout or gvfs's fault for not setting the flags).

In that case, if we still need to do all this iTunesDB hoopla, is there any point in continuing with parsing the SQLite database (Library.itdb and friends)? iTunes appears to be moving to this, and updates it on the device at sync time.
Comment 17 Gabriel Burt 2009-10-27 20:16:17 UTC
Bulk changing the assignee to banshee-maint@gnome.bugs to make it easier for people to get updated on all banshee bugs by following that address.  It's usually quite apparent who is working on a given bug by the comments and/or patches attached.
Comment 18 Brian J. Murrell 2009-12-06 00:48:18 UTC
I don't understand why y'all are not leveraging and contributing to the work being done on libgpod rather than re-inventing that wheel.
Comment 19 Praveen Thirukonda 2009-12-06 08:39:12 UTC
it is mostly due to historical reasons, when basnhee initially wanted to add ipod support libgpod was not much developed, at least that's what one of the devs told me.

though i agree that now might be a good time to move to it.
Comment 20 Martin Szulecki 2010-02-11 09:06:56 UTC
The latest libgpod 0.7.90 release features iPhone/iPod Touch syncing. libiphone has been renamed to libimobiledevice. Perhaps it's the time for creating some C# bindings...
Comment 21 David Fraser 2010-07-12 13:55:25 UTC
Note that Alan Ireland worked on a replacement plugin for Banshee that uses libgpod for the OpenSUSE Hack Week (starting 2010-06-08):
 * http://monotorrent.blogspot.com/
 * https://features.opensuse.org/309693 - feature description

So when this all lands and is available that makes iPhone/iPod Touch support a reality.
Comment 22 Alan McGovern 2010-09-03 08:50:04 UTC
This has been released in 1.7.5. Please test with this. Hope that helps!
Comment 23 Keith Gable 2010-09-06 23:11:43 UTC
Testing 1.7.5 on Gentoo. My iPhone 3GS, fw 3.1.2, isn't working. It works in Rhythmbox and GtkPod. I figured I'd test the functionality by adding a podcast, so I added the Onion Radio News.

Syncing it causes an error that says "The mp3 format is not supported by the device, and no converter was found to convert it".

Looking under the /apps/banshee-1/sources/ gconf key, my iPhone is listed as _mtp_source_-_org_freedesktop__hal_devices_usb_device_5ac_1294_redacted_if# (# is 0, 1, or 2, corresponding to the 3 USB interfaces the iPhone exposes). I'm not sure if this is because the iPhone is detected as a MTP device, or if the iPhone support is coded as an extension of MTP.

Also, looking at the advanced device properties lists my iPhone as a Sony DCR-SR75 (though the version and serial number are correct).

Banshee and friends is installed with these USE flags:

[ebuild   R   ] dev-dotnet/ipod-sharp-0.8.5  USE="-doc" 0 kB
[ebuild   R   ] dev-dotnet/podsleuth-0.6.7  0 kB
[ebuild   R   ] media-sound/banshee-1.7.5  USE="aac boo cdda daap doc encode ipod karma mtp podcast web youtube -test" 0 kB

Also, I currently have HAL installed and running, though I understand Linux distros are going away from HAL.

Am I doing something wrong, or do I need to check the configuration of something?
Comment 24 Keith Gable 2010-09-06 23:12:40 UTC
Clearly, I meant banshee and friends ARE installed with those USE flags :)
Comment 25 Alan McGovern 2010-09-06 23:25:28 UTC
Does your banshee install have the "AppleDevice" extension? It doesn't sound like it from your description. This is the one that is required for iPhone support. You also need the gio hardware backend to be enabled, which means you need udev, not HAL. If you have both udev and hal, that's perfectly ok.

Try running banshee in a terminal with the "--debug" switch and attaching the output to the bug report. That will help diagnose the issue
Comment 26 Keith Gable 2010-09-06 23:57:51 UTC
Created attachment 169632 [details]
Log of Banshee 1.7.5 and iPhone detection

Here's the output of --debug. Banshee has the "Apple device" extension checked in the Preferences screen, so I assume it's loading.
Comment 27 Keith Gable 2010-09-07 00:09:39 UTC
Created attachment 169633 [details]
Another log

Here's another log. I copied the part that started to appear once I plugged my phone in.

Also, I have GLib 2.24.2 and udev 158, which should support the new hardware detection stuff.
Comment 28 Alan McGovern 2010-09-07 07:06:07 UTC
For some season the Hal backend is being used, not the gio/udev one. This is the cause of your problem. I'm not sure why this is happening.  My guess is that gio hardware was not enabled when banshee was compiled. Does this sound possible?
Comment 29 Alan McGovern 2010-09-07 07:06:52 UTC
For some season the Hal backend is being used, not the gio/udev one. This is the cause of your problem. I'm not sure why this is happening.  My guess is that gio hardware was not enabled when banshee was compiled. Does this sound possible?
Comment 30 Keith Gable 2010-09-07 15:49:35 UTC
My guess is that Gentoo is building the package with HAL rather than with GIO. GIO is enabled with a configure switch, right? If so, I'll modify the ebuild, try it out, and send a patch downstream.
Comment 31 Gabriel Burt 2010-09-07 15:56:34 UTC
Alan,

Why does it matter that the HAL backend is being used?  I thought the AppleDevice/libgpod support could use either hardware backend.
Comment 32 Alan McGovern 2010-09-07 16:34:18 UTC
We need the GIO backend to get the mountpoint of the iDevice. The mountpoint is the only thing the AppleDevice extension requires to work, but I don't believe it's possible to get that info from HAL.
Comment 33 Alan McGovern 2010-09-13 22:39:09 UTC
Closing this again as the issue appears to be purely because GIO Hardware was not enabled.