ITunes 8 through modified Wine

From Sync In Linux

Jump to: navigation, search

Contents

iTunes4Linux

How you can help:

  1. Can you compile wine and apply a git patch? A lot of what we're doing requires tedious patching and testing. If you'd like to help, email huanix@gmail.com
  2. Contributions = motivation. Any contribution you make will make us that much more dedicated to staying up long hours to solve this problem. paypal contributions to huanix@gmail.com will be shared between hank and eric.
  3. Can you program and debug wine? Are you willing to help? huanix@gmail.com
  4. Are you good with wiki development? We're looking for someone to customize a wiki front end for itunes4linux. (Don't tell anyone, but we think we like what ies4linux has on their homepage)

How long will it be before this works?

A while. Probably not before February, 2009. We are still very much in the "cutting a path through the forest" stage of building highway. We are nearly certain this is possible, but it will take time.

Who are we?

  • EADurbin
  • Huanix
  • TJ
  • You?

Current status

12/16/2008

  • We are realizing that many of the bugs we're encountering could be solved by the Wine community at large, so we'll be tracking/working with those bugs more closely. This means that while a solution might still be a wine fork, it might also take value from or share value with wine. We will continue to develop toward a workable solution in whatever shape it takes. (Eric - is that an appropriate interpretation? -hb)

12/15/2008

  • Welcome to TJ, our newest itunes4linux hacker. TJ brought some great ideas about the usb transfer, specifically utilizing parallel URBs in the USB stream to achieve connectivity. This does change many of our (at least my) concepts of what needs to happen, but it is VERY welcome.

12/14/2008

  • We were able to pick up some books on Amazon thanks to Ben's contribution - thanks again.
  • We are backtracking to Wine 0.9.60 to look at Maarten's April 2008 patch [1] ( i misplaced the thread, but it shouldn't be hard to re-locate.) This setup, along with the kernel hack (max_usbfs_buffer size set to 128k) and a ntdll hack that Eric did (and the original 1603 hack for iTunes8) are giving us some progress. We're narrowing in on a solution from several angles.

12/13/2008

  • A regressive day. One of the things we thought would carry us through will probably not do much more than face value (max usbfs buffer in the kernel) - we hoped that seeing the iPod would somehow lead to recognizing the it, but there appears to be much more to it than expected.
  • We are exploring some of the bugs and patches that may already address them, for example, this ioctl marshalling patch that Maarten wrote. We haven't looked at this before.
  • Thanks to Ben for the contribution. (huanix@gmail.com through paypal)

12/12/2008

  • The initial focus of the project was with the 1.0.1 branch and six patches (we're calling it 1.0.1 + 6). This will get you to the point where you can "see" that an iPhone/iPod exists in iTunes, but the model is not recognized and no sync is possible. We are no longer focusing on this branch, in favor of using the most recent development branch of wine. The six patches we used are completely incompatible with the development branch and must be re-developed.
  • The current focus is to use the lessons learned from the USB implementation and kernel patch in 1.0.1+6 to port the same functionality to the current development branch (1.1.10 at the time of writing).
  • We are also tinkering with the MAX_USBFS_BUFFER_SIZE in the linux kernel (devio.c) to see if 128k is the magic number, or if other values work as well (or better)

Current iTunes 8 bugs in wine

  • 9649 - iTunes does not recognize iPod [2]
  • 15533 - iTunes does not install [3]
  • 16370 - unsupported ioctl errors [4]
  • 15482 - iTunes fails to sign in to the iTunes Store [5]
  • 16523 - cdrom support missing in iTunes [6]

Getting up to speed

This method is nearly completely depreciated and will likely be removed soon! -hb 12/16/2008

Current Steps for getting iTunes to "see" a pod device under Linux

  1. Starting with a fresh Desktop install of x86 Ubuntu 8.10
  2. sudo apt-get update && sudo apt-get dist-upgrade (also add your restricted drivers and reboot into the newest kernel)
  3. sudo apt-get build-dep wine
  4. run the wine dependency installer linked from winehq (do a "save as") [7]
  5. run the virtualbox-iphone-r7.sh script. [8]. This script will modify your kernel for the correct MAX_USBFS_BUFFER_SIZE, currently thought to be 128k.
  6. get the source for wine 1.0.1 [9]
  7. Run these patches (in this order) with git-apply --verbose from the root of your build directory. (reference: [10] )
    1. mlankhorst1.bin[11]
    2. mlankhorst2.bin[12]
    3. mlankhorst3.bin[13]
    4. mlankhorst4.bin[14]
    5. mlankhorst5.bin[15]
    6. eadurbin6.bin[16]
  8. in the build directory, run tools/make_requests
  9. ./configure --prefix=/my/special/build/path && make depend && make && make install [17]
  10. after build, run winecfg. Choose windows vista and autodetect drives and be sure USB is mapped; also test audio to initialize it.
  11. install iTunes 8.0.1.11
  12. ./wine net start "ipod service" [18] (this seems to be running most of the time, but it can't hurt!)
  13. start itunes
  14. wait 10 seconds
  15. plug in Pod; cross your fingers, hold your breath, and throw salt over your shoulder.
  16. I now have a stable installation that predictably picks up pod devices!!! This is NOT complete. it only knows that a device exists, it cannot interact, and it is VERY laggy!

I did confirm that this does "see" both iPod nano 8GB, iPhone 3G 16GB, and iPhone 1st gen. It does "see" them, but it does not recognize them!

Proof of present status

The output log of a session: wine_sees_ipod_output_log

A recordmydesktop video of a session: http://www.huanix.com/wp-content/uploads/2008/11/itunes8_sees_iphone_in_linux.ogv (22 mb ogv video)

Build Log

Builder/Date Wine & iTunes version source modifications? Outcome Lessons Learned Link to runtime output
Hank on P4S800 12/11/2008 1.0.1 & 1.1.6 for hackeditunes; 8.0.1.11 6 patches, the only known working config & devio.c hack from vbox iTunes runs, usb seems to work if the MAX_USBFS_BUFFER_SIZE is set to 16384.
  • Weird. I'm tinkering with the devio.c max_usbfs_buffer_size that was applied in the virtualbox patch and it seems to be having some effect. this may be useful. I was trying to rule it out as a contributing factor.
  • Still tinkering with this. With a default MAX_USBFS_BUFFER_SIZE of 16384 (16384/1024 = 16k) it doesn't work, but with a buffer of 128k it does work. Just for kicks, i tried 256k, but it didn't work either. [19]
error1
Hank on M2N-SLI D 12/11/2008 1.0.1 & 8.0.1.11 6 patches, the only known working config. No vbox script. Going to try without the virtualbox script first, then with it. still trying to confirm or eliminate it. It is sort of looking like things only work with the usb buffer size hack. iTunes runs, but ipod, with or without the virtualbox hack this is a 64bit machine (running 32bit linux), it appears (for now) the MAX_USBFS_BUFFER_SIZE hack i used on the P4S800 didn't work on this machine. I'll double check this later. error2
Hank on Dell Latitude D510 12/11/2008 1.0.1 & 8.0.1.11 6 patches, the only known working config. No vbox script. Going to try without the virtualbox script first, then with it. still trying to confirm or eliminate it. It is sort of looking like things only work with the usb buffer size hack. it failed to see the pod or phone. this should be re-run.(45:46 compile time) error3
Hank on P4S800 12/12/2008 AM git & 8.0.1.11 Alexander Morozov's git with the max usbfs buffer @ 128k libwine.so (missing) trouble, then Drive mapping "Failed to connect to the mount manager..."
  • unsuccessful build
  • splash.h:24:21: error: X11/xpm.h: No such file or directory
  • build time: 67:56
  • too tired to look up the xpm.h
error4 & [20]
Eric on Aspire 4520 12/12/2008 1.1.6 & 8.0.1.11 6 patches and buffersize shell script Itunes works, detected 5th generation iPod video
Hank and Eric 12/14/2008 0.9.60 & 8.0.1.11 Lankhorst April08, ntdll, 1603, & max_usbfs Itunes works, detects devices, still no real recognition, but this appears to be a step closer.
  • The "Version" information in this build gives different (more accurate) info.
  • I (hank) had trouble getting the kernel hack to work under 2.6.27-9, had to revert to 2.6.27-7.
  • Still not clear: This may only detect devices on the first run of iTunes. (after which, rm -rf ~/.wine and redo)
  • Does not put iPhone into sync mode.
  • Will allow me to attempt to restore the iPod.
  • No Genius
error6 screenshot source

toolbox

usbmon for monitoring usb transfers in linux - still not sure what it's going to give me, but i'm playing! http://www.mjmwired.net/kernel/Documentation/usb/usbmon.txt

linux-source-2.6.26-7

Personal tools