Maybe they’re not as bad as I thought
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
September 18th, 2006 at 10:43 am
Bonus points if you can figure out how to set/sync the time on the iPod when it’s getting connected
September 18th, 2006 at 12:20 pm
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 ?
September 18th, 2006 at 12:58 pm
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.
September 18th, 2006 at 11:56 pm
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.
September 19th, 2006 at 4:45 am
these data
September 19th, 2006 at 5:19 am
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?
September 19th, 2006 at 7:20 am
teuf: I used USB Monitor on Windows with iTunes 7.
September 21st, 2006 at 6:18 am
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..
September 21st, 2006 at 8:04 am
alex: that’s the serial for the USB chip or something, not the iPod itself.
September 21st, 2006 at 9:23 am
Ops. I see, yes you’re absolutely right. This serial is the same as FireWireGUID in the xml.
September 25th, 2006 at 10:32 pm
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.
January 6th, 2007 at 10:57 pm
Hi,
Can I please get the details of the SCSI INQUIRY you use? Thanks.
Bob
January 7th, 2007 at 1:10 pm
rkf7: I put info about it up on the ipodlinux wiki here.
February 7th, 2007 at 4:20 pm
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
February 13th, 2007 at 2:38 pm
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
April 23rd, 2007 at 3:02 am
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