iPhone syncing on Linux, part 2

Last post was more along the lines of an announcement, so here’s a more concrete guide. There have been new releases of most parts of the software stack in the past few days, so now is the time to grab them if you’re interested. Libgpod is the exception, since it’s still being worked on to get proper support for the iPhone OS 3.x database. That said, if you’re interested in being an early adopter of iPhone sync support and helping us test it, here’s how.

If you are a new or inexperienced user, or you are not used to compiling things from source, editing configuration files, and doing some basic troubleshooting, stop here. This isn’t ready for you. In the not too distant future, distros will package this, it will be delivered with your usual dose of healthy and working open source software, and it will all work automagically as soon as you plug in your device.

A few notes:

  • Keep in mind that if you’re using distro packages for anything I’m going to mention here, you’ll need the development headers too (-dev package or similar).
  • When linking to packages below, I’ll link the name to the homepage and the version to a download link or something close to it: if you’re reading this post soon after it was posted, then the versions should be up to date. If it’s been more than a few days, you should check for newer versions.
  • You’ll also need cmake to build some things (2.6 or newer); your distro should provide a package for it.
  • Most packages will install to /usr/local by default. This should be fine, but you may have to uninstall any older distro packages that live at /usr, and apps may or may not pick up libraries on /usr/local. If you want, you can change the prefix to /usr. You should already know how to do this for autotools-based packages. For CMake-based ones, pass something like -DCMAKE_INSTALL_PREFIX=/usr when calling cmake.
  • The libiphone/ifuse page has links to distro repositories with packaged versions of everything here. Yay, you’ve just saved a bunch of time! Do follow the steps below, but you can use these packages instead of building from source.

Possible pitfalls:

  • If you’ve had prior versions of usbmuxd/libiphone/etc, make sure they’re gone, especially any udev rules files in /etc/udev/rules.d.
  • If you’ve been syncing via SSH, and you log in as root, your permissions might be messed up. Run chown -R mobile /var/mobile/Media on the phone, and make sure you don’t get any permission errors when changing files via an ifuse mount.
  • There’s a udev bug that causes usbmuxd not to respond to signals, which means it will never quit if you remove all devices, and it might not detect any new devices after you’ve plugged in the one that caused it to start up. As a workaround, kill -9 it, and run it from the console. A workaround for this bug is also in the usbmuxd Git repo.

Step 1

Install libusb-1.0.3 (or newer). This should be straightforward. If your distro carries it, that’s fine, just make sure it’s 1.0.3 at least (if it isn’t, the repos I mentioned above probably have it).

Step 2

Install usbmuxd-1.0.0. Make sure you read the README file, especially the part about creating a user named usbmux with USB access permissions (does not apply if you’re using distro packages, hopefully). After installing usbmuxd, you should increase the syslog debug level by editing /lib/udev/rules.d/85-usbmuxd.rules and adding -v -v flags to the end of both RUN statements, like this: RUN+="/usr/sbin/usbmuxd -u -U -v -v" (and similarly for the other line). This will get you useful debug information in syslog without flooding you with messages.

Have syslog open (tail -f, xconsole, whatever). Plug in (or replug) your device. You should see something like this:

usb 3-4.3: new high speed USB device using ehci_hcd and address 68
[...]
usbmuxd[12705]: [3] usbmux v1.0.0 starting up
usbmuxd[12707]: [4] Creating socket
usbmuxd[12707]: [3] Successfully dropped privileges to 'usbmux'
usbmuxd[12707]: [4] Initializing USB
usbmuxd[12707]: [4] Found new device with v/p 05ac:1290 at 3-68
usbmuxd[12707]: [4] Using wMaxPacketSize=512 for device 3-68
usbmuxd[12707]: [3] Connecting to new device on location 0x30044 as ID 1
usbmuxd[12707]: [4] 1 device detected
usbmuxd[12707]: [3] Initialization complete
usbmuxd[12707]: [3] Connected to v1.0 device 1 on location 0x30044 with serial number be2975afb30b6db9025f95261b9e0a7041044661

If you don’t see anything related to usbmuxd, either you forgot the -v -v or you need to reload your udev rules: $ sudo udevadm control --reload-rules. As a last resort, try rebooting. If it still doesn’t work, something’s wrong. You can continue by running usbmuxd manually as explained in the README, but you should report a bug.

If you have a jailbroken phone with SSH, try running $ iproxy 2222 22 and then SSH to localhost, port 2222 on another console. You should be able to SSH into your phone.

Unplug your phone. If usbmuxd was started via udev (not manually), it should quit. If it doesn’t, report a bug.

Step 3

Install libplist-0.16 and then libiphone-0.9.4 and ifuse-0.9.4.

Now you should be able to mount your phone by simply running $ ifuse <mountpoint>. You should be able to see the media folder structure and even grab photos and other stuff. If you have a jailbroken phone, you can use the --root option to mount the root filesystem with root privileges (I usually prefer ssh/sshfs for this, though). Do NOT use the --root option to sync music, it will not work and may mess up your permissions.

If you have access to more than one iPhone or iPod Touch, we could use some multiple-device testing! Usbmuxd should happily start up when you plug in the first device, keep running while you plug in any other devices, and stop once all devices have been removed. Usbmuxd will report the device UUIDs (it calls them “serial numbers”) as they are connected (if you’re using -v -v). You should be able to pass the --uuid=<uuid> option to ifuse to mount a specific device. Please test this for us!

Intermission

If you are not used to alpha software, checking out development sources, testing patches, and working with developers, stop here. Now you’ve got all the underlying stuff working, so you’re probably better off waiting for some time until libgpod stabilizes some and things are merged and tested.

If you are a developer willing to help, a very enthusiastic power user, or simply a masochist, feel free to read on. Be warned: pain lies ahead, don’t even think about using the following for day-to-day use at this point in time. From here on there are no distro packages and no nice source tarballs. Experiments and feedback only. This Will Eat Your Music Collection For Dinner And Replace It With Hours And Hours Of <insert terrible music>.

Step 4

Clone teuf’s sandbox Git repository for libgpod, and switch to the iphone30 branch the libgpod git repository at SourceForge, then compile and install it:

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

Step 5

Mount the device and create the iTunes_Control/Device directory. Then, get your UUID (it should be in the syslog from usbmuxd, or you can find it by running $ lsusb -v | grep -i iSerial). It should be 40 characters long. Then, run $ tools/ipod-read-sysinfo-extended <uuid> <mountpoint>. This should generate a file named iTunes_Control/Device/SysInfoExtended. Make sure it’s not empty and whatnot; it should be a large-ish plist (XML file) with a bunch of info.

Step 6

Make sure your device already contains a valid music database created by iTunes. If it doesn’t, drop me a line on IRC and we can try some cool new stuff. New databases can be created, but there might be issues and you need some way of generating the HashInfo file (more on this later).

Step 7

Open an application that uses libgpod to manage iPods. Gtkpod is recommended at this stage, as its what I use to test. Other apps (Rhythmbox, Amarok, etc) theoretically should work. Theoretically, because Amarok 1.4 crashes/hangs pretty badly for me, for example, and I’m not sure who is to blame. I’d like to hear any success or failure stories. Please run your app from a console so you can see any debug messages.

First, load your device. Once the application has accessed the music library, a new file called HashInfo should have popped up in the iTunes_Control/Device directory. If it isn’t there, you’ve got a problem: check stdout for any messages and and preferably ping me on IRC or at least e-mail me your UUID and your iTunes-created iTunes_Control/iTunes/iTunesCDB file (it shouldn’t have been modified yet).

Make some changes (add a song, make a playlist, etc), save, and cross your fingers. With any luck, you’ll get some debug spew, any songs will transfer, the iPhone/iPod will show a pretty “syncing” screen, the database will be written, the “syncing” screen will go away, and you’ll be able to launch the iPod application and see your changes and play any new songs. There will be bugs at this stage, but please do report any issues along with expected behavior.

Step 8

Plug your device into a computer running iTunes (unmount it on your Linux computer first!) and check that it can see the changes made with libgpod. This is very important, because iTunes and the device use different databases: the data managed by iTunes and libgpod is maintained in an iTunesCDB (a compressed version of the old, classic iTunesDB format), but it is converted to a new SQLite database format for the iPod app to use. So both libgpod and iTunes read the iTunesCDB, but they write out the iTunesCDB and the SQLite databases. You should be able to make changes in iTunes and swap your device from iTunes to libgpod and back and see them, etc.

Bugs

Tons. The only things tested to work are managing simple music and working with simple playlists. There’s a known annoying bug where the iTunes special playlists (Ringtones/etc) are converted to normal playlists by libgpod, and then iTunes recreates them if you use it again, creating duplicates each time you switch between using libgpod and iTunes. The DB schema is outdated (3.0 instead of 3.1), so you’ll see a (hopefully short) “Updating” step when you launch the iPod app. Please report issues, but keep in mind that they’re to be expected. This is very very very alpha code. I probably screwed up something on this post even, so chances are you’ll get stuck somewhere. Tough luck, it’s 7am and I need to catch some sleep ;)

Hope you had fun! Keep in mind that you can usually find us on #gtkpod on freenode if you need to report an issue. Comments on this post are fine too, for now.

Tags: , , ,

170 Responses to “iPhone syncing on Linux, part 2”

  1. StoneCut Says:

    Hi there, excellent work by everyone involved. Many thanks ! Finally syncing on 3.x again.

    Anyway, I ran into an issue apart from the duplicate special playlists you mentioned.

    First off, here’s what I did:
    Installed most things via ifuse PPA for Ubuntu Jaunty. Addtionally I installed iproxy and the iphone-utils from same repo.
    Next, I had to compile gtk-doc from source since I couldn’t find a deb package for it. I needed this to compile libgpod as per your instructions.
    Lastly, I had to compile gtkpod (SVN) from source since my standard repo package insisted installing libgpod4 as well, which I had compiled by hand already and I didn’t want to run into any issues with that.
    Followed your guide as well as possible. So far, so good. Everything actually works quite well (mountint, SSH’ing via iproxy, browsing music collection/adding songs/creating new playists in GTKpod and so on).

    However, here’s the main issue:
    The music collection gets correctly displayed in GTKpod (artist, song, album etc). However, if I do any edits and then open the iPhone’s iPod app then the album collection under the “More …” tab is messed up – It shows single songs instead of Album names and you can’t browse them either. The music is still there, though, and still works when selected by other means.
    It’s just a minor issue but it makes it pretty inusable for me right now. I hope this tiny bug could be fixed or maybe I did something wrong.

    Can you help me with fixing this issue ?

    I have some other questions, as well.
    * How do I determine the model number to use for GTKpod’s import function ? I have several to choose from for my black 16 GB 3G ?
    * Can I delete the duplicate special playlists ? Does anything bad happen if I do it ?
    * My Ubuntu Jaunty automatically mounted my 3G’s Photo folder even before I installed all these packages. So now, everything is mounted twice. How can I prevent that ? (I don’t need the regular photo mount for gphoto2).
    * Is work for the 3.1 db being done ? Is there any way a user can help ?

    Many thanks for all the hard work again ?

  2. marcan Says:

    Hello StoneCut, thanks for the bug report about the Album view. As I said, this code is very very new and buggy and things like that are to be expected. I’ll add it to my TODO list.

    I can’t remember what the exact procedure for determining the model type for iPhones is, but I doubt it makes much of a difference. They all run the same firmware anyway.

    Feel free to delete the dupe playlists, it shouldn’t affect anything.

    The photo folder stuff is due to the iPhone’s PTP interface, which is a digital camera standard and is not specific to the iPhone. I don’t know about specific steps for ubuntu, but look under general digital camera stuff. Uninstalling relevant packages if you don’t need them (libgphoto comes to mind) might be a bit drastic but will probably get rid of te photo mounting.

    Yes, the DB format stuff is being worked on. Right now, the schema is based on 3.0, but it works on 3.1 with the minor “updating…” step happening when you open the iPod app. The best way to help is by looking for broken things, such as the Album collection issue that you’ve already identified. Thanks!

  3. spailler Says:

    It doesn’t work anymore since i upgrade ifuse, libplist and libiphone, neither on my iPhone V1 (os3.0) nor my 3GS (3.1).
    Here is the message i get using “$ifuse /media/iPhone” :
    “usbmuxd_get_device_list: error opening socket!
    No device found, is it connected?
    If it is make sure that your user has permissions to access the raw usb device.
    If you’re still having issues try unplugging the device and reconnecting it.”.

    Of course, my iPhone was connected at that time and i created the user “usbmux” as mentioned with the good permissions.
    I’m sure i did something wrong but what ? Thanks (i’ll keep searching).

  4. StoneCut Says:

    I’d like to point out that I was only able to compile libgpod from your GIT repo, I couldn’t switch to iphone30 branch on the other one.

  5. StoneCut Says:

    Sorry, I forgot to mention that after syncing with iTunes and then GTKpod again, I get a message from GTKpod that SHA-1 checksums have changed (or something) and then it scans through the tracks again. Is this to be expected due to the 3.0 DB instead of 3.1 or am I using outdated components ?

    BTW: I figured out how to determine the iPhone Model for GTKpod – just run iphoneinfo from the iphone-utils package. However, my iPhone model (MB497) is not listed in GTKpod. The closest match is xB496, which I’m using.

  6. StoneCut Says:

    Sorry, for spamming again – but I figured out that the album bug is only in your git version of libgpod, today I was able to switch to iphone30 branch of teuf’s git repo and his version does not have the album bug.

    Figured you might want to know.

  7. marcan Says:

    I merged teuf’s changes yesterday, you should be able to update my branch and use it too ;) (the bug was fixed soon after you reported it)

  8. marcan Says:

    @spailler

    Check that usbmuxd is running, and check syslog for its messages. If in doubt, kill any running instance and run it manually in the foreground (-f).

  9. spailler Says:

    @marcan

    Thank you, i succeed to mount my iPhones again (well, only as root but that’s a progress) !!!
    I’ll try libgpod from your repositery with gtkpod.

  10. StoneCut Says:

    Hey marcan, I switched back to your libgpod branch and it’s working fine now, too, as you said. Many thanks !

    BTW: Why is it that every time I unmount the device using GTKpod’s device option it actually syncs with the iPhone even if nothing changed ? I couldn’t figure out how to use the iPhone with Rhythmbox.

  11. marcan Says:

    The syncing screen is shown whenever the database is written, which probably happens when the iPhone is unmounted too. In the future it should be more intelligent, so it also shows up while copying files and such (right now it only pops up at the end, after files have been copied).

    The procedure to get it working with rhythmbox should be similar. I’ve never used it though, so I can’t really help you.

    @spailler:
    You may need to be in a special group (fuse) to use ifuse, you might want to check that.

  12. benoit2600 Says:

    I have an error when I plug my Ipod touch 3g jaillbreak. I’m on Ubuntu 9.10 and I’m using the jonabeck’s ppa.

    this is the syslog debug :

    Nov 3 23:05:08 ben-desktop kernel: [ 93.801356] usb 1-2: USB disconnect, address 3
    Nov 3 23:05:11 ben-desktop kernel: [ 96.760020] usb 1-2: new high speed USB device using ehci_hcd and address 7
    Nov 3 23:05:11 ben-desktop kernel: [ 96.895077] usb 1-2: configuration #1 chosen from 3 choices
    Nov 3 23:05:34 ben-desktop wpa_supplicant[1603]: CTRL-EVENT-SCAN-RESULTS
    Nov 3 23:05:35 ben-desktop kernel: [ 120.390786] usb 1-2: usbfs: interface 0 claimed by usbfs while ‘usbmuxd’ sets config #3
    Nov 3 23:05:36 ben-desktop kernel: [ 121.392914] usb 1-2: usbfs: interface 0 claimed by usbfs while ‘usbmuxd’ sets config #3
    Nov 3 23:05:37 ben-desktop kernel: [ 122.394955] usb 1-2: usbfs: interface 0 claimed by usbfs while ‘usbmuxd’ sets config #3
    Nov 3 23:05:38 ben-desktop kernel: [ 123.396988] usb 1-2: usbfs: interface 0 claimed by usbfs while ‘usbmuxd’ sets config #3
    Nov 3 23:05:39 ben-desktop kernel: [ 124.399044] usb 1-2: usbfs: interface 0 claimed by usbfs while ‘usbmuxd’ sets config #3

    and usbmuxd :
    ben@ben-desktop:~$ sudo usbmuxd -f -v -v -U
    [23:33:23.549][3] usbmuxd v1.0.0 starting up
    [23:33:23.549][4] Creating socket
    [23:33:23.549][3] Successfully dropped privileges to ‘usbmux’
    [23:33:23.549][5] client_init
    [23:33:23.549][5] device_init
    [23:33:23.549][4] Initializing USB
    [23:33:23.549][5] usb_init for linux / libusb 1.0
    [23:33:23.550][4] Found new device with v/p 05ac:1299 at 1-7
    [23:33:23.551][2] Could not set configuration 3 for device 1-7: -6
    [23:33:23.551][4] 0 devices detected
    [23:33:23.551][3] Initialization complete
    [23:33:24.553][4] Found new device with v/p 05ac:1299 at 1-7
    [23:33:24.553][2] Could not set configuration 3 for device 1-7: -6
    [23:33:25.555][4] Found new device with v/p 05ac:1299 at 1-7
    [23:33:25.555][2] Could not set configuration 3 for device 1-7: -6
    [23:33:26.556][4] Found new device with v/p 05ac:1299 at 1-7
    [23:33:26.557][2] Could not set configuration 3 for device 1-7: -6

    Do you know what’s the problem ?

  13. marcan Says:

    It sounds like someone else (probably something using gphoto to talk to the PTP interface) is accessing the iPod while usbmuxd is trying to set the correct interface. Normally, udev should do this redundantly before any other app has a chance to grab the device (and it should also start usbmuxd automatically). Does the usbmuxd udev mode work? Try the udev debugging steps mentioned in the post, and you can also try to run udevadm control --log-priority=9 to get extensive udev debug information in syslog.

  14. StoneCut Says:

    Is there any way to sync the songs added to the iPod with GTKpod back into iTunes ? I couldn’t figure it out. I’m sorry since I realize that this is more of an application question.

  15. benoit2600 Says:

    It seems the usbmuxd udev mode doesn’t work,
    syslog with –log-priority=9 :
    http://pastebin.com/f7ea21385

  16. marcan Says:

    @StoneCut
    The songs should show up on iTunes. If what you want to do is actually copy them out of the iPod into iTunes, sorry, Apple disabled that feature for iPhone and iPod Touch.

    @benoit2600
    Does /lib/udev/rules.d/85-usbmuxd.rules exist?

  17. benoit2600 Says:

    yes :
    http://pastebin.com/m577990

  18. StoneCut Says:

    @benoit2600:
    Try editing the udev rule to include your user name:
    RUN+=”/usr/local/sbin/usbmuxd –user=username –verbose”

    Then reload the udev rules:
    sudo udevadm control –reload-rules

    Connect your iPhone again and check if usbmuxd is running now:
    ps ax | grep usbmuxd

    If usbmuxd gets launched now then the “usbmux” user didn’t get correctly created.

  19. benoit2600 Says:

    I do the modificatoin and I reboot my Pc, and ps ax | grep usbmuxd give me :

    ben@ben-desktop:~$ ps ax | grep usbmuxd
    2503 pts/0 R+ 0:00 grep –color=auto usbmuxd

    and if I plug my ipod touch, nothing change.

    ben@ben-desktop:~$ ps ax | grep usbmuxd
    2503 pts/0 R+ 0:00 grep –color=auto usbmuxd
    ben@ben-desktop:~$ ps ax | grep usbmuxd
    2557 pts/0 R+ 0:00 grep –color=auto usbmuxd

    this is the syslog :
    http://pastebin.com/m33c0a026

    /lib/udev/rules.d/85-usbmuxd.rules :
    http://pastebin.com/m699a06c7

  20. benoit2600 Says:

    when I launch manually usbmuxd I have this :

    ben@ben-desktop:~$ sudo /usr/local/sbin/usbmuxd –user=ben –verbose -u -f
    [20:10:13.365][3] usbmuxd v1.0.0 starting up
    [20:10:13.365][4] Creating socket
    [20:10:13.365][4] Initializing USB
    [20:10:13.366][4] Found new device with v/p 05ac:1299 at 1-6
    [20:10:13.366][2] Could not set configuration 3 for device 1-6: -6
    [20:10:13.366][4] 0 devices detected
    [20:10:13.366][3] Initialization complete

    and syslog says :

    Nov 4 20:09:52 ben-desktop kernel: [ 705.335821] usb 1-2: usbfs: interface 0 claimed by usbfs while ‘usbmuxd’ sets config #3

  21. GhettoDuk Says:

    I am trying this under Ubuntu Karmic Koala 9.10 x64 and am having no success.
    My syslog appears to show usbmuxd launching 4 times when connecting my iPhone and when I try to mount the phone with ifuse. It tells me the following:
    ifuse: symbol lookup error: ifuse: undefined symbol: iphone_get_device

    I made a page with all my info and outputs. http://docilecock.com/iphone.html

    I’m really grateful for all your hard work.

    Thanks,
    Trey

  22. spailler Says:

    @marcan

    I tried to mount 2 iphones simultaneously but I didn’t have success.
    When i typed : “$sudo ifuse /media/iPhone -u ‘UUID of my iPhone’” or “$sudo ifuse /media/iPhone –uuid UUID”, i get “ERROR: the mount point specified does not exist”.
    This is strange because when i typed “$sudo ifuse /media/iPhone” it worked very well.
    I tried to check on the syslog but I don’t really know how to use/read it so …

  23. Rob2687 Says:

    spailler: try
    sudo ifuse /media/iPhone –uuid=UUID

  24. Rob2687 Says:

    With regards to the Rhythmbox issue I found this:
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=534121
    https://bugzilla.gnome.org/show_bug.cgi?id=586886

  25. marcan Says:

    @spailler:
    Try --uuid=UUID. The option parsing code in ifuse appears to be dodgy.

    @benoit2600:
    Check that there are other files in /lib/udev/rules.d/ and also check that there is no usbmuxd rules file in /etc/udev/rules.d/. Undo the modification, it shouldn’t be necessary.

    @GhettoDuk:
    The disconnection line in the udev rules file appears to be triggered spuriously. This should be harmless for now, just ignore the extra usbmuxd messages. As for ifuse/libiphone, it looks like it might be picking up an incorrect libiphone version? Try ldd `which ifuse`.

  26. spailler Says:

    @marcan & Rob2687

    Thank you, that woks very well with your trick ! I finally succeed to mount my 2 iPhones simultaneously and make some successful “copying files” tests.
    (I had to create 2 different mounting points in “/media/” as there aren’t created automatically but I guess it’s normal).

    @marcan
    Is there any particular multi-devices tests you may want to try ?

  27. benoit2600 Says:

    all files in /lib/udev/rules.d/ :
    http://pastebin.com/m4a2eefe6

  28. marcan Says:

    @spailler:
    Just copying a few files (at the same time to both devices) and in both directions or so, and also repeated unplugging/plugging scenarios, just to make sure usbmuxd plays nicely with them.

    @benoit2600:
    Check /etc/udev/rules.d/ (sorry, my HTML was broken in that past comment).

  29. benoit2600 Says:

    It’s work !
    I have in /etc/udev/rules.d/
    85-usbmuxd.rules

    I remove it, and, nothing change :-(

    But, I also have
    89-libiphone.rules
    http://pastebin.com/m5351c6a2

    and He doesn’t have any lines about Ipod touch 3G so, I add one
    http://pastebin.com/m1effa6a4

    and after I re-plug my ipod touch, it doesn’t work, but if I launch usbmuxd manually, It Work !!!!
    syslog
    http://pastebin.com/m510c25d6

    I can see some lines about usbmuxd, but It’s not like in your exemple, I will see that tomorrow, it’s time to sleep in France :-)

  30. Archimedes Says:

    Hi Marcan
    One question: Will support for the old DB format be dropped or will libgpod be able to write appropiate DBs? I am asking as I still use iPhone 3G with 3.0 firmware (I have no Windows available for update, but at least I can sync now).

    Maybe I’ll write a faster HowTo for Arch Linux (I am running nearliy fine on x86_64) and supply my PKGBUILD for your iphone30 branch.

    Though, there seems to be a problem with usbmuxd, but I think thats because the downstream package in Arch Linux is bad (for example, no usbmuxd user is created).

    Thank you for your work :-)

  31. marcan Says:

    3.0 firmware should work now. I’m not sure how modern iTunes handles it – my hope and guess is that the new DB schema is backwards-compatible, which should work out fine for libgpod. If it isn’t, then we’ll have to implement some kludge to support multiple schemas.

  32. rune0077 Says:

    @Archimedes
    Hey, how did you grant the usbmux user permission to access the iphone? I got everything running more or less on 64bit arch as well. If I run usbmuxd from commandline with sudo and my own username all is fine and my iphone mounts beautifully. But when usbmuxd launches automatically (when plugging in the phone) under the usbmux user I created, nothing happens. I need to somehow give it write access to the phone, but not sure how to do that?

  33. marcan Says:

    Usually you need to add it to the “usb” group.

  34. benoit2600 Says:

    hello, thanks for your help, but I have another small probleme, when I plug my ipod touch, usbmuxd run, but he exiting directly

    syslog
    http://pastebin.com/m5822c3eb

    but if I launch the same command in my terminal, no problem.

    ben@ben-desktop:~$ sudo /usr/sbin/usbmuxd -u -U -v -v

    syslog
    http://pastebin.com/m32e9027

  35. Archimedes Says:

    rune077: That is what I meant by “there seems to be a problem with usbmuxd”.
    Arch Linux has no usb user group, or at least mine doesn’t have one. So I’ll start poking arround with it as soon as I have some spare time (which I don’t have right now, but maybe this or next weekend).

    Right now I run usbmuxd by hand, as a work arround I defined in my .bashrc:
    alias iphone-mount=’sudo /usr/bin/ifuse /media/iPhone’
    alias iphone-mux-on=’sudo /usr/sbin/usbmuxd -f’
    alias iphone-mux-kill=’sudo /usr/bin/killall usbmuxd -9′

    But as I said, this seems to be a problem with the arch package, not with usbmuxd itself.

    (btw: OpenID is cool, I put it into my blog as well :) )

  36. StoneCut Says:

    HOW-TO FOR VIRIGIN KARMIC KOALA

    First off, apply all available system updates for Karmic Koala !

    Now, let’s get started !

    Applications -> Accessories -> Terminal:
    $ sudo gedit /etc/apt/sources.list

    Add this at the end:
    ## Custom sources for iFuse and other iPhone stuff
    deb http://ppa.launchpad.net/jonabeck/ppa/ubuntu karmic main
    deb-src http://ppa.launchpad.net/jonabeck/ppa/ubuntu karmic main

    Save and exit.

    Get Repo Key and install iFuse and Utils:
    $ sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com F0876AC9
    $ sudo apt-get install ifuse
    $ sudo apt-get install libiphone-utils iproxy

    Test with “ps ax | grep usbmuxd” in Terminal after plugging in iPhone -> usbmuxd should be running !

    In one termional run a “sudo iproxy 2222 22″

    In another Terminal use “ssh -p 2222 root@localhost” to verify SSH connection via USB is possible.

    Ok, let’s make the mountpoint:
    $ sudo mkdir /mnt/ipod
    $ sudo chmod 777 /mnt/ipod/

    Let’s edit a FUSE config file.
    $ sudo gedit /etc/fuse.conf

    -> Remove the “#” in front of “user_allow_other”, save and exit.

    Next, open “System” -> “Administration” -> “Users and Groups” in Ubuntu Menu. Click on the little key at the bottom to unlock it for making changes. Then, select your username and click on “Manage Groups”.

    Find the “fuse” group and double-click on it. Make a checkmark next to your name in the window that opens. Click on OK and close all dialogs. You’re now in the “fuse” group.

    Next, completely log out and in again – do a reboot to be safe. This is important !

    Open up a terminal again. Let’s verify we’re really in the “fuse” group:
    $ id
    -> You should see some group names, among them should be “fuse”.

    We can now mount the phone as regular user after connecting it (run “ps ax | grep usbmuxd” to verify that usbmuxd is listening if you want):
    $ ifuse /mnt/ipod/

    We can also unmount as regular user (a sudo shouldn’t be necessary):
    $ fusermount -u /mnt/ipod/

    Ok, now let’s compile libgpod4, but first we probably need to install ‘git’:
    $ sudo apt-get install git-core

    We’ll also need to install all these packages in order to be able to compile our source:
    $ sudo apt-get install autoconf libtool libglib2.0-dev intltool gtk-doc-tools sqlite3 libsqlite3-dev zlib1g-dev libxml2-dev checkinstall

    Alright, let’s grab the libgpod4 source via GIT:
    $ git clone git://gitorious.org/~marcan/libgpod/marcan-sandbox/
    $ cd marcan-sandbox/
    $ git checkout origin/iphone30
    $ CFLAGS=”-g -O0″ sh autogen.sh –prefix=/usr

    Ok, for some reason I can’t get the “libgdk-pixbuf2″ and “libgdk-pixbuf-dev” libs for Karmic Koala – for Jaunty Jackalope they were in the “Universe” repo.

    The result is that you will get a warning at the end of the “CFLAGS …” run saying something like:

    **WARNING** gdkpixbuf support is disabled. libgpod won’t be able
    to read or write artwork (covers, photos, …) from/to the iPod

    Ok, we’ll acknowledge that for now and go on:
    $ make

    Before we can create and install our new package, we need to get rid of the “original” libgpod first:
    $ sudo apt-get remove libgpod-common

    Ok, let’s create a DEB out of our new libgpod4 package and install it:
    $ sudo checkinstall

    Just hit Enter at the question “Should I create a default set of package docs ?”.

    Next, enter a description, for example “Libgpod4 SVN”, then hit ENTER and ENTER again on the new line to end editing the description.

    Now enter “2″ and hit ENTER to edit the package name. Type in “libgpod4″ and hit ENTER.

    Now, choose “11″ and hit ENTER. Type in “libgpod4″ again and hit ENTER.

    Finally, enter “3″ and hit ENTER. Type in this as version: “0.7.3″ and hit ENTER again.

    When you’re back just hit ENTER without any numbers and the package will be compiled and installed. (If you want to remove it later type in “dpkg -r libgpod4″.

    Ok, now mount the device with “ifuse /mnt/ipod/” (if not still mounted) and create the “iTunes_Control/Device” directory:
    $ mkdir /mnt/ipod/iTunes_Control/Device/

    Then, get your UUID:
    $ lsusb -v | grep -i iSerial

    It’s the first number and should be 40 characters long. Then, run:
    $ ipod-read-sysinfo-extended
    (mountpoint here is /mnt/ipod/)

    This should generate a file named iTunes_Control/Device/SysInfoExtended.

    Make sure it’s not empty and whatnot; it should be a large-ish plist (XML file) with a bunch of info.

    Now, we can just install GTKpod:
    $ sudo apt-get install GTKpod

    Mount the iPhone:
    $ ifuse /mnt/ipod/

    Next, launch GTKpod.

    It should show your device, click on “Load Ipod(s)” and you will be able to see that GTKpod indexes your songs on the iPhone in the status bar. Once done, it will display the contents. Do not worry about all the debug information that gets displayed to you – it’s only for developer purposes and troubleshooting).

    You can now fill up your iPod app with music using GTKpod. Don’t forget to safely remove the device via right-click in GTKpod when you’re done. The next time you launch the iPod app it will take a little while to update the database but then you’re set. The reason for this is that libgpod is currently for OS 3.0, so if you sync with 3.1.2 then the iPhone will need to update the database when you launch the iPod app. Apparently the key for 3.1.2 music db is discovered, though, so this minor inconvenience should go away at some point in the future.

    THAT’S IT !!!

  37. rune0077 Says:

    @marcan & Archimedes
    Yeah my problem as well, no usb-user in arch. I tried creating one just for the hell of it, then added the usbmux user to it, but, not surprisngly, it did nothing.

  38. rune0077 Says:

    Meant no usb-group.

  39. StoneCut Says:

    Here’s the correct group for Ubuntu:
    $ id usbmux
    uid=120(usbmux) gid=46(plugdev) Gruppen=46(plugdev)

    -> “plugdev”. You may need “fuse”, too, maybe !?

  40. spailler Says:

    @StoneCut

    Thank you for the tutto. By the way, I got a problem using “$ ipod-read-sysinfo-extended” :
    ** (process:16880): WARNING **: Compiled without libiphone support, can’t read SysInfoExtended from an iPhone UUID.
    (I tried with a iPhone V1 OS3.0 on Karmic Koala).

    Any ideas how i can fix that (I already have the package libiphone0 installed so …)

  41. asavva Says:

    @StoneCut – I had this problem and it was because I didn’t have the libiphone-devel library installed. Before you build libgpod you need to make sure that the development libraries are installed.

    Marcan – many thanks for all your hard work – I’ve been waiting for 3GS support for months and it works perfectly now.

  42. aquasync.myopenid.com/ Says:

    The iFuse mounting worked a treat. Usbmuxd prints out a lot of messages when older ipods are plugged in though, not sure if thats a problem at all:

    [13:34:16.164][4] Found new device with v/p 05ac:1261 at 2-4
    [13:34:16.164][2] Could not set configuration 2 for device 2-4: -6
    (ad infinitum)

  43. marcan Says:

    That’s a known bug, fixed in git. The PID range check broke when it was changed and usbmuxd will try to claim all existing Apple devices. It should cut down on the messages if you start it via udev, though, since then it will only scan when new devices are plugged in, not every second.

  44. rezoant.wordpress.com/ Says:

    Exciting to be able to work with my iPod in Linux! So far I’ve ran into one thing that’s not really mentioned in this post: some steps can fail if your iPod is locked (with a pass code). This tends to make sense, for instance you wouldn’t want to be able to have someone steal your iPod and then be able to connect, read data, and write to it without first hacking the pass code.

    The two steps it happened to me are when initially plugging the device (usbmuxd initialization) and using the tool from gtkpod to generate the extended information (an error like “Could not generate extended info”).

  45. StoneCut Says:

    Is there any way to get this to work with Songbird ?

  46. rezoant.wordpress.com/ Says:

    @spailler

    If you have installed packages for libiphone, you will need to install the libiphone-dev (or equivalent) package to get the headers. Then reconfigure the gtkpod sources and ensure that it says “iPhone/iPod Touch support: yes” or something in the summary after configuration is done.

  47. rezoant.wordpress.com/ Says:

    Btw I don’t know who packages libusbmux0 on ubuntu, but the udev rules were missing some parts that assigned the correct permissions to the device files created when your iPod is plugged in.

    If you see an error opening the device from usbmuxd with error code -3, try changing the ACTION==”add” line of /lib/udev/rules.d/85-usbmuxd.rules to something like this:

    ACTION==”add”, SUBSYSTEM==”usb”, ATTR{idVendor}==”05ac”, ATTR{idProduct}==”129[0-9]“, ATTR{bConfigurationValue}!=”$attr{bNumConfigurations}”, ATTR{bConfigurationValue}=”$attr{bNumConfigurations}”, OWNER=”usbmux”, MODE=”770″, RUN+=”/usr/sbin/usbmuxd -u -U -v -v”

    the parts I’ve added are OWNER=… and MODE=…

  48. rune0077 Says:

    @rezoant
    Holy crap, that did the trick for me on Arch as well. No need to run usbmuxd manually any longer. Thanks a bunch.

    Archimedes: to sum it up, you need to create the usbmux user yourself, then add the options from rezonant above to your udev rules (OWNER=”usbmux”, MODE=”770″), and everything should be fine.

  49. rune0077 Says:

    Me again. Some bugs after compiling libgpod. When I run gtkpod, after the first time, I get this:

    Hashed file is 0 bytes long
    Could not create hash value from itunesdb
    Extended info will not be used

    Maybe something to do with my iphone not having been connected to Itunes since originally jailbreaking it (I only have Linux-boxes so no itunes)? Strangely, my music transfers just fine and plays without a hitch from the phone.

  50. StoneCut Says:

    @marcan: Everytime I connect my 3G to GTKpod I get a warning that extended info will not be used. Is this anything to be worried about ? It works fine apart from that.

  51. Erik Winkels Says:

    @rezoant: thanks for that, that got it working for me on plain Debian as well (using the Ubuntu packages).

  52. gilir.wordpress.com/ Says:

    Thanks a lot for this, I was able to sync some music with Ubuntu 9.10 without any pain :)
    Do you know when this branch of libgpod will be merged in trunk, even if it’s an option at build time ? I would love to package it for the next Ubuntu release :)

  53. sharkcohen Says:

    Hello all. I’ve installed libusb-1.0.4 and usbmuxd-1.0.0-rc2. When I plug in my iPhone 3GS, I get the following in /var/log/messages. Note the ‘could not open device’ and ’0 devices detected’. I wanted to see if this was abnormal before I continued. Thanks.

    Nov 10 19:11:31 sharkdesk kernel: [ 688.952872] usb 1-4: new high speed USB device using ehci_hcd and address 3
    Nov 10 19:11:31 sharkdesk kernel: [ 689.072059] usb 1-4: configuration #1 chosen from 4 choices
    Nov 10 19:11:31 sharkdesk usbmuxd[5172]: [3] usbmuxd v1.0.0 starting up
    Nov 10 19:11:31 sharkdesk usbmuxd[5174]: [4] Creating socket
    Nov 10 19:11:31 sharkdesk usbmuxd[5174]: [3] Successfully dropped privileges to ‘usbmux’
    Nov 10 19:11:31 sharkdesk usbmuxd[5174]: [4] Initializing USB
    Nov 10 19:11:31 sharkdesk usbmuxd[5174]: [4] Found new device with v/p 05ac:1294 at 1-3
    Nov 10 19:11:31 sharkdesk usbmuxd[5174]: [2] Could not open device 1-3: -3
    Nov 10 19:11:31 sharkdesk usbmuxd[5174]: [4] 0 devices detected
    Nov 10 19:11:31 sharkdesk usbmuxd[5174]: [3] Initialization complete

    sharkcohen@sharkdesk:~$ id usbmux
    uid=114(usbmux) gid=46(plugdev) groups=46(plugdev)

  54. marcan Says:

    That is not normal. Check to make sure your USB device node permissions are usable. You may want to try running usbmuxd as root (without the -U option).

  55. sharkcohen Says:

    Thank you, marcan. I tried running usbmuxd as root, and it works. Unfortunately, I don’t know what to check from here. I’m running ubuntu jaunty.

  56. BertoX Says:

    Hi Marcan, thank you for this excellent work !
    But I’ve have a problem : When I launch gtkpod, it says :
    Echec de l’import de la base de l’ipod : “Illegal seek to offset 0 (length 4) in file ‘/media/test/iTunes_Control/iTunes/iTunesDB’.”

    Gtkpod says it uses libgpod 0.7.2.

    But on IRC teuf said the lastest libgpod uses iTunesCDB and NOT ItunesDB.

    usbmuxd is OK, and I can mount the iphone with ifuse.

    Do you have any idea of what I missed please ?

    Thanks you in advance ;)

    Bert-.

  57. sharkcohen Says:

    I resolved my issue. I had to add not only OWNER and MODE to the /lib/udev/rules.d/85-usbmuxd.rules file, but GROUP as well:

    ACTION==”add”, SUBSYSTEM==”usb”, OWNER=”usbmux”, GROUP=”plugdev”, MODE=”770″, ATTR{idVendor}==”05ac”, ATTR{idProduct}==”129[0-9]“, ATTR{bConfigurationValue}!=”$attr{bNumConfigurations}”, ATTR{bConfigurationValue}=”$attr{bNumConfigurations}”, RUN+=”/usr/sbin/usbmuxd -u -U -v -v”

  58. mizar Says:

    Hi Marcan,
    I have a 3GS jailbroken iPhone. I installed libusb-1.0.3 on my gentoo box. Then I downloaded usbmuxd-1.0.0-rc2 and followed the README file. Creating a new user with “$ useradd usbmux” and adding such user only to the usb group give me the same error of sharkcohen.
    Adding the usbmux user also to the plugdev group solved the problem without the necessity to modify the udev rules that you give in your guide. Then i realized that the usb group is not necessary.
    Perhaps it should be better to specify to add the usbmux user to plugdev group in the guide. Hope I have been usefull. I’m now continuing with the guide.

  59. mizar Says:

    Hi,
    I realized that executing /usr/local/bin/iproxy gives me the error:

    /usr/local/bin/iproxy: error while loading shared libraries: libusbmuxd.so.1: cannot open shared object file: No such file or directory

    while executing iproxy from the build directory works correctly.

  60. sharkcohen Says:

    I think the unix group that usbmux will need to belong to is dependent on the distro. I know for ubuntu it is plugdev.

  61. StoneCut Says:

    @mizar: May sound stupid, but have you tried a “sudo ldconfig” yet ?

  62. woltrixx Says:

    Hey marcan, this works with ipod toch 3g without jailbreak? I’m having some problems to get it work. If you told me it should work for me, i’ll post my logs
    Sorry for my english but I suppose you don’t want to talk spanish here, because this blog is in english ;)

  63. marcan Says:

    @BertoX
    Do you have an iTunesCDB file? What firmware version are you running?

    @mizar
    Either make sure you install usbmuxd/iproxy to /usr/bin or make sure you have /usr/local/lib in your library path.

    @sharkcohen
    Yes, it depends on the distro ;)

    @woltrixx
    It should work on all phones, jailbroken or not.

  64. miller Says:

    Hello everyone.

    I have Iphone 3g 16gb black FW 3.1 (7c144) and openSUSE 11.2.
    I installed all needed packages from http://download.opensuse.org/repositories/home://FunkyM://iphone/openSUSE_11.2/x86_64/

    Everything was okey till step 7. First I mounted iphone with ifuse /media/iPhone –root. after connecting gtkpod to iphone no HashInfo appeared. i tried to load some music to the iphone and the gtkpod seemed to work but i couldn’t find anything on the iphone.

    i thought it’s odd that there was no my music in /iTunes_Control/Music and i found out it was stored in /private/var/mobile/Media/iTunes_Control/Music
    so I mounted it with ifuse /media/iPhone. there were no files in iTunes_Control/Device so i copied them from root partiton. when i tried to connect gtkpod to the iphone i had a mistake that BertoX had. i just deleted iTunesDB and it finally got connected but again no HashInfo appeared and despite gtkpod seemed to work nothing appears on the iphone itself.
    i believe there must be a way to fix the problem and hope that the story I just told you would be helpful.

  65. miller Says:

    and I forgotten, I’ve never seen “a pretty “syncing” screen” (

  66. marcan Says:

    Never mount with --root unless you’re doing something weird. Regular music sync is always without --root.

    Have you ever used iTunes with that phone? Are you using an up-to-date libgpod?

  67. miller Says:

    yes, I used this phone with iTunes and already have music on it. and libgpod is from step 4 of this manual.

  68. marcan Says:

    Use the phone with iTunes again. Make sure the music on it is readable to both iTunes and the phone itself. Then make sure you have an iTunes_Control/iTunes/iTunesCDB file, and that you also have an iTunesDB file that is 0 bytes. Then try gtkpod again and see if HashInfo shows up.

  69. miller Says:

    i resynced the phone with iTunes, everything was fine. iTunesDB file exists and it’s 0 bytes. HashInfo did not show up and I have the following errors:

    Hashed file elngth is 0 bytes.
    Cannot create hash value from iTunesDB
    extended info won’t be used
    Ipod database import error: “Illegal seek to offset 0 (length 4) in file ‘/media/iPhone/iTunes_Control/iTunes/iTunesDB’.”

    I’ve translated the errors from Russian, so originally it could be said in other words.

  70. marcan Says:

    What about iTunesCDB?

    also, please run ‘git describe –always’ in your libgpod git repo and let me know what it says.

  71. miller Says:

    iTunesCDB exists. it’s 91.5 kb.

    i don’t understand what’s a libgpod git repo, i ran the command in teuf-sandbox directoru and it said: fatal: Not a valid object name –always.

  72. marcan Says:

    The command is git describe --always (two dashes).

  73. miller Says:

    anyway fatal: Not a valid object name –-always

    tried without –always: fatal: cannot describe ‘ba8594839316c1112efdb6b8ee2e65d74ec42789′

  74. BertoX Says:

    Hi Marcan,

    Yes I have the CDB file.
    My OS version is 3.0.1

  75. marcan Says:

    To people having issues in general, please make sure:

    • You are using libgpod from either teuf’s or my repo. Run git describe to get the SHA1 ID of your revision and post it
    • Make sure you’re installing to /usr or that your distro is set up to pick libraries up from /usr/local, and that you don’t have duplicated libraries (make sure there’s only one copy of libgpod in /usr/lib and none in /usr/local/lib, or the other way around).
    • Try using the git version of gtkpod

    Also, if you don’t have an iTunesDB file but you have an iTunesCDB file, create a blank iTunesDB with touch iTunesDB.

  76. tech.geoff.me/ Says:

    Sir, you truly are a legend! Thank you :-)

  77. Will Heid Says:

    so far so good. although on my 1st gen touch the library rebuilding is taking an awful long time. I bow to your iphone skillz.

  78. Rainer Says:

    Re: “libgdk-pixbuf2″ and “libgdk-pixbuf-dev” libs for Karmic Koala

    They are included in libgtk2.0-dev and libgtk2.0

    I installed them (and the myriad of dependencies) and I don’t get the error message any more.

    Rainer

  79. Rainer Says:

    Has anybody experience with using amarok or rythmbox under karmic with an ipod touch? It is working with gtkpod, but I would like to have everything together (including sync) in one app.

    Rainer

  80. asavva Says:

    Hi marcan,

    Just to let you know I updated ifuse last night from your repository and the –uuid feature seems to be broken in that version.

    Looking through my /var/log/messages I can see these updates:
    This is the one that broke it:
    Nov 18 21:41:51 yum: Updated: ifuse-0.9.4-7.4.x86_64
    Previous versions:
    Nov 3 18:27:02 yum: Updated: ifuse-0.9.4-5.1.x86_64
    Nov 6 07:27:02 yum: Updated: ifuse-0.9.4-6.2.x86_64

    When I use the UUID flag I get:
    Invalid device UUID specified, length needs to be 40 characters

    Andrew

  81. woltrixx Says:

    When I connect my 3g ipod touch without jailbreak it doesn’t works, this is the log message i get:

    Nov 22 12:43:13 AspireOne kernel: fuse init (API version 7.12)
    Nov 22 12:44:24 AspireOne kernel: usb 1-3: new high speed USB device using ehci_hcd and address 4
    Nov 22 12:44:24 AspireOne kernel: usb 1-3: configuration #1 chosen from 3 choices
    Nov 22 12:44:24 AspireOne usbmuxd[3076]: [3] usbmuxd v1.0.0 starting up
    Nov 22 12:44:24 AspireOne usbmuxd[3078]: [4] Creating socket
    Nov 22 12:44:24 AspireOne usbmuxd[3078]: [3] Successfully dropped privileges to ‘usbmux’
    Nov 22 12:44:24 AspireOne usbmuxd[3078]: [4] Initializing USB
    Nov 22 12:44:24 AspireOne usbmuxd[3078]: [4] Found new device with v/p 05ac:1293 at 1-4
    Nov 22 12:44:24 AspireOne usbmuxd[3078]: [2] Could not open device 1-4: -3
    Nov 22 12:44:24 AspireOne usbmuxd[3078]: [4] 0 devices detected
    Nov 22 12:44:24 AspireOne usbmuxd[3078]: [3] Initialization complete
    Nov 22 12:44:24 AspireOne load-modules.sh: ‘usb:v05ACp1293d0001dc00dsc00dp00icFFiscFEip02′ is not a valid module or alias name
    Nov 22 12:44:24 AspireOne load-modules.sh: ‘usb:v05ACp1293d0001dc00dsc00dp00ic06isc01ip01′ is not a valid module or alias name
    Nov 22 12:44:24 AspireOne load-modules.sh: ‘usb:v05ACp1293d0001dc00dsc00dp00ic06isc01ip01′ is not a valid module or alias name

  82. mizar Says:

    Hi marcan, I have realized that I have an iPhone that has never been connected to iTune except for activation so I think it doen’t contains a valid music database. I would like to use linux only to interact with the iPhone so perharps I can help you to “try some cool new stuff”? Please let me know.

  83. Rainer Says:

    I am trying amarok 1.4.10 on Karmic, and it mounts the ipod touch as expected and shows all the music abnd I can play it. But when I disconnect it, it is trying to sync, and I get the following error:

    [mk_Dynamic] creating table structure
    [mk_Extras] re-building table structure
    [mk_Genius] re-building table structure
    [mk_Library] building table structure
    [mk_Library] compiling SQL statements
    **
    ERROR:itdb_itunesdb.c:5412:itdb_album_hash: code should not be reached
    X Error: BadWindow (invalid Window parameter) 3
    Major opcode: 7
    Minor opcode: 0
    Resource id: 0x400009e

    The amarok debug info is as below. I don’t know if it is an error in amarok or in your libraries.

    Cheers,

    Rainer

    ======== DEBUG INFORMATION =======
    Version: 1.4.10
    Engine: xine-engine
    Build date: Jun 11 2009
    CC version: 4.3.3
    KDElibs: 3.5.10
    Qt: 3.3.8b
    TagLib: 1.5.0
    CPU count: 2
    NDEBUG: true
    ==== file `which amarokapp` =======
    /usr/bin/amarokapp: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

    ==== (gdb) bt =====================
    [Thread debugging using libthread_db enabled]
    [New Thread 0xb4974b70 (LWP 27514)]
    [New Thread 0xb5176b70 (LWP 27357)]
    [New Thread 0xb5977b70 (LWP 27356)]
    [New Thread 0xb6345b70 (LWP 27355)]
    [New Thread 0xb6b46b70 (LWP 27354)]
    [New Thread 0xb74bab70 (LWP 27348)]
    0x00e82422 in __kernel_vsyscall ()
    #0 0x00e82422 in __kernel_vsyscall ()
    #1 0x00a94ba6 in poll () from /lib/tls/i686/cmov/libc.so.6
    #2 0x0373cd80 in ?? () from /usr/lib/libxcb.so.1
    #3 0x0373d2eb in ?? () from /usr/lib/libxcb.so.1
    #4 0x0373d687 in xcb_writev () from /usr/lib/libxcb.so.1
    #5 0x02d0b2e9 in _XSend () from /usr/lib/libX11.so.6
    #6 0x02d0b900 in _XEventsQueued () from /usr/lib/libX11.so.6
    #7 0x02cf4588 in XPending () from /usr/lib/libX11.so.6
    #8 0x0106673a in QEventLoop::processEvents(unsigned int) () from /usr/lib/libqt-mt.so.3
    #9 0x010d5424 in QEventLoop::processEvents(unsigned int, int) () from /usr/lib/libqt-mt.so.3
    #10 0x010bcb7e in QApplication::processEvents(int) () from /usr/lib/libqt-mt.so.3
    #11 0x010bcbb5 in QApplication::processEvents() () from /usr/lib/libqt-mt.so.3
    #12 0x033480e3 in IpodMediaDevice::writeITunesDB(bool) () from /usr/lib/kde3/libamarok_ipod-mediadevice.so
    #13 0x0334827f in IpodMediaDevice::closeDevice() () from /usr/lib/kde3/libamarok_ipod-mediadevice.so
    #14 0x0039601b in MediaDevice::disconnectDevice(bool) () from /usr/lib/libamarok.so.0
    #15 0x00396b06 in MediaBrowser::disconnectClicked() () from /usr/lib/libamarok.so.0
    #16 0x003a32a3 in MediaBrowser::qt_invoke(int, QUObject*) () from /usr/lib/libamarok.so.0
    #17 0x011212c1 in QObject::activate_signal(QConnectionList*, QUObject*) () from /usr/lib/libqt-mt.so.3
    #18 0×01123328 in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3
    #19 0x014877ac in QButton::clicked() () from /usr/lib/libqt-mt.so.3
    #20 0x011bc540 in QButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libqt-mt.so.3
    #21 0x03d31993 in KToolBarButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libkdeui.so.4
    #22 0x0115af41 in QWidget::event(QEvent*) () from /usr/lib/libqt-mt.so.3
    #23 0x03d7e8e1 in KToolBarButton::event(QEvent*) () from /usr/lib/libkdeui.so.4
    #24 0x010bc4b7 in QApplication::internalNotify(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
    #25 0x010bd5d5 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
    #26 0x0083e3cc in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdecore.so.4
    #27 0x0105662e in QApplication::sendSpontaneousEvent(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
    #28 0×01053399 in QETWidget::translateMouseEvent(_XEvent const*) () from /usr/lib/libqt-mt.so.3
    #29 0×01052197 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libqt-mt.so.3
    #30 0x010667a4 in QEventLoop::processEvents(unsigned int) () from /usr/lib/libqt-mt.so.3
    #31 0x010d54b0 in QEventLoop::enterLoop() () from /usr/lib/libqt-mt.so.3
    #32 0x010d5356 in QEventLoop::exec() () from /usr/lib/libqt-mt.so.3
    #33 0x010bcb0f in QApplication::exec() () from /usr/lib/libqt-mt.so.3
    #34 0x0804bf03 in ?? ()
    #35 0x009ecb56 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
    #36 0x0804b4b1 in ?? ()
    #0 0x00e82422 in __kernel_vsyscall ()
    No symbol table info available.
    #1 0x00a94ba6 in poll () from /lib/tls/i686/cmov/libc.so.6
    No symbol table info available.
    #2 0x0373cd80 in ?? () from /usr/lib/libxcb.so.1
    No symbol table info available.
    #3 0x0373d2eb in ?? () from /usr/lib/libxcb.so.1
    No symbol table info available.
    #4 0x0373d687 in xcb_writev () from /usr/lib/libxcb.so.1
    No symbol table info available.
    #5 0x02d0b2e9 in _XSend () from /usr/lib/libX11.so.6
    No symbol table info available.
    #6 0x02d0b900 in _XEventsQueued () from /usr/lib/libX11.so.6
    No symbol table info available.
    #7 0x02cf4588 in XPending () from /usr/lib/libX11.so.6
    No symbol table info available.
    #8 0x0106673a in QEventLoop::processEvents(unsigned int) () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #9 0x010d5424 in QEventLoop::processEvents(unsigned int, int) () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #10 0x010bcb7e in QApplication::processEvents(int) () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #11 0x010bcbb5 in QApplication::processEvents() () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #12 0x033480e3 in IpodMediaDevice::writeITunesDB(bool) () from /usr/lib/kde3/libamarok_ipod-mediadevice.so
    No symbol table info available.
    #13 0x0334827f in IpodMediaDevice::closeDevice() () from /usr/lib/kde3/libamarok_ipod-mediadevice.so
    No symbol table info available.
    #14 0x0039601b in MediaDevice::disconnectDevice(bool) () from /usr/lib/libamarok.so.0
    No symbol table info available.
    #15 0x00396b06 in MediaBrowser::disconnectClicked() () from /usr/lib/libamarok.so.0
    No symbol table info available.
    #16 0x003a32a3 in MediaBrowser::qt_invoke(int, QUObject*) () from /usr/lib/libamarok.so.0
    No symbol table info available.
    #17 0x011212c1 in QObject::activate_signal(QConnectionList*, QUObject*) () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #18 0×01123328 in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #19 0x014877ac in QButton::clicked() () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #20 0x011bc540 in QButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #21 0x03d31993 in KToolBarButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libkdeui.so.4
    No symbol table info available.
    #22 0x0115af41 in QWidget::event(QEvent*) () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #23 0x03d7e8e1 in KToolBarButton::event(QEvent*) () from /usr/lib/libkdeui.so.4
    No symbol table info available.
    #24 0x010bc4b7 in QApplication::internalNotify(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #25 0x010bd5d5 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #26 0x0083e3cc in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdecore.so.4
    No symbol table info available.
    #27 0x0105662e in QApplication::sendSpontaneousEvent(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #28 0×01053399 in QETWidget::translateMouseEvent(_XEvent const*) () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #29 0×01052197 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #30 0x010667a4 in QEventLoop::processEvents(unsigned int) () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #31 0x010d54b0 in QEventLoop::enterLoop() () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #32 0x010d5356 in QEventLoop::exec() () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #33 0x010bcb0f in QApplication::exec() () from /usr/lib/libqt-mt.so.3
    No symbol table info available.
    #34 0x0804bf03 in ?? ()
    No symbol table info available.
    #35 0x009ecb56 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
    No symbol table info available.
    #36 0x0804b4b1 in ?? ()
    No symbol table info available.
    ==== (gdb) thread apply all bt ====
    Thread 7 (Thread 0xb74bab70 (LWP 27348)):
    #0 0x00e82422 in __kernel_vsyscall ()
    #1 0x00b24142 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
    #2 0x00aaf7e4 in pthread_cond_timedwait () from /lib/tls/i686/cmov/libc.so.6
    #3 0x01c669ff in ?? () from /usr/lib/libxine.so.1
    #4 0x00b1f80e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
    #5 0x00aa27ee in clone () from /lib/tls/i686/cmov/libc.so.6
    Thread 6 (Thread 0xb6b46b70 (LWP 27354)):
    #0 0x00e82422 in __kernel_vsyscall ()
    #1 0x00a94ba6 in poll () from /lib/tls/i686/cmov/libc.so.6
    #2 0x01d66c3b in ?? () from /usr/lib/xine/plugins/1.26/xineplug_ao_out_alsa.so
    #3 0x00b1f80e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
    #4 0x00aa27ee in clone () from /lib/tls/i686/cmov/libc.so.6
    Thread 5 (Thread 0xb6345b70 (LWP 27355)):
    #0 0x00e82422 in __kernel_vsyscall ()
    #1 0x00b23e15 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
    #2 0x00aaf78d in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
    #3 0x01c775ee in ?? () from /usr/lib/libxine.so.1
    #4 0x00b1f80e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
    #5 0x00aa27ee in clone () from /lib/tls/i686/cmov/libc.so.6
    Thread 4 (Thread 0xb5977b70 (LWP 27356)):
    #0 0x00e82422 in __kernel_vsyscall ()
    #1 0x00b23e15 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
    #2 0x00aaf78d in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
    #3 0x01c69fc2 in ?? () from /usr/lib/libxine.so.1
    #4 0x01c70d46 in ?? () from /usr/lib/libxine.so.1
    #5 0x00b1f80e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
    #6 0x00aa27ee in clone () from /lib/tls/i686/cmov/libc.so.6
    Thread 3 (Thread 0xb5176b70 (LWP 27357)):
    #0 0x00e82422 in __kernel_vsyscall ()
    #1 0x00b23e15 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
    #2 0x00aaf78d in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
    #3 0x01c7a51a in xine_event_wait () from /usr/lib/libxine.so.1
    #4 0x01c7a5a2 in ?? () from /usr/lib/libxine.so.1
    #5 0x00b1f80e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
    #6 0x00aa27ee in clone () from /lib/tls/i686/cmov/libc.so.6
    Thread 2 (Thread 0xb4974b70 (LWP 27514)):
    #0 0x00e82422 in __kernel_vsyscall ()
    #1 0x00a6c53b in waitpid () from /lib/tls/i686/cmov/libc.so.6
    #2 0x0804d6fa in Amarok::Crash::crashHandler(int) ()
    #3
    #4 0x00e82422 in __kernel_vsyscall ()
    #5 0x00a004d1 in raise () from /lib/tls/i686/cmov/libc.so.6
    #6 0x00a03932 in abort () from /lib/tls/i686/cmov/libc.so.6
    #7 0x01b49ddc in g_assertion_message () from /lib/libglib-2.0.so.0
    #8 0x01a9a6b3 in ?? () from /usr/lib/libgpod.so.4
    #9 0x01b13b68 in g_hash_table_lookup () from /lib/libglib-2.0.so.0
    #10 0x01aa5721 in ?? () from /usr/lib/libgpod.so.4
    #11 0x01aa74df in ?? () from /usr/lib/libgpod.so.4
    #12 0x01aa7a03 in ?? () from /usr/lib/libgpod.so.4
    #13 0x01a9b20b in ?? () from /usr/lib/libgpod.so.4
    #14 0x01a9b49c in itdb_write () from /usr/lib/libgpod.so.4
    #15 0x0334ec57 in IpodWriteDBJob::doJob() () from /usr/lib/kde3/libamarok_ipod-mediadevice.so
    #16 0x0051e48e in ThreadManager::Thread::run() () from /usr/lib/libamarok.so.0
    #17 0x010b659f in QThreadInstance::start(void*) () from /usr/lib/libqt-mt.so.3
    #18 0x00b1f80e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
    #19 0x00aa27ee in clone () from /lib/tls/i686/cmov/libc.so.6
    Thread 1 (Thread 0xb7794b30 (LWP 27330)):
    #0 0x00e82422 in __kernel_vsyscall ()
    #1 0x00a94ba6 in poll () from /lib/tls/i686/cmov/libc.so.6
    #2 0x0373cd80 in ?? () from /usr/lib/libxcb.so.1
    #3 0x0373d2eb in ?? () from /usr/lib/libxcb.so.1
    #4 0x0373d687 in xcb_writev () from /usr/lib/libxcb.so.1
    #5 0x02d0b2e9 in _XSend () from /usr/lib/libX11.so.6
    #6 0x02d0b900 in _XEventsQueued () from /usr/lib/libX11.so.6
    #7 0x02cf4588 in XPending () from /usr/lib/libX11.so.6
    #8 0x0106673a in QEventLoop::processEvents(unsigned int) () from /usr/lib/libqt-mt.so.3
    #9 0x010d5424 in QEventLoop::processEvents(unsigned int, int) () from /usr/lib/libqt-mt.so.3
    #10 0x010bcb7e in QApplication::processEvents(int) () from /usr/lib/libqt-mt.so.3
    #11 0x010bcbb5 in QApplication::processEvents() () from /usr/lib/libqt-mt.so.3
    #12 0x033480e3 in IpodMediaDevice::writeITunesDB(bool) () from /usr/lib/kde3/libamarok_ipod-mediadevice.so
    #13 0x0334827f in IpodMediaDevice::closeDevice() () from /usr/lib/kde3/libamarok_ipod-mediadevice.so
    #14 0x0039601b in MediaDevice::disconnectDevice(bool) () from /usr/lib/libamarok.so.0
    #15 0x00396b06 in MediaBrowser::disconnectClicked() () from /usr/lib/libamarok.so.0
    #16 0x003a32a3 in MediaBrowser::qt_invoke(int, QUObject*) () from /usr/lib/libamarok.so.0
    #17 0x011212c1 in QObject::activate_signal(QConnectionList*, QUObject*) () from /usr/lib/libqt-mt.so.3
    #18 0×01123328 in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3
    #19 0x014877ac in QButton::clicked() () from /usr/lib/libqt-mt.so.3
    #20 0x011bc540 in QButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libqt-mt.so.3
    #21 0x03d31993 in KToolBarButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libkdeui.so.4
    #22 0x0115af41 in QWidget::event(QEvent*) () from /usr/lib/libqt-mt.so.3
    #23 0x03d7e8e1 in KToolBarButton::event(QEvent*) () from /usr/lib/libkdeui.so.4
    #24 0x010bc4b7 in QApplication::internalNotify(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
    #25 0x010bd5d5 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
    #26 0x0083e3cc in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdecore.so.4
    #27 0x0105662e in QApplication::sendSpontaneousEvent(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
    #28 0×01053399 in QETWidget::translateMouseEvent(_XEvent const*) () from /usr/lib/libqt-mt.so.3
    #29 0×01052197 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libqt-mt.so.3
    #30 0x010667a4 in QEventLoop::processEvents(unsigned int) () from /usr/lib/libqt-mt.so.3
    #31 0x010d54b0 in QEventLoop::enterLoop() () from /usr/lib/libqt-mt.so.3
    #32 0x010d5356 in QEventLoop::exec() () from /usr/lib/libqt-mt.so.3
    #33 0x010bcb0f in QApplication::exec() () from /usr/lib/libqt-mt.so.3
    #34 0x0804bf03 in ?? ()
    #35 0x009ecb56 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
    #36 0x0804b4b1 in ?? ()

    ==== kdBacktrace() ================

  84. Phil Says:

    Hi
    Great work, and now I’ve got my iphone 3gs syncing without using itunes – hooray.
    A couple of things to note:
    1) Transfer seems quite slow – takes over 10 hours to sync my 16Gb music library
    2) Every time I run gtkpod it warns:
    Hashed file is 0 bytes long
    Could not create hash value from itunesdb
    Extended info will not be used

    Is this simply a consequence of itunesdb being 0 length now that itunescdb is used or am I doing something wrong?

    Great work, and thanks.
    Phil

  85. Rainer Says:

    Is there a gtkpod alternative which works at the moment? I don’t get the logic of gtkpod, but I really would love to sync my music from Linux.

    Any ideas or suggestion?

    Rainer

  86. coder543.myopenid.com/ Says:

    Thank you sooo much. This is amazing. I hope development on this continues steadily and more user friendly packages are made available. I was technical enough to get this to work, but a small percent of people are able to do so. The one issue i’ve had so far is that trying to copy my library to my music folder from gtkpod crashes gtkpod, sometimes segfault, usually a ‘lost connection to the x server.’

    Ubuntu 9.10

  87. coder543.myopenid.com/ Says:

    Ok, correction. It did sync, and it worked nicely with playlists. But something must have hashed wrong. I would select a song and it would play 4 seconds of that one, then play 4 seconds of the next one, then 4 seconds of the next one, etc. All while claiming to be song number one. When it ran out of songs it would play silence. lol, so, yeah. I’ll have to test that again later i guess.

  88. aronparsons Says:

    First off, thanks for putting the work into this. I’ve been tracking the libgpod git repo for a while waiting for all of the pieces to come together.

    I’m using an iPhone 3G running 3.1.2 which is jailbroken. I’m using Rhythmbox 0.12.5 as the frontend on Fedora 12 x86_64. All of the package versions are the ones listed in this post; they’ve been rebuilt from the rawhide SRPMs. Syncing seems to work fine. The music and artwork make it to the device just fine.

    Major Issues:
    ‘usbmuxd’ dying after one use. I poked around the docs in the usbmuxd repo, but didn’t see the workaround you mentioned. ‘pkill’ing it works, but … Do we know what the ‘udev’ issue is and is there any progress towards fixing it?

    Minor Issues:
    - Rhythmbox increments the number of devices shown each time I re-plug the device (e.g., multiple instances of the device show up in the tree on the left pane). The topmost device in the list is the only one shown with a database, all the others show empty databases. This doesn’t seem to affect the functionality, but obviously it’s an issue.

    - The ‘Sync in Progress’ screen isn’t consistent. It pops up about halfway through syncing a song, then goes away 1-2 songs later. Then it comes back again. I assume the intention is for it to retain the ‘Sync in Progress’ screen throughout the whole process, but it does not. Is this a Rhythmbox issue or a libgpod issue?

    - Syncing is slow. It’s not unbearable, but it’s slower than iTunes running in VirtualBox or syncing via Rhythmbox to an iPod 5G. Others mentioned this, but I thought I’d throw it in again.

    Please let me know which logs and files you need to help troubleshoot these issues. I didn’t include any here because I don’t want to provide irrelevant debug info.

  89. marcan Says:

    If udev dies after one use (after inserting and removing one device), then your udev is buggy. The issue has been fixed in udev some time ago, so it’s just waiting to be pulled by the distros. Alternatively, there’s a workaround for the bug in the usbmuxd git repo, which will be in the 1.0.0 release. By that I mean that the workaround is part of the usbmuxd code, so you just need to upgrade to usbmuxd-git instead of 1.0.0-rc2.

    The “Sync in progress” screen currently wraps database writes, which means you won’t see it while songs are copied, only when the database is updated to match. A new API will be added to trigger it during song writes, but applications need to start using it.

    I know nothing about hotplugging/gvfs issues with Rhythmbox, so I suggest you bring that up on the iphone-linux-dev mailing list.

    As for syncing speed, speeding it up is on the TODO list. Do keep in mind that it will always be slower than syncing to real USB Mass Storage iPods, since there is a lot more overhead. You’re right that it should be faster, though.

  90. aronparsons Says:

    Thanks for the info, marcan. I switched to the git version of usbmuxd and that solved both the GVFS issue and the udev issue (I assume the GVFS issue was coming from usbmuxd not exiting cleanly).

  91. nevertell Says:

    I got the iphone to mount, although I didn’t get any feedback from usbmuxd when using tail -f. But, gtkpod doesn’t really sync anything. I have made the hash, I have compiled the libgpod successfully, and all it does is copy some files in the F** folders, but then they are awkwardly named, something with libgpod****.mp3. And, after I tried to sync my 8gb 3g, I got a full disk of seemingly unreadable music- it was readable from the disc, but even after the “Updating library” screen, there are no songs I tried to sync. I can delete the songs. At first. GTKpod deletes the files but doesn’t delete the database entries, you can find them on the “ipod” list, but they aren’t playable.

    Another strange thing is bothering me, when I try to sync it from XP through virtual box, with all the usb options enabled, it sort of looses connection somewhere between 50-100 songs synced. And then it hangs for about 5 minutes and then lets me dissconnect the iphone and start all over again. If I disconnect the iPhone during those 5 minutes, the new songs will not show up. If I wait though, they will have successfully synced. This sucks if you have around 800 songs :D

  92. matthias Says:

    I was able to install all the stuff, but I had to remove the -Werror option from the teuf-sandbox/tools/makefile because it kept failing because of “Warnings being treated as errors.”

    Now that I have everything installed, I have a 32gb 1st gen itouch with v3 software. Which model should I use in gtkpod since it doesn’t have that option? I think back when I used v1 software and was syncing with linux I used the 16gb touch model, but things probably changed since then.

  93. claimid.com/jebr0wn Says:

    This is exactly what I need, in a house with only Linux computers and two iPhones sync without iTunes is a must for my sanity.
    I am halfway through the process and taking extensive notes. I plan to make an install script to share for Ubuntu 9.10 if I can get everything working.

  94. George Carter Says:

    Beautiful, now for automount :D

  95. peter Says:

    Hi,

    Firstly, thanks for the efforts to everybody involved in getting iPhone/Touch syncing working with FW3.0.

    I was able to successfully compile libgopd4 and get syncing set up with my iPhone 3G. I had the missing libraries for album art and have tried to re-compile, but I am getting the error message below. I cannot work this out as I believe I have everyhting working correctly. I have put the error message after i try to make below.

    make all-recursive
    make[1]: Entering directory `/home/peter/marcan-sandbox’
    Making all in src
    make[2]: Entering directory `/home/peter/marcan-sandbox/src’
    make[2]: Nothing to be done for `all’.
    make[2]: Leaving directory `/home/peter/marcan-sandbox/src’
    Making all in tools
    make[2]: Entering directory `/home/peter/marcan-sandbox/tools’
    CC ipod_read_sysinfo_extended-ipod-lockdown.o
    cc1: warnings being treated as errors
    ipod-lockdown.c: In function ‘read_sysinfo_extended_by_uuid’:
    ipod-lockdown.c:70: error: implicit declaration of function ‘plist_get_dict_el_from_key’
    ipod-lockdown.c:70: error: nested extern declaration of ‘plist_get_dict_el_from_key’
    ipod-lockdown.c:70: error: assignment makes pointer from integer without a cast
    ipod-lockdown.c:73: error: implicit declaration of function ‘plist_add_sub_key_el’
    ipod-lockdown.c:73: error: nested extern declaration of ‘plist_add_sub_key_el’
    ipod-lockdown.c:74: error: implicit declaration of function ‘plist_add_sub_string_el’
    ipod-lockdown.c:74: error: nested extern declaration of ‘plist_add_sub_string_el’
    ipod-lockdown.c:78: error: assignment makes pointer from integer without a cast
    make[2]: *** [ipod_read_sysinfo_extended-ipod-lockdown.o] Error 1
    make[2]: Leaving directory `/home/peter/marcan-sandbox/tools’
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/peter/marcan-sandbox’
    make: *** [all] Error 2

    Any help would be much appreciated.

    Peter

  96. peter Says:

    To add, I am running Linux Mint 8.

  97. fox D loulou Says:

    Hi
    I’d like to specify that I’m french, so be comprehensive if my english isn’t very right.
    I’m here to tell you that I’ve exactly the same problem as Peter when I try to re-compile libgpod4 adding libgdk-pixbuf2 and libgdk-pixbuf-dev .

    I haven’t still read everything on this blog, but I’d like to know also if it is , or will be , possible to transfer videos on iphone

    iphone 3GS OS 3.1.2 / ubuntu 9.04

  98. ciekawy Says:

    I am trying to run all of this glorious piece of code ;) I have compiled most of the code including amarok 1.4.10 and while trying to synchronize amarock crashes with:

    SHA1: 306fd2ae0ad8ad4d9f3b7a1dae417642684db055
    IV: 7c49d6ca9362d01d4a439354790adedc
    RND: 1c9c0596eac86baa93b6c4d7
    Signature: 01001c9c0596eac86baa93b6c4d79f8bac3e45da990c5fd286d9f27b007ef46e18582f67c1bf61e0056e288ea763
    libitdbprep: itdb_sqlite_generate_itdbs called with file /home/szymon/iphone-ircia/iPod_Control/iTunes/iTunesCDB and uuid ee5c28be38390e96ee8e32c0d8d572e167a392f5
    itlp directory=’/home/szymon/iphone-ircia/iPod_Control/iTunes/iTunes Library.itlp’
    *.itdb files will be stored in ‘/home/szymon/iphone-ircia/iPod_Control/iTunes/iTunes Library.itlp’
    [mk_Dynamic] Processing ‘/tmp/filecD26PZ/Dynamic.itdb’
    [mk_Dynamic] creating table structure
    [mk_Dynamic] – processing 47 tracks
    [mk_Dynamic] done.
    [mk_Extras] Processing ‘/tmp/filecD26PZ/Extras.itdb’
    [mk_Extras] re-building table structure
    [mk_Extras] done.
    [mk_Genius] Processing ‘/tmp/filecD26PZ/Genius.itdb’
    [mk_Genius] re-building table structure
    [mk_Genius] done.
    library_persistent_id = 0x80ed1bbc248ee559
    [mk_Library] Processing ‘/tmp/filecD26PZ/Library.itdb’
    [mk_Library] building table structure
    [mk_Library] compiling SQL statements
    [mk_Library] – inserting into “version_info”
    [mk_Library] – inserting into “genre_map”
    [mk_Library] – inserting songs into “item_to_container”
    [mk_Library] – inserting playlist ‘iPhone irene’ into “container”
    library_persistent_id = 0x80ed1bbc248ee559
    device name = iPhone irene
    [mk_Library] – inserting into “db_info”
    [mk_Library] – processing 47 tracks
    **
    ERROR:itdb_itunesdb.c:5451:itdb_artist_hash: code should not be reached
    Amarok is crashing…
    Running: gdb –nw -n –batch -x /tmp/kde-szymon/amarok7cPbva.tmp amarokapp 15241
    Cannot access memory at address 0xb00
    /home/szymon/15241: No such file or directory.
    No stack.
    No stack.
    Running: file `which amarokapp`
    1.4.10 [___stripped][frames: 0][xine]
    Could not find ‘kmail’ executable.
    amarokapp: Fatal IO error: client killed
    X Error: BadWindow (invalid Window parameter) 3
    Major opcode: 7
    Minor opcode: 0
    Resource id: 0×5600053

  99. pyrho.blogspot.com/ Says:

    @peter:
    I believe marcan’s git repo is a bit outdated (last commit about a month ago).
    I don’t get the errors you have but after looking a bit a the version I have of libplist and the lastest one. It seems that the ‘plist_get_dict_el_from_key’ function is deprecated and therefore is not included in the latest versions of libplist.

    Even though I don’t have your error when compiling marcan’s repo, I do have other ones (iphone_get_device_by_uuid).

    To solve this problem I’ve use the git version of libgpod (instead of marcan or teuf’s one which both don’t work). You can clone it from here: git://gtkpod.git.sourceforge.net/gitroot/gtkpod/libgpod .

    Using this, I am proud to annonce that I’ve managed to add a song to my iphone via GtkPod ! :D
    Although it was a bit slow and that gtkPod crashed after syncing.

    A big thanks to everyone involved in this project ! :)

  100. ericsp Says:

    Get stuck at step 4 with the git thingy. Using ubuntu 9.10. Anyone here to help me out? The itouch is mounted and I can read all dirs.

  101. cbbrowne Says:

    I’m getting stuck at step #2.

    Background info
    - Running Debian/Testing, which has pretty recent packages for all this stuff

    t43:/usr/share/doc/ifuse# dpkg -l | egrep ‘(ifuse|usbmux|iphone)’ | cut -b 1-55
    ii ifuse 0.9.1-2
    ii ifuse-dbg 0.9.1-2
    ii libiphone-dev 0.9.1-4
    ii libiphone0 0.9.1-4
    ii libiphone0-dbg 0.9.1-4
    ii libusbmuxd-dev 1.0.0-1
    ii libusbmuxd1 1.0.0-1
    ii libusbmuxd1-dbg 1.0.0-1
    ii python-libiphone 0.9.1-4
    ii usbmuxd 1.0.0-1

    - iTouch 2G running OS 3.0, not jailbroken

    When I plug in my iTouch, I get the following in my logs:

    Dec 16 22:33:23 t43 kernel: [4318724.936027] usb 5-4: new high speed USB device using ehci_hcd and address 15
    Dec 16 22:33:23 t43 kernel: [4318725.071907] usb 5-4: configuration #1 chosen from 3 choices
    Dec 16 22:33:23 t43 kernel: [4318725.075701] usb 5-4: New USB device found, idVendor=05ac, idProduct=1293
    Dec 16 22:33:23 t43 kernel: [4318725.075707] usb 5-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    Dec 16 22:33:23 t43 kernel: [4318725.075710] usb 5-4: Product: iPod
    Dec 16 22:33:23 t43 kernel: [4318725.075712] usb 5-4: Manufacturer: Apple Inc.
    Dec 16 22:33:23 t43 kernel: [4318725.075714] usb 5-4: SerialNumber: 219eac53c07069a199a10797f5f3148de784b6ee
    Dec 16 22:33:23 t43 usbmuxd[14555]: [3] usbmuxd v1.0.0 starting up
    Dec 16 22:33:23 t43 usbmuxd[14557]: [4] Creating socket
    Dec 16 22:33:23 t43 usbmuxd[14557]: [3] Successfully dropped privileges to ‘usbmux’
    Dec 16 22:33:23 t43 usbmuxd[14557]: [4] Initializing USB
    Dec 16 22:33:23 t43 usbmuxd[14557]: [4] Found new device with v/p 05ac:1293 at 5-15

    That looks nicely like it’s all working up to mid-step #2.

    But step #2 indicates that usbmuxd should be reporting more after that “Found new device” line, such as…

    usbmuxd[12707]: [4] Using wMaxPacketSize=512 for device 3-68
    usbmuxd[12707]: [3] Connecting to new device on location 0×30044 as ID 1
    usbmuxd[12707]: [4] 1 device detected
    usbmuxd[12707]: [3] Initialization complete
    usbmuxd[12707]: [3] Connected to v1.0 device 1 on location 0×30044 with serial number [elided...]

    I’m not getting that.

    Building usbmuxd from source, what I’m finding is that it’s blocking on the call to libusb_get_string_descriptor_ascii() at about line 300 of daemon/usb-linux.c.

    It’s blocking seemingly indefinitely, and I don’t see any particular reason to expect it to do so.

  102. simon.huet Says:

    Hello,

    thanks for your work.

    I compiled all the softwares under Ubuntu Karmic without too much problem (some ldconfig stuff, pkgconfig hell but not something that could not be fixed). Everything worked as advertised with GTKPod and my iPhone 3GS so thank you.

    Some minor glitch like artist appearing in the order of I upload them and not in alphabetic order in the cover flow view and the “rebuilding library screen” because the database schema are not up to date if I understand correctly this issue.

    The process of uploading is still sooo slow, I tried to look around to see if I could speed up the process and so I revert using the ppa packages (which have been mentioned here somewhere) too try the GVFS AFC module (was not able to compile it).

    Rhythmbox works great, find online covers for the tracks I have which does not have any and keeps my cover flow view ordered. The only issue is that while I transfer music files to my iPhone keeps on syncing (the happy sync screen) which slows down terribly this already slow process.

    As this is not a problem when using GTKPod I assume this is a problem from Rhythmbox but could you add some piece of code to check if some transfer is still going on to prevent from syncing while transferring file? Or maybe it is a libgpod issue?

    Thanks again!!!

  103. espspinix Says:

    Hello

    I have a similar problem like cbbrowne.

    When i start usbmuxd i get:

    [08:25:35.700][3] usbmuxd v1.0.0 starting up
    [08:25:35.701][4] Creating socket
    [08:25:35.702][3] Successfully dropped privileges to ‘usbmux’
    [08:25:35.702][5] client_init
    [08:25:35.702][5] device_init
    [08:25:35.702][4] Initializing USB
    [08:25:35.703][5] usb_init for linux / libusb 1.0
    [08:25:35.705][6] usb_discover: scanning 8 devices
    [08:25:35.705][4] Found new device with v/p 05ac:1293 at 1-7

    and nothing more…
    when i press CTRL+C i also get the following:

    ^C[08:25:36.455][3] Caught signal 2, exiting
    [08:25:36.455][2] Could not get serial number for device 1-7: -99
    [08:25:36.455][4] 0 devices detected
    [08:25:36.455][3] Initialization complete
    [08:25:36.455][5] usb polling enable: 0
    [08:25:36.455][3] usbmuxd shutting down
    [08:25:36.455][5] device_kill_connections
    [08:25:36.556][5] usb_shutdown
    [08:25:36.556][5] device_shutdown
    [08:25:36.556][5] client_shutdown
    [08:25:36.556][3] Shutdown complete

    so after shutting the daemon down i get the message that it could not get the serial of my device
    (it does not matter whether i start the daemon as root or usbmux user)

    iphoneinfo says the following:

    # iphoneinfo
    recv: Success
    usbmuxd_get_device_list: Did not get response to scan request (with result=0)…
    No device found, is it plugged in?

    maybe it helps, my ipod touch is brandnew and was never plugged into a “real” itunes before and therefore cannot start up fully (there is this image telling me to sync the pod with itunes)

  104. ibeapirate Says:

    i’m getting precisely the same problems as coder543 did, it would sync properly, but each song would play the first ~6 seconds, then skip to the next in the playlist/artist list/album/whatever.
    Just wondering, coder543, did you fix this, and if so, can you remember how?
    Also, in gtkpod switching from the “Podcast” playlist to the root folder freezes it.

  105. luis Says:

    Using Ubuntu Karmic Koala, compiled everything from the git repositories or the tarballs where appropriate, put them in /usr/local. And everything works using gtkpod. My daughter would have killed me if her Xmas present didn’t work or something got messed up, so big thanks! I guess there is still a chance of me getting killed, but so far so good.

  106. kasulstyls Says:

    Hi,

    I am at this step for Karmic. ” Then, get your UUID:
    $ lsusb -v | grep -i iSerial

    It’s the first number and should be 40 characters long. Then, run:
    $ ipod-read-sysinfo-extended
    (mountpoint here is /mnt/ipod/)

    This should generate a file named iTunes_Control/Device/SysInfoExtended.”

    my error returns this in the terminal ” Couldn’t read xml sysinfo from uuid.

    any ideas what i might be missing or doing wrong? phone is mounted and i can traverse in the /mnt/ipod/ directories.

  107. fox D loulou Says:

    kasulstyls

    I had the same error before installing the libiphone-dev package.
    It should have been installed before libgpod4 creation, so you’ll have to delete libgpod 4 and compile it again

  108. kasulstyls Says:

    thanks for pointing that out Fox D loulou If i would have paid more attention to previous posts :) Thanks marcan for making this a project and all who contributed on the tid bits. I am now able to sync music to my Iphone with out windows. What an awsome day.

  109. danitxu Says:

    First of all, thanks a lot for this good hacking & sharing the knowledge.

    I’m able to ssh and to access to the mounted ipod directory perfectly. Regarding to your instructions, I’m in step 5 and don’t see any SysInfoExtended file written in the indicated folder. If I do strace -o /tmp/xx test ipod-read-sysinfo-extended /mnt/ipod I see it’s writing not in iTunes_Control/Device/SysInfoExtended but in iPod_Control/Device/SysInfoExtended
    May it be a problem for the rest of steps?
    git describe –always gives dc09d01

    Thanks in advance

  110. izamah.blogspot.com/ Says:

    Hey, great work there, big thanks all the developers! It works fabulous for me. I had the same problem as the previous commenter (I installed all the stuff using the Ubuntu Karmic repositories). But I managed to write the SysInfoExtended file by mounting my JB iphone 3G 3.0 through ssh (sshfs -o uid=1000,gid=1000,allow_other root@iphone:/private/var/mobile/Media /media/iphone2) and then running the ipod-read-sysinfo-extended on that mountpoint.

    Btw, I also installed this stuff to be able to compile libgpod using the instructions above:

    apt-get install gtkpod libiphone-dev libxml2-dev libxml2 sqlite3 libsqlite3-dev gtk-doc-tools intltool libglib2.0-dev autoconf git-core

    Thanks again!

  111. ingvar Says:

    Got this to work nicely with my iPhone 2G and gtkpod on my fedora 12 system. Had to add the output of the following commands to CFLAGS to get libgpod compile.

    pkg-config –cflags glib-2.0
    pkg-config –cflags libxml-2.0

    As my iPhone had not yet been synced with iTunes (and probably never will), I got a HashInfo file from ihash.marcansoft.com. Then I cleared out the content of the database (removed Music/*, iTunesCDB, iTunesDB, all .ext files and the .itlp directory). Finally let gtkpod reinit the database, and hey presto, syncs like a dream. The usbmuxd sync is also a lot faster than the sshfs method.

    As expected, amarok-1.4 is still broken, and can’t use the changed libgpod, and since it has no upstream support, this will probably never be fixed. I’ll miss amarok-1.4, but I can live with gtkpod. Perhaps some day even amarok2 will become usable.

    Great thanks to marcan and the rest of the team for the job, and for excellent help on irc.

  112. Thrystan Says:

    cbbrowne,
    Erik Winkels,
    and others…

    Can you post how you did to make it works on Debian ?
    I’m using Debian testing (squeeze) and packages are too old. Can I use Ubuntu packages ? which ones ? or better to compile ?

    Thanks,
    Thrystan.

  113. superevilspacemonkey Says:

    Hi,
    First things first:
    Wow! Great job guys! Impressive stuff!
    I managed to get my iPhone 3GS mounted on my opensuse 11.2 (KDE) today. I will probably try the music syncing thingy next weekend..

    A few things i noticed (that might be specific to my distro):
    1) in order to install libiphone a symlink needs to be created in /usr/include so that the file /usr/local/include/plist/swig/plist.i could be found…
    2) in a few of the packages the instructions say that the command “./autogen.sh” needs to be run before “./configure” i couldn’t get it working, so i skipped the “./autogen.sh” step…
    3) I could not yet identify the group under which i need to create usbmux so that it has the necessary privileges, so currently usbmux is a member of “root”… please point me in the right direction..
    4) I had to disable the passcode lock to be able to connect…

    Thanks for this!

  114. wboe Says:

    Hello,

    I don’t know if anybody tried to connect a 32G iPod using gtkpod, but I had no luck with that. I used the newest versions of libgpod and gtkpod, compiled from source code, under Ubuntu 9.10. I followed marcan’s instructions, and could inspect the files inside the iPod. The database and other files have been created by gtkpod as expected. The database could be populated with files by iTunes on a Windows machine without problems. However, when I load the iPod in gtkpod, I get the following warnings:

    Hashed file is 0 bytes long
    Could not create hash value from itunesdb
    Extended info will not be used
    iPod database import failed

    I inserted some printf statements in the gtkpod code in order to find out which files the program looked for, they were ~/.gtkpod/local_0.itdb and iPod_Control/iTunes/iTunesDB.

    These files indeed were 0 bytes. However, looking in the gtkpod code, the program expects to find words like “id” and “version” there.

    Another issue is that gtkpod searches for a file iTunes/iTunesDB.ext, where libgpod creates a file Device/SysInfoExtended. Or am I mixing things up?

    Anyhow, it seems that libgpod and gtkpod behave like they are incompatible. Any help will be highly appreciated!

  115. marcan Says:

    You’re mixing things up. “Hashed file is 0 bytes long” means you’re using the wrong libgpod. Make sure it’s the latest version from Git and you are installing it to the correct place (e.g. /usr/lib instead of /usr/local/lib). Run ldd `which gtkpod` and check that the libgpod library is the one you just installed.

    iTunesDB.ext and SysInfoExtended have nothing to do with each other. iTunesDB.ext is related to “Extended info will not be used” and that message is harmless. SysInfoExtended is required for iPhone/iTouch/Nano5g support and should always be there when you’re using libgpod.

    You can delete /.gtkpod/*.itdb to make sure your local library is recreated properly. iTunesDB on the iPhone should be 0 bytes, but there should be an iTuneCDB with the (compressed) data.

  116. wboe Says:

    Hi marcan, thanks for your fast response.

    Firstly: I use the latest gtkpod from Git, freshly compiled and installed. The program itself is run as ./gtkpod from the gtkpod/src directory, in order to see the output from my printf statements.

    The file SysInfoExtended is present, be it in directory iPod_Control/Device and not in iTunes_Control/Device, but danitxu posed a question about this already and maybe it’s harmless.

    The file HashInfo was not created by gtkpod, so ‘I had a problem’ (quoting you). I followed ingvars solution and got a HashInfo from ihash.marcansoft.com.

    Investigating somebody else’s code is not easy, but finally I found the flaw, which is very simple: libgpod is writing iTunesCDB to iTunes_Control/iTunes, and gtkpod expects it in iPod_Ctrl/iTunes. I manually copied it to that place and bingo! the iPod works!

    Thanks for your support and for your programs!

  117. wboe Says:

    Hi, it’s me again.

    It appears that files cannot be loaded into the database of the iPod. The warning is:

    No ‘F..’ directories found in /media/ipod/iPod_Control/Music’

    This again suggests an incompatibility issue between libgpod and gtkpod, as these files are actually present in directory iTunes_Control. So: what am I supposed to do to get everything where it belongs?

  118. marcan Says:

    You should only have either an iTunes_Control directory or an iPod_Control directory. If you have both then you have a problem. Get rid of the incorrect one.

  119. wboe Says:

    Hi Marcan,

    The problem was: libgpod will recreate that iPod_Control directory. So I followed a brute-force strategy: in itdb_itunesdb.c i replaced every occurance of iPod_Control with iTunes_Control (using a #define), then recompiled and re-installed. Result: everything works. I exported a lot of mp3′s to the iPod already and I’m a wiser and not sadder man now!

  120. aV Echelon Says:

    This honestly works perfect for me but theres one problem.

    When I sync the music it shows on the player but a lot of my songs don’t play. They play for about 3 seconds then I hear silence.

  121. ibeapirate Says:

    @aV Echelon
    I’m getting the same thing as you. Does yours also loop through whatever playlist you select, playing a short intro to each song?

  122. Kyle Says:

    I downloaded libgpod listed under step 4 but when I get to run Make it comes back with:

    make all-recursive
    make[1]: Entering directory `/home/kyle/libgpod’
    Making all in src
    make[2]: Entering directory `/home/kyle/libgpod/src’
    CC libgpod_la-itdb_iphone.lo
    cc1: warnings being treated as errors
    itdb_iphone.c: In function ‘itdb_iphone_post_notification’:
    itdb_iphone.c:51: error: passing argument 3 of ‘lockdownd_start_service’ from incompatible pointer type
    /usr/include/libiphone/lockdown.h:77: note: expected ‘uint16_t *’ but argument is of type ‘int *’
    itdb_iphone.c: In function ‘itdb_iphone_start_sync’:
    itdb_iphone.c:105: error: too few arguments to function ‘lockdownd_client_new’
    itdb_iphone.c:111: error: passing argument 3 of ‘lockdownd_start_service’ from incompatible pointer type
    /usr/include/libiphone/lockdown.h:77: note: expected ‘uint16_t *’ but argument is of type ‘int *’
    itdb_iphone.c: In function ‘itdb_iphone_stop_sync’:
    itdb_iphone.c:250: error: too few arguments to function ‘lockdownd_client_new’
    make[2]: *** [libgpod_la-itdb_iphone.lo] Error 1
    make[2]: Leaving directory `/home/kyle/libgpod/src’
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/kyle/libgpod’
    make: *** [all] Error 2

    And fails..

    I am running OpenSuse 11.2 and I am able to mount the iPhone with Fuse and browse the directory structure no problem.

  123. msdarkici.wordpress.com/ Says:

    Thanks for your work…
    I was trying and i have som problems…
    First…

    When i try ifuse /medi/iTouch i can’t see anything in the directory… i check the logs and i have this:
    Jan 27 20:12:29 arch usbmuxd[7164]: [4] Disconnecting client fd 14
    Jan 27 20:12:29 arch usbmuxd[7164]: [4] Client 15 connection closed
    Jan 27 20:12:29 arch usbmuxd[7164]: [4] Disconnecting client fd 15

    So i try mounting the filesystem with sshfs using iproxy with:
    sshfs -p 2222 mobile@localhost:/private/var/mobile/Media /media/iTouch/

    with this i can see the ipod filesystem and grab photos…xD

    Well, i create the directory iTunes_Control/Device and i run ipod-read-sysinfo-extended /media/iTouch and i only see a segfault but no new file.

    how can i make this thing work?

    Thanks in advance

  124. Markus Says:

    I feel like I’m so close to getting this working ….
    I followed instructions to the word and read all the posts …
    Everything is installed as far as I know …
    I am able to mount and unmount and see all the files …
    here is where i get hung up ….

    [mark@scorpion ~]$ ls /media/iphone/iTunes_Control/iTunes/
    IC-Info.sidb iTunesDB Rentals.plist VoiceMemos.plist
    IC-Info.sidv iTunes Library.itlp Ringtones.plist
    iTunesCDB iTunesPrefs ShowMarketing
    iTunesControl iTunesPrefs.plist ShowRegistration

    [mark@scorpion ~]$ sudo lsusb -v | grep -i iSerial iSerial 1 0000:00:1d.1
    iSerial 3 8dc60b124e697aa33411cc5576b8365a257cfe07
    iSerial 1 0000:00:1d.7
    iSerial 1 0000:00:1d.2
    iSerial 1 0000:00:1d.0
    iSerial 1 0000:00:1d.3
    iSerial 0

    [mark@scorpion ~]$ ipod-read-sysinfo-extended 8dc60b124e697aa33411cc5576b8365a257cfe07 /media/iphone
    Segmentation fault

  125. Markus Says:

    update …

    rebooted and now i can’t even mount device ???

    [mark@scorpion ~]$ ifuse /media/iphone/
    usbmuxd_get_device_list: error opening socket!
    No device found, is it connected?
    If it is make sure that your user has permissions to access the raw usb device.
    If you’re still having issues try unplugging the device and reconnecting it.

    I’m using fedora 12 ….

  126. Markus Says:

    Configuration for libgpod 0.7.3GIT :
    ——————————–

    Host System Type ………: i686-pc-linux-gnu
    Install path ………….: /usr
    Preprocessor ………….: gcc
    Compiler ……………..: gcc -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Werror -g -O0 -Wno-strict-aliasing -Wno-sign-compare -Wdeclaration-after-statement -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/libxml2 -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
    Linker ……………….: gcc -lgobject-2.0 -lsqlite3 -lplist -lxml2 -lglib-2.0 -lxml2 -lgdk_pixbuf-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
    Artwork support ……….: yes
    Python bindings ……….: no
    PyGObject support ……..: no
    iPhone/iPod Touch support.: no

    How to get iPhone/iPod Touch support to yes ???

  127. chiarac.wordpress.com/ Says:

    I’m the “new or inexperienced user, not used to compiling things from source”, I just wanted to show my support as I wait for the automagically working release :-)

    in the meanwhile… does this have anything to do with the ipod-convenience stuff?
    I tried it with Iphone 3gs – firmware 3.x , it didn’t work and I’m trying to understand….

    wish you the best!

  128. Markus Says:

    Ok here is my update …

    I’ve un-installed and re-installed everything numerous times
    actually i have become quite good at it now …
    I get my phone connected and mounted successfully every time
    btw its an iphone 3g with the 3.1.2 firmware i have
    but i still can’t get ipod-read-sysinfo-extended to work …

    [mark@scorpion ~]$ ipod-read-sysinfo-extended xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx257cfe07 /media/iphone
    Couldn’t read xml sysinfo from xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx257cfe07

    Please where to continue from here …???

  129. ggshack Says:

    This may be a heads up, I don’t know.
    I got everything running except gtkpod kept complaining that it couldn’t offset into iTunes DB (which was empty). I decided to start fresh (I have a refurbished 3Gen 8 gig iTouch with 3.12) which took running iTunes in a VirtualBox w/XP. However I ended up with 3.12 (7D11). Now when I tried iFuse I got:

    Failed to connect to lockdownd service on the device.

    Ok. Then I ran AVCWare in VBox/XP and I was able to transfer a song to the iPod touch. It doesn’t should up in albums, whatever, but I could add the song to a playlist. I tried iFuse again and got the same message.

    I’m worried that the “minor” upgrade has broken something.

    (I also found that AVCWare runs under wine but can’t seem to see the iPod. Pity. At least it doesn’t need .NET)

    Ran ifuse –debug and found:

    16:58:33 property_list_service.c:252 internal_plist_receive_timeout(): printing 343 bytes plist:

    Error InvalidHostID Request ValidatePairResult Failure 16:58:33 lockdown.c:821 lockdownd_do_pair(): ValidatePair failure
    16:58:33 lockdown.c:947 lockdownd_goodbye(): called

    Hmmm.
    I’ve saved the entire set of messages (real long) in case you need it.
    Seems that the Device Certificate doesn’t match well with the Host Certificate. When I tried using iTunes, it did say something about “this is associated with iTunes on a different computer” and refused to work with me unless it cleaned out files. Perhaps it changed the the Certs.
    Maybe I should try doing the full factory restore and testing again?

  130. ggshack Says:

    Nevermind. I got it fixed. Thanks to the blogs at libiphone.
    All I had to do was
    erase everything in .config/libiphone directory.

    The problem is the HostID. Erasing stuff in the directory ends up forcing a new HostID. And the HostID is how the iPod and iTunes know they are paired together. So end-users can’t offload a song on some else’s computer. Because that would be wrong.

  131. Markus Says:

    i still can’t get this working ….
    any tips????

    Feb 6 20:53:41 localhost kernel: usb 1-7: configuration #1 chosen from 4 choices
    Feb 6 20:53:41 localhost usbmuxd[3955]: [3] usbmuxd v1.0.0 starting up
    Feb 6 20:53:41 localhost usbmuxd[3957]: [4] Creating socket
    Feb 6 20:53:41 localhost usbmuxd[3957]: [3] Successfully dropped privileges to ‘usbmux’
    Feb 6 20:53:41 localhost usbmuxd[3957]: [4] Initializing USB
    Feb 6 20:53:41 localhost usbmuxd[3957]: [4] Found new device with v/p 05ac:1292 at 1-7
    Feb 6 20:53:41 localhost usbmuxd[3957]: [2] Could not open device 1-7: -3
    Feb 6 20:53:41 localhost usbmuxd[3957]: [4] 0 devices detected
    Feb 6 20:53:41 localhost usbmuxd[3957]: [3] Initialization complete

  132. Andechs Says:

    Hej Markus!

    “Could not open device 1-7:3″ sounds like you don’t have rw permission on your USB device. Same happens to me; after plugging in the device, usbmuxd happily creates the /dev/bus/usb/00*/00* entry, however it does not give user-rw-permissions (only root can write to it).

    To overcome this, kill usbmuxd after plugging your phone, chmod 666 for the phone’s /dev/bus/usb entry (you might see several, pick the right one – it should somehow be related to “1-7: -3″ in your case; try to look at the mount timestamp :-) and restart the deamon (just e.g. “usbmuxd -u -v”). In the syslog you’ll now see s.th. like:

    usbmuxd[9360]: [3] usbmuxd v1.0.0 starting up
    usbmuxd[9362]: [3] Connecting to new device on location 0×40003 as ID 1
    usbmuxd[9362]: [3] Initialization complete
    usbmuxd[9362]: [3] Connected to v1.0 device 1 on location 0×40003 with serial number …

    Hope it helps…

  133. doorknob60 Says:

    Thanks, works perfectly in gtkpod for me :D I use Arch and installed all the git stuff from AUR so it was a pretty easy process too.

    http://i47.tinypic.com/282ndw6.png

  134. Will Says:

    I am having a few problems with usbmuxd working. I recently had a gentoo stable build, but switched to unstable, rebuilt everything, and followed the same steps to get the usbmuxd working, but it is rendering some weird errors….

    # usbmuxd
    http://pastebin.com/z26nieTn

    # dmesg (after i plug the phone in)
    http://pastebin.com/92VYPwQc

    I have made sure all of the versions match or are later than the ones listed above, and I am now out of ideas. Any help?

  135. marcan Says:

    Disable USB debugging in your kernel or downgrade libusb. Recent versions of libusb introduced a bug. 1.0.3 is known to work fairly well. This bug is essentially harmless, but a kernel with USB debugging notices and turns it into a fatal error for debugging purposes.

  136. Philip Says:

    Working okay with Fedora 12 and gtkpod, but not Rhythmbox. Are you using the iPod plugin or the MTP plugin? The iPod plugin finds nothing, but he generic portable player plugin finds the ipod but shows no songs – it does get the free space correct.

  137. Will Says:

    marcan, thanks, that is exactly what it was, I just downgraded libusb to 1.0.3, and it worked fine.

  138. Ken Says:

    I’m able to mount the iPhone fine with usbmuxd and fuse; however, gtkpod isn’t recognizing the correct file structure. It’s still looking for iPod_Control when the iTunesDB is under iTunes_Control. I’ve tried different models but with no effect. What am I missing here?

  139. Ken Says:

    I created the iPod_Control directory. All I had to do was remove it.

  140. Eric Says:

    YES!!! THANK YOU SOOOOO MUCH!!!! I’m so happy I can finnally back up my 1000+ songs :) Guys like you are the ones who actually make all this worthwhile, as Linux wouldn’t exist without you!!! Great job and keep it up!!! :D

  141. Erwin Says:

    Thanks for the tutorial! I have a problem at step 5 though, ipod-read-sysinfo-extended gives me:
    ** (process:4148): WARNING **: Compiled without libimobiledevice support, can’t read SysInfoExtended from an iPhone UUID
    Couldn’t read xml sysinfo from…

    Which of the libraries do I have to recompile with which option? Moreover, I could not find libiphone on the iFuse web site any more; could it be that is has been merged with some other library?
    Thanks!

  142. Erwin Says:

    Alright, just disregard my last post. I just hadn’t tried enough… now I resolved it! I was struggling since Nov 09 and thanks to this blog I finally did it.

  143. Guillaume Says:

    Very useful document, thanks. I do have one issue, with playlists :

    Add a song in Rhythmbox – OK
    Play song in iPhone – OK
    Add a playlist in Rhythmbox – OK
    Delete existing playlist in rhythmbox – OK
    View/Use playlist in iPhone – not visible
    Add song to playlist in Rhythmbox – not saved/synced

    Can anybody help?

    Iphone 3.0.1 jailbroken
    Ubuntu Lucid Lynx 64bit

  144. Guillaume Says:

    Update:

    Things started to work, without any subsequent changes. It’s syncing sometimes, it might take 3-4 takes, but it kinda work enough for my needs.

    :-)

  145. Phil Armstrong Says:

    Well, it works! Rhythmbox doesn’t sync reliably, but that’s a known problem.

    Only (small) wart found so far: gtkpod doesn’t appear to be adding files to the PodCast list, but is putting them in the main iTunes music database, even when the files are dragged onto the PodCast entry for the iPhone & appear there in the gtkpod gtk+ GUI, they only appear in the Music entry on the iPhone, not the PodCast entry.

  146. Manu Says:

    Hello,
    First of all, congratulations and thank you very much for all the hard work.
    Things are not worling all fine for me. After usbmuxd starts, it seems to be starting a second time and trying to kill the first instance of the deamon:

    [code]
    Apr 11 15:23:48 gaugino kernel: [324198.116305] usb 2-3: new high speed USB device using ehci_hcd and address 24
    Apr 11 15:23:48 gaugino kernel: [324198.255139] usb 2-3: configuration #1 chosen from 3 choices
    Apr 11 15:23:48 gaugino usbmuxd[12542]: [3] usbmuxd v1.0.0 starting up
    Apr 11 15:23:48 gaugino usbmuxd[12544]: [4] Creating socket
    Apr 11 15:23:48 gaugino usbmuxd[12544]: [3] Successfully dropped privileges to 'usbmux'
    Apr 11 15:23:48 gaugino usbmuxd[12544]: [4] Initializing USB
    Apr 11 15:23:48 gaugino usbmuxd[12544]: [4] Found new device with v/p 05ac:1293 at 2-24
    Apr 11 15:23:48 gaugino usbmuxd[12544]: [4] Using wMaxPacketSize=512 for device 2-24
    Apr 11 15:23:48 gaugino usbmuxd[12544]: [3] Connecting to new device on location 0x20018 as ID 1
    Apr 11 15:23:48 gaugino usbmuxd[12544]: [4] 1 device detected
    Apr 11 15:23:48 gaugino usbmuxd[12544]: [3] Initialization complete
    Apr 11 15:23:48 gaugino usbmuxd[12544]: [3] Connected to v1.0 device 1 on location 0x20018 with serial number 123eb91d07ab682b3ef3e98d1ed164cb2b356165
    Apr 11 15:23:48 gaugino usbmuxd[12548]: [3] usbmuxd v1.0.0 starting up
    Apr 11 15:23:48 gaugino usbmuxd[12548]: [3] Sending signal 10 to instance with pid 12544
    Apr 11 15:23:48 gaugino usbmuxd[12544]: [4] Caught SIGUSR1, checking if we can terminate (no more devices attached)...
    Apr 11 15:23:48 gaugino usbmuxd[12544]: [3] Refusing to terminate, there are still devices attached. Kill me with signal 15 (TERM) to force quit.
    [/code]

    Does anyone know why is that?

    Tnak you!

  147. marcan Says:

    Please enable udev debugging with sudo udevadm control --log-priority=9. It looks like udev is triggering the disconnection callout for some reason.

  148. Manu Says:

    Here is the output with full debugging info :

    http://pastebin.com/SEJzDsz2

    Thank you very much.

  149. Ipod Touch su Archlinux…ora funziona « Bracuccia.net Says:

    [...] comparivano sull’ipod i brani copiati). Fino ad ora. Infatti seguendo quanto riportato qui: http://marcansoft.com/blog/2009/10/iphone-syncing-on-linux-part-2/ (step 5) e montando l’ipod con “ifuse ipoT” la sincronizzazione [...]

  150. HowTo: iPhone OS 3.x-Geräte unter Linux mit gtkpod synchronisieren « FERNmanns Blog Says:

    [...] Hacker Marcan beschreibt in einem Blogeintrag, wie man mit den aktuellen iPhone-Linux-Bibliotheken das iPhone/den iPod touch mounten und Zugriff [...]

  151. Robert Says:

    Hey, so far it’s going fine, but when I enter:
    ipod read sysinfo-extended ec5180289e09e5eda5eeff3f99b1e3321c54268c /home/robert/.gvfs/Bob’s iPod
    I get a message saying:
    Listening for iPod-specific HAL events…

    (process:21001): GLib-GObject-WARNING **: invalid (NULL) pointer instance

    (process:21001): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)’ failed

    (process:21001): GLib-GObject-WARNING **: invalid (NULL) pointer instance

    (process:21001): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)’ failed
    Then it keeps that, and I have to kill the process before I can do anything. Can anyone help me with this?

  152. Syncing your iPhone media database os 3.x from Fedora 12 « On the third side Says:

    [...] is how I got syncing my iPhone media database os 3.x from Fedora 12 to work. This is based on marcan’s blog. All kudos to marcan, the libgpod hackers and others who helped to hack the ipodhash. Please read [...]

  153. shudda Says:

    Should it workk also on 3.1.3? I compiled both itunnel and usbmuxd on freebsd with a current libusb and it cannot establish ssh. Should it work on Linux? Then I would be pressed to switch.

  154. Anders Says:

    I get this. I don’t know what it means. I have tried to reset the root password to the default “alpine”, but that was not it. What password is ifuse talking about? Googling this error message did not return a single response which is unusual.

    # ifuse /mnt/iPhone
    Please disable the password protection on your device and try again.
    The device does not allow pairing as long as a password has been set.
    You can enable it again after the connection succeeded.

  155. Anders Says:

    Oh how stupid. The “password protection” it is talking about is the 4-digit code you have to enter to get into your phone. DUH! But why will ifuse not work with it? It is a bit dangerous to have to set and reset it frequently. Sooner or later I will make a mistake and won’t be able to get back into my phone.

  156. marcan Says:

    The PIN doesn’t have to be disabled, it should be sufficient to just unlock the phone while connected. This only has to be done once. After that your computer will be paired to the phone and should work without any unlocking.

  157. Renaud Says:

    What’s about a WIN32 port ? I saw some WIN32 comments into GIT…?

  158. Will Says:

    Amarok is kicking this back to me…. Any thoughts?

    evoid Solid::Backends::Hal::HalDevicePrivate::checkCache(const QString&) error: "org.freedesktop.Hal.NoSuchDevice" , "No device with id /org/freedesktop/Hal/devices/usb_device_ffffffff_ffffffff_noserial"

    virtual bool Solid::Backends::Hal::HalDevice::queryDeviceInterface(const Solid::DeviceInterface::Type&) const error: "org.freedesktop.Hal.NoSuchDevice"

    virtual bool Solid::Backends::Hal::HalDevice::queryDeviceInterface(const Solid::DeviceInterface::Type&) const error: "org.freedesktop.Hal.NoSuchDevice"

    virtual bool Solid::Backends::Hal::HalDevice::queryDeviceInterface(const Solid::DeviceInterface::Type&) const error: "org.freedesktop.Hal.NoSuchDevice"

    This is what I currently have installed…
    [ebuild R ] app-pda/libplist-1.3 0 kB [0]
    [ebuild R ] dev-libs/libusb-1.0.3 USE=”debug doc” 0 kB [0]
    [ebuild R ] app-pda/usbmuxd-9999 0 kB [1]
    [ebuild R ] app-pda/libimobiledevice-1.0.1 USE=”python” 0 kB [0]
    [ebuild R ] app-pda/ifuse-1.0.0 0 kB [0]
    [ebuild R ] media-libs/libgpod-0.7.93 USE=”gtk iphone python udev” 0 kB [0]

    I can mount with ifuse just fine and use gtkpod to transfer, but Amarok on the other hand.. it used to work, but now it doesn’t.

  159. south beach seo services Says:

    if you wish to goal Los angeles Real estate, is it necessary to consist of the “los angeles” part in your website when doing meta tags and keywords? Does google know exactly where your website is?

  160. Lsanbrero Says:

    I get errors when trying to compile usbmuxd heres the error

    CMake Error: Error in cmake code at
    /home/larry/Desktop/usbmuxd-1.0.6/Modules/FindUSB.cmake:13:
    Parse error. Function missing ending “)”. Instead found left paren with text “(“.
    CMake Error at daemon/CMakeLists.txt:1 (find_package):
    find_package Error reading CMake code from
    “/home/larry/Desktop/usbmuxd-1.0.6/Modules/FindUSB.cmake”.

    I dunno what to make of it cna you help me please

  161. mjones3 Says:

    It looks like your hash generator at http://ihash.marcansoft.com/ is down. Can you publish the source for that generator? I’d like to try it locally. It’s amazing, it appears that you’re the only one that’s got the algorithm :)

  162. milja Says:

    This error message makes me crazy….

    01:44:51.266][7] main_loop iteration
    [01:44:51.266][7] USB timeout is 1000 ms
    [01:44:51.266][7] Device timeout is 1000 ms
    [01:44:51.266][7] fd count is 2
    [01:44:52.267][7] poll() returned 0
    [01:44:52.268][6] usb_discover: scanning 3 devices
    [01:44:52.269][4] Found new device with v/p 05ac:1297 at 1-7
    [01:44:52.269][2] Could not get configuration descriptor for device 1-7: -1

    Steps tried:
    -dowgrading libusb from 1.0.8 to 1.0.3
    -downgrading usbmuxer from 1.0.6 to 1.0.4

    what’s the prob?

  163. 0vn1cr4ft Says:

    Will test it with my ipad XD

  164. Kat Says:

    My iPod touch 4 is recognized on my Ubuntu 10.10 but will not sync. When I try with either Rhythmbox or with gtkpod, I copy the tracks and it says “sync in progress” but no tracks are copied.

    Followed the guide and I do have the iTunes_Control/Device, but no HashInfo, then got the HashInfo file from a link posted in one of the comments here, pasted it into the /Device folder. Still to no avail :(

    When I do try and use gtkpod it comes up with an error saying “Extended info will not be used”. Any help on this would be appreciated!

  165. iphone oyunlari Says:

    I will try on my iphone:)

  166. Mande Says:

    Thanks alot – your answer solved all my problems after several days sutgrgilng

  167. ttt Says:

    Iphone 4 can’t be synced with linux , maybe in many years from now someone maybe would bother, but till then we would have another generation of iphone .
    Anyway if you have the feeling that you left behinds its because linux is indeed left behind in many aspects.
    I wish it would evolve much faster but i dont see it happening.
    There are so many linux enthousiasts but when i tell them make me a video with 3d text titles and photos animated they need whole day to do it .
    Why to make your life harder ?? The pc is to serve you and not you serve the pc .

  168. Learn How To Sync Your iPhone With Linux OS | iSmashPhone Says:

    [...] text-indent: 0cm;">When it comes to iPhone and iPod support, Linux users always get the short end of the stick. However there are always enterprising souls who come up solutions and if you fancy proper support for the iPhone OS 3.x database then read this guide here. [...]

  169. Buena Scarlett Says:

    I used to be very happy to find this web-site.I wished to thanks to your time for this wonderful learn!! I positively having fun with each little bit of it and I’ve you bookmarked to check out new stuff you weblog post.

  170. JM Says:

    I get “device does not allow pairing as long as a password has been set.” which would be OK, but my LCD (or mainboard of the phone) is damaged, so I cannot input the code.

    Is there any way to input the code using ifuse, rather than the LCD?

Leave a Reply