05/18/05 Using the Apple iPOD on Linux ----------------------------- written by David Ranch dranch@trinnet.net ---------------------------------------------------------------------------- 1. Intro 2. Getting things running with Firewire 3. Getting things running with USB 4. Using the Linux HFSPlus filesystem support (used with 1394) 5. Using the Linux VFAT filesystem support (used with USB) 6. Using Gnupod 7. Unmounting the iPOD 8. Building gnupod 9. Quick reviews and URLs for other IPOD tools and sites 10. Errata ---------------------------------------------------------------------------- 1. Intro This is VERY much a work in progress and is only included to give some people a head-start, etc. NOTE #1: -------- Before you run any commands to load kernel modules, I recommend to run a: tail -f /var/log/messages & in a different window so you can see what's going on. NOTE #2: -------- In my opinion, Linux hfsplus support in the 2.4.22 kernels isn't ready for prime time since the hfsplus.fsck tools don't work. ---------------------------------------------------------------------------- 2. Getting things running with FIREWIRE --------------------------------------------------------------------------- PCMCIA card: for a Dell c640, you need to drop out of X /first/ to start PCMCIA services. If you don't do this, the machine will crash. To make sure things are ok, try switching to a different console while in the CLI mode via Alt-F*. If the screen is screwed up upon switching, you have a conflict with the FrameBuffer code (the Dell uses a ATI Radeon Mobility M7 chip). Recompile the kernel without framebuffer support and try again. modprobe ohci1394 modprobe sbp2 or modprobe sbp2 sbp2_max_speed=0 sbp2_serialize_io=1 sbp2_force_inquiry_hack=1 ----> if the ipod doesn't log in, RESET the IPOD!!!! #Some machines have the hotplug stuff already runnging. If your machine does NOT create a /dev/sd* device, goto http://www.linux1394.org, get, and run: rescan-scsi-bus.sh cat /proc/scsi/scsi ---------------------------------------------------------------------------- 3. Getting things running with USB ---------------------------------------------------------------------------- #modprobe usb-uhci # (Mandrake HotPlug takes care of adding the devices and sbp2) #Mdk 10.1 will auto install the kernel modules #This will let you get statistics about the USB connection in /proc/bus/usb mount -t usbdevfs none /proc/bus/usb cat /proc/scsi/scsi NOTE: Using the gtkpod program, I was only able to transfer files at 229 Kbyte/s or 1.83Mb/s using USB 1.1. I haven't narrowed this down to being just USB1.1 performance, a HW problem on my machine, or GTKpod's performance. ---------------------------------------------------------------------------- 4. Using the Linux HFSPlus filesystem support (used with 1394) ---------------------------------------------------------------------------- Download and install the HFSplus kernel patches or compile up 2.4.22 which has it built-in: modprobe hfsplus mount -t hfsplus /dev/sdd3 /mnt/ipod I have seen that when you mount the ipod, the logs say that the hfsplus file system isn't clean and will only mount read-only. I've tried the Darwin hfsplus.fsck tool but it didn't seem to write the fixes to the iPod. I eventually connected the "corrupted" iPod to an OSX machine to fix the iPOd but even after that, hfsplus.fsck said it was clean but it would still mount read-only!!! After that, I reformatted the unit to VFAT. ---------------------------------------------------------------------------- 5. Using the Linux VFAT filesystem support (used with USB) ---------------------------------------------------------------------------- #Notice the permissions so non-root users can write files to the iPOD mount -t vfat -o umask=000 -o sync /dev/sda2 /mnt/ipod ---------------------------------------------------------------------------- NFS to Remote MP3 repository ---------------------------------------------------------------------------- #trinity /etc/rc.d/init.d/portmap start /etc/rc.d/init.d/nfs start #stimpy /etc/rc.d/init.d/portmap start mount -t nfs trinity:/home/hpe/SOUND/MP3s-archive /mnt/mp3s/ ---------------------------------------------------------------------------- 6. Using Gnupod ---------------------------------------------------------------------------- #Initialize your iPOD for GNutunes (if you haven't done it before): #------------------------------------------------------------------ # NOTE: The way the ipod works is that files are transferred over and # the ID3 tags are parsed and put into GNUtunesDB file. Once you # run the GNUpod "mktunes", it converts the GNU file to Apple # iTunesDB. # # NOTE2: One cool trick with the iPOD is that if you want to blank the # unit, you can just delete the iTunes/Music folder, delete the # GNUtuneDB and iTunesDB files, and finally, re-run the gnupod_INIT # program and it's clean! # gnupod_INIT.pl -m /mnt/ipod #Some other tool was used last time to update the ipod # # If you use Itunes or other tools in addition to GNUPod, you need to make # sure the GNUpod XML file is up to date: # tunes2pod.pl -m /mnt/ipod #Add files #----------------------------------------------------------------------- # NOTE: When adding files with wildcards "*"s, you are at the mercy of the # OS adding the files in a specific order. I recommend to use the # Unix "find" command and use pipe to control the order of the Songs # being added. # export IPOD_MOUNTPOINT="/mnt/ipod" /usr/local/bin/gnupod_addsong.pl -m /mnt/ipod /mnt/mp3s/good/Rainbow/* \ /usr/local/bin/gnupod_addsong.pl -m /mnt/ipod /mnt/mp3s/good/Saga/* #find files by . . . # # -a = artist # -g = GENRE # -i = ID # -l = Album # -t = Title # # -o = search once to not match multiple times # --delete = delete gnupod_search.pl -m /mnt/ipod -a "Schlummiguch" #Delete files gnupod_search.pl -m /mnt/ipod -a "Schlummiguch" -d #Write the iTunes dir # # Write the GNUpod XML file to iTunes format # /usr/local/bin/mktunes.pl -m /mnt/ipod if this throws errors, I noticed that the iTunesDB file had MP3 times of "0". I had to update my MP3::Info perl library to 1.0.2 to fix this. ---------------------------------------------------------------------------- 7. Unmounting the iPOD ---------------------------------------------------------------------------- 1394 or USB ----------- umount /mnt/ipod #Firewire --------- rmmod sbp2 NOTE: I've seen that sometimes, Linux won't properly log out of the Ipod and it thinks it's still connected to the PC. If this happens, try to reload the sbp2 or usb-storage driver and then remove them again. If that doesn't work, you might have to reboot your PC! If you know of any alternatives.. PLEASE let me know. #USB ---- eject /dev/sda rmmod uhci-hcd #disconnect the ipod and prepare the USB system to be ready again modprobe uhci-hcd NOTE: I've seen that sometimes, Linux won't properly log out of the Ipod and it thinks it's still connected to the PC. If this happens, try to reload the sbp2 or usb-storage driver and then remove them again. If that doesn't work, you might have to reboot your PC! If you know of any alternatives.. PLEASE let me know. ---------------------------------------------------------------- 8. Building gnupod ---------------------------------------------------------------- - Optional things if your distro needs them gpg --import pab.asc gpg --verify gnupod-0.90.tgz.asc #if it says "Good signature", you're good to go perl -Mcpan -e shell or cpan install MP3::Info install XML::Simple Unicode::String install Bundle::CPAN reload cpan ------------------------------------------------------------ 9. Quick reviews and URLs for other IPOD tools and sites ------------------------------------------------------------ iPOD Sync Programs ------------------ WINDOWS: http://www.ephpod.com/ JAVA: http://mypod.sourceforge.net/ QT (KDE): http://guipod.sourceforge.net/ [Oct. 2002] GTK (Gnome): http://gtkpod.sourceforge.net/ [July 2003] +++> Pretty easy to use +++> MP3 id tag editor +++> Supports file ratings ---> Poor user feedback on status ---> Seems SLOW ---> all files place on the iPOD are named like gtkpod00070.mp3 RubyPod (TCL): http://rubypod.sourceforge.net/ [March 2003] GnuPod (perl): http://www.gnu.org/software/gnupod/ [Sept. 2003] +++> Seems fast +++> strait forward to use +++> iPOD file names resemble original names ---> no GUI ---> no directory recursion iPOD folder sync: ----------------- http://armin.emx.at/ipod/ MP3 tag tools: -------------- News and Information: --------------------- News: http://ipod-on-linux.sourceforge.net/ Info: http://www.ipoding.com 10. Errata ---------- 05/18/05 - Updated the USB stuff 09/29/03 - last update .end.