model. I had been holding off for years. The iPod sounded nifty, but I just didn't quite go there.
. It lets you plug your iPod directly in to a digital camera. The iPod can download photos from the camera to its internal disk without the need for a PC. Very slick.
-- a quick subway ride from Usenix. They were out of stock on the FM tuner, so I ordered that online.
The next step was to get the iPod working with Linux. I currently have it working with both music and video. Here's how I did it.
Connection
The iPod hooks up to the computer using USB. Your Linux kernel should already have USB support built-in. After you plug in the iPod, you should be able to run
dmesg and see the detected device and its available partitions. Or, Gnome or KDE may automatically mount it for you.
I put a line like this in my /etc/fstab:
/dev/sda2 /ipod vfat rw,user,noauto 0 5
So I can mount it myself.
When you're done with it on the computer, you should remember to
umount /ipod. You can also
eject /dev/sda (or whatever your device name is) to make the iPod usable even while its charging from USB.
I've encountered some difficulties with USB 2.0 and the iPod. My Thinkpad laptop didn't work with it at all, but rmmoding ehci-hcd (the USB 2.0 driver) allowed it to work fine in USB 1 mode. Some desktops also had trouble with eject, or would freeze the USB connection after awhile.
Applications
The next part of the equation is application support. You'll need some sort of way to get music and video onto the iPod. I use
gtkpod, but first I should explain why I do not use certain other apps.
I tried Banshee first. After a confusing maze of Gnome hal mess, it finally saw the unit. But it proceeded to completely scramble the id3 tags of the music that I uploaded, leaving artist information in the genre spot, etc. It also proved unreliable in a number of other ways, and wasn't all that difficult to crash. In short: don't bother.
I next tried Amarok. Its feature set looks better than Banshee's, but it crashes
all the time. It even left my iPod's filesystem in an inconsistent state once. Don't bother with it either.
Gtkpod just works. It doesn't have an amazing featureset, but it does what it does well. I can upload music to the iPod, and also videos (if I rename them to a .mov extension). Its duplicate song detection is also a nice feature.
I've also used Rhythmbox just a bit, but it didn't have any compelling features over Gtkpod.
One thing that they all lack is podcast synchronization. Amarok theoretically can automatically download podcasts to an iPod, but I wasn't able to test this because it kept crashing. It also doesn't seem to have a facility to remove old episodes.
Gtkpod can let you manually add things to the Podcasts list, but again doesn't have a facility to remove old episodes.
Clearly an area for future work.
Video on the iPod
So this is a video iPod, so the next question was: how do I encode video for it using Linux?
I have a
MythTV setup, so video support would be very nice.
It turns out that it's not too hard to achieve. Based on
some tips I found with a bit of Googling, I came up with this little script that uses ffmpeg to encode video for the iPod:
#!/bin/sh
ffmpeg -i "$1" -f mp4 -vcodec mpeg4 -maxrate 1000 -b 700 -qmin 3 -qmax 5 \
-bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 192 -s 320x240 \
-aspect 4:3 $2
You can reduce the -qmin and -qmax, and raise the -maxrate, to increase video quality. You can also use -s 480x480 for the maximum video quality the iPod supports according to the Apple specs. Some people report it actually works with even higher resolutions as well. The screen itself is 320x240 though, so the higher resolutions only matter if you'll be displaying to a TV or something.
I encountered a problem with this setup, though. ffmpeg was segfaulting on some of the video files from the MythTV. I couldn't figure out exactly why -- apparently some mild corruption due to signal fade or something. But it wasn't pretty. I wanted to use mencoder to generate the iPod files, but apparently it can't write out a proper mp4 header for the iPod. So I cobbled together a solution that uses mencoder to scrub the file and then ffmpeg to encode it. My final solution is:
#!/bin/sh
mencoder $1 -lavdopts er=1 -oac pcm -ovc copy -o $HOME/$$.mov
ffmpeg -i $HOME/$$.mov -f mp4 -vcodec mpeg4 -maxrate 2100 -b 700 \
-qmin 1 -qmax 3 -bufsize 4096 -g 300 -acodec aac -ar 44100 \
-ab 192 -s 320x240 -aspect 4:3 $2
rm $HOME/$$.mov
Now, just make sure your output filename has a .mov extension, then use gtkpod to upload it. It helps to have a dedicated playlist for just video content.
Conclusion
The iPod is a very nice piece of hardware. I don't like Apple's proprietary software stack, but the iPod can be made to work very well with Free software in Linux.