iTunes and Linux

People speak about "iTunes on Linux" as if that were a single, simple
thing. It is not. Apple's "iTunes" application, which Apple, Inc.
goes to enormous lengths to prevent running on OSes not controlled by
the copyright barons (as Linux is not), is a:

client for Apple's iTMS e-commerce site (using an undocumented
network protocol suite for communication across the Internet)

digital music player, with "smart" playlists and play-count tracking

iPod-manager

updater for iPods' firmware (beware that new firmware has to
date often introduced newer and nastier DRM)

This page will aim to document Linux-relevant software and technology
in all of those categories. At this date (2009-03-09), it touches on
most of them.

Many of the obstacles to full Linux functionality relate to the
DRM-obscuring of many AV files people manage using the iTunes
application. Therefore, it is useful to first discuss measures to strip
or sidestep DRM'ing of those files:

1. Access to iTunes Music Store (iTMS) from Linux

Apple, Inc. seems to be moving at a glacial pace away from
DRM (Digital Restrictions Management) on AAC sound files
offered at the iTunes Music Store -- but DRM remains a factor,
for now. Following are Linux options to deal with iTMS access,
and to deal (or not deal) with the DRM. All codebases mentioned
other than iTunes for MS-Windows and CrossOver Linux are open
source.

The DRM'd AAC files in question are referred conventionally
as "Protected [sic] AAC" or .m4p files, with the "p" standing for
the Orwellian concept of "protection" -- in distinction to non-DRM'd
AAC files, which are conventionally called "Purchased AAC", "iTunes
Plus", or .m4a format.

This page likewise doesn't attempt to help you "scrub" the
digital watermarking from purchased files, as the only plausible
reason for doing so is to rip off the vendor by bootlegging your
files to others and attempt to evade responsiblity. (I have zero
interest in helping others violate copyright. I am interested only
in helping you actually enjoy the full fair use of files you've
paid for.)

Since Feb. 2008, Apple has repeatedly released new versions of
the iTunes application to (among other things) foil Requiem's ability
let purchasers of music / video files actually own what they've
purchased. Consequently, the most reliable way to use Requiem is to
ensure that you have not upgraded to the latest iTunes.
Current versions of Requiem (which depending on timing might be able
to decrypt files obscured by current versions of iTunes) can be
found on Freenet, or on various BitTorrent streams. (Search
for "requiem fairplay", and you might want to add version
strings such as "1.8.2", "1.8.3", etc. to make sure you find
the latest release.)

JHhymn (Hear Your Music aNywhere, implemented in Java) on Linux
stripped the Veridisc FairPlay encryption present on most iTMS
AAC files (.m4p = encrypted AAC) you purchase from iTMS, turned
them into regular AAC (.m4a) files, which then could be played
on Linux without using iTunes for Windows on Linux (e.g., under
WINE) to get to them. It was compatible with sound files
downloaded by pre-6.0 versions of iTunes. However (note
Wikipedia link, below), it is currently (2009-02) necessary to
instead use similar open-source programs MyFairTunes7 or
QTFairUse6 on MS-Windows, or FFH (Flaky Fairplay Hack) on Mac
OS X, instead of JHymn, to perform the encryption-stripping, as
those alone are compatible with recent (e.g., 7.5.0) iTunes
versions that are now required by iTMS.

Cryptographic obfuscation ("protection") can be removed from music
files, with current versions of iTunes and QuickTime for MacOS
installed, by importing the music into a new project in iMovie, then
exporting the movie to QuickTime expert settings with sound set to
"aiff", sampling rate 44.1 kHz, linear PCM as the format, and 16 bits
as the sample size. This will resample the music, and accordingly
entail a very minor amount of quality loss, but not nearly as much as
Apple's official solution
of saving iTunes files to CDDA (CD digital audio) by burning an audio
CD, and then re-importing the audio tracks to MP3, and in the
process resampling themhttp://hymn-project.org/forums/viewtopic.php?t=1900 (how to do the iMovie operation)

iTunes on WINE
WINE 0.9.45 or newer (on x86 Linux) can run iTunes 7.3 for MS-Windows.
This of course leaves the Veridisc FairPlay encryption present on most
iTMS AAC files (.m4p = encrypted AAC) intact, but the iTunes
app can play the sound files within Apple's DRM control regime.
(Set WINE to emulate MS-Windows XP, using winecfg.) Also,
iTunes 7.4.3 for MS-Windows is verified to work fully under
WINE 0.9.51. Note: CrossOver Linux (in place of WINE) a/o v.
6.2.0 does not allow iTunes to access iTMS, though it does
access Apple iPods.

At this writing (2009-03-09), WINE's USB support is reported to
good enough for the Win32 iTunes-app's management of regular
(pre-"Touch") iPods and also the rather different iPhone and iPod Touch.
(Another option, of course, is virtualised MS-Windows under VMware
or equivalent.)

Banshee iTMS plugin
Banshee music player supports an unofficial iTunes plug-in that
allows it to interact with iTMS the same way the iTunes
application does. However, this approach (1) involves running
unsupported, unmaintained developer plugin code that may not
work at all, and (2) leaves the Veridisc FairPlay encryption
present on most iTMS AAC files (.m4p = encrypted AAC)
intact.http://www.banshee-project.org/Plugins

It's important to note that Apple regards DAAP and RAOP (Remote
Audio Output Protocol, used for streaming) as non-documented,
proprietary protocols and occasionally subjects them to incompatible changes
without notice. Third-party support is made possible only through
outside reverse-engineering, which must be repeated at intervals when
Apple introduces new obstacles. E.g., at the moment (2008-01),
non-Apple RAOP clients (Rhythmbox, etc.) cannot successfully receive
AV streams from Apple iTunes (7.x) itself via Apple Airport Express WAPs
(which Apple calls "AirTunes"), hence nobody has been able to implement
independent RAOP-serving Wireless Access Points (WAPs) that iTunes will
be willing to stream to, because of new RAOP-functions cryptographic
wrapping introduced with iTunes 7.x. Likewise, non-iTunes implementations
of DAAP currently cannot exchange audio files with iTunes, for similar
reasons.http://0pointer.de/blog/projects/apple-sucks.html (Apple lock-in introduced with iTunes 7.x)http://amarok.kde.org/blog/archives/499-more-on-Apple.html (Amarok developer's similar account)

4. Replace Apple's Firmware on Your iPod with Something
Better

"Rockbox is open source firmware for mp3 players, written
from scratch. Rockbox aims to be considerably more functional
and efficient than your device's stock firmware while remaining
easy to use and customizable. [...]" (You can also
dual-boot iPods with both Rockbox and the original firmware.)http://www.rockbox.org/