The iPod situation is now mostly fixed. I was able to figure out how iTunes gets the iPod serial number (and other info) with the help of a USB monitoring tool and Matt Dharm (the usb-storage guy). After that, Aaron used the metric ton of SysInfo samples you guys sent in to get a serial number -> model number mapping.
To get info about (recent) device, iTunes requests an xml document from it over USB. I saw this in the USB trace I had, but the data was nowhere on the disk exposed by USB Mass Storage. Puzzling. Not really knowing much about USB MC, I enlisted the help of Matt, who obviously knows a lot more. He informed me that it was requesting the data using a special SCSI INQUIRY command, and I could probably use SG_IO to get it out. I ran sg_inq on my iPod with the right parameters, and out came the xml. Success! After that I wrote a hal method for libipoddevice to pull the info out (since you need to be root), and the rest was just parsing the xml and doing the serial -> model mapping.
Even though it was a fairly painful couple of days trying to fix this, I’m pretty happy with the result. The xml from the device includes some really tasty stuff, including information on the image formats for cover art and photos. We are using this data now in ipod-sharp instead of the static table we had before, which will be really great for maintenance. New iPods with previously unknown image formats will Just Work! There is also data on the video formats, which I will soon use to add video support to Dopi
17 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.
Bonus points if you can figure out how to set/sync the time on the iPod when it’s getting connected
Could a similar query be used to pull out the encryption key used by the iPod for playing restricted AAC files so we can transfer the music to our Free desktops/players ?
Maybe they’re not as bad as you thought, but if they’d been nice they’d have sent you this information right away for two reasons. 1. Theyre the selfproclaimed opensource friends. 2. Its in their advantage to have as many platforms support iPods as possible, so they can make more profits.
Despite the pain I’m sure the Banshee team (and any other iPod supporting project) has gone through these past few days, I’m very happy to hear about Dopi.
these data
What did you use to carry out the USB sniffing? Windows install, Wine? Is the USB snifferfreely available? whichh version of iTunes did you sniff?
teuf: I used USB Monitor on Windows with iTunes 7.
I’m disappointed… why you need the sg_inq for model determining if this command does not provide ModelNumStr?
It just gives you a Serial Number which actually can be obtained from /sys/* files, e.g.
/sys/bus/usb/devices/1-1/serial..
alex: that’s the serial for the USB chip or something, not the iPod itself.
Ops. I see, yes you’re absolutely right. This serial is the same as FireWireGUID in the xml.
Appreciate all your work, but my new black iPod Nano 8GB does not work with the Gentoo versions of libipoddevice-0.5.0, banshee-0.11 and ipod-sharp-0.6.2.
While HAL correctly identifies the iPod (I think? At least it has info on the iPod, will paste below), the “ipod” program sees nothing, when I plug/unplug the Nano.
I took a look at the “ipod –model-xml” and I can see that the serial-number of my Nano does not match. Does this have anything to say?
My HAL info:
/org/freedesktop/Hal/devices/storage_serial_Apple_iPod_000A2700189C8E5E
Any help on this appreciated.
Hi,
Can I please get the details of the SCSI INQUIRY you use? Thanks.
Bob
rkf7: I put info about it up on the ipodlinux wiki here.
Hi,
I haven’t had any luck on a Debian Linux system getting the sg_inq command to work. Is there a way to see if my Linux kernel has the SG_IO ioctl? Thanks.
Bob
I am using a new kernel. I can now get the info with the command:
sg_inq /dev/sgn
Where n=0,1,2,3…
Bob
Hey,
I know it’s not very related to the topic, but I really want to use Ipod-sharp\dopi but I’m a Windows user and have no idea how to build the projects (are they even compatible to Windows?!)
Please help!
Thanks ahead
–sternr
Автор молодец! Тема почти раскрыта. Приглашаю почитать мою статью о авиалегкобыстром автомобиле будущего