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)
- song-ratings system
- search facility for sound tracks
- client for online information services about sound tracks
- DAAP network client
- AAC and MP3 encoder
- CDR-burner
- specialised file manager for adding/removing files from iPhones and iPod Touch devices, which, unlike other iPods don't present as USB mass-storage devices but rather an undocumented iTunes API network-protocol suite (1, 2) over USB
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 deliberately eschews links to lamers attempting to petition Apple, Inc. to release proprietary iTunes software as native proprietary-binary software for Linux and/or BSD.
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.)
Requiem
Requiem appeared in Feb. 2008, reverse-engineering Apple/Veridisc's "FairPlay" cryptographic obscuring ("protecting" [sic]) of the music and video you pay for. Apple's digital watermark on your individual file remains untouched: Your purchasing e-mail and name remain on record in the file. It works by directly decrypting purchased files in "/Users/Shared/SC Info" (OS X), "C:\Documents and Settings\All Users\Application Data\Apple Computer\iTunes\SC Info" (Windows XP), or "C:\ProgramData\Apple Computer\iTunes\SC Info" (Windows Vista).
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.)
At this writing (2009-02), the latest Requiem is v. 1.8.2, which
strips encrypted obfuscation applied by iTunes 8.0 (and prior), but
not the further obfuscation added by iTunes 8.0.2.
http://hymn-project.org/forums/viewtopic.php?t=2702 (Requiem FAQ)
JHymn, MyFairTunes6, QTFairUse6, and FFH
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.
2009-02 update: FFH does not work with files written by QuickTime versions starting with v. 7.4.1.
http://hymn-project.org/jhymndoc/ (JHymn, currently non-useful a/o 2008-01)
http://hymn-project.org/forums/viewtopic.php?t=2614 (Historical details)
http://en.wikipedia.org/wiki/Hymn_(software) (HYMN project nature and history)
http://www.hymn-project.org/download.php (MyFairTunes6, QTFairUse6)
http://hymn-project.org/forums/viewtopic.php?t=2436 and, in particular,
http://hymn-project.org/forums/viewtopic.php?p=16655#16655 (FFH)
iMovie "trick" on MacOS
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 them
http://hymn-project.org/forums/viewtopic.php?t=1900 (how to do the iMovie operation)
CPAN M4P and iTMS_Client modules
Perl's CPAN repository includes William Herrera's Perl package
Audio::M4P (encompassing Perl modules Audio::M4P::Atom,
Audio::M4P::Decrypt, and Audio::M4P::QuickTime), which when
used in conjunction with Herrera's LWP::UserAgent::iTMS_Client
allows one to access iTMS, download your keys, purchase
Veridisc FairPlay-encrypted AAC files (.m4p = encrypted AAC),
and then strip them to regular AAC (.m4a) files.
http://search.cpan.org/~billh/LWP-UserAgent-iTMS_Client-0.16/lib/LWP/UserAgent/iTMS_Client.pm (iTMS_Client)
http://search.cpan.org/~billh/Audio-M4P-0.42/ (Perl atoms for dealing with
M4P/MP4/M4A QuickTime audio and video files, a library for
decryption of Veridisc FairPlay encryption present on most
iTMS AAC files, Perl M4P/MP4/M4a audio / video tools, and
documentation)
http://search.cpan.org/~billh/ (Check this page for newer releases.)
This page purports to track DRM-removal tools for audio files, though at this date (2009-03) it hasn't been updated since December 2007: http://askbobrankin.com/drm_removal.html
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.)
Note one dire disadvantage of using iTunes (on any OS) to
manage Apple iPods: It considers each iPod tied to iTunes's
(undocumented, proprietary) "library" (set of downloaded sound
files, or iTunesDB, which gets maintained in both the iTunes
application's own files and on the iPod if any), and therefore
will wipe out any sound files installed into the iPod by other
means (absent measures to also add a record of the sound files
into the iTunes library, overcoming Apple's occasional changes
to library file formats such as adding SHA1 hashes aka
checksums in late 2007, and causing iTunes to report that the
iPod has zero tracks if the checksums don't match -- which
feature was reverse-engineered two days later, but that sort of
thing can happen again). Sticking to iTunes-alternative
applications (below) to manage one's iPods eliminates this
entire class of problem.
http://wine-review.blogspot.com/2007/10/itunes-73-on-linux-with-wine.html (running the iTunes app on WINE)
http://www.boingboing.net/2007/09/14/new-ipods-reengineer.html (SHA1 hashing added to iTunesDB)
http://www.codeweavers.com/compatibility/browse/name/?app_id=974 (CrossOver Linux's iPod support)
http://amarok.kde.org/blog/archives/496-iPod-Classic-Will-Be-Supported.html (Amarok developer reverse-engineers iTunesDB hashing)
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
SharpMusique
SharpMusique by Jon Lech Johansen (in C#), based on PyMusique
(in Python) by Travis Watkins, Jon Lech Johansen, and Cody
Brocious, lets Linux users buy AAC files from iTMS, and
on-the-fly strips the Veridisc FairPlay encryption present on
most iTMS AAC files (.m4p = encrypted AAC). However, it ceased
to be maintained after v. 1.0 in Sept. 2005, and changes at
iTMS broke it in mid-2006.
http://nanocr.eu/2005/09/17/sharpmusique-10/ (thread with download links)
http://www.forbes.com/2005/03/28/cx_ah_0328tentech.html (story)
http://en.wikipedia.org/wiki/SharpMusique (SharpMusique explanation)
http://www.engadget.com/2005/03/29/pymusique-creator-says-it-was-all-about-getting-linux-for/ (article explaining PyMusique's context)
2. iPod Access:
This file does not yet fully cover Linux access to Apple iPods (the other major use of the iTunes application), but here are seven Linux apps that do that well:
- Amarok, http://amarok.kde.org/
- Banshee, http://www.banshee-project.org/
- Gtkpod, http://www.gtkpod.org/
- Rhythmbox, http://www.gnome.org/projects/rhythmbox/
- Nightingale, http://getnightingale.org/
- Songbird, http://www.songbirdnest.com/
- YamiPod, http://www.yamipod.com/
Comparison of six of the above: http://techlogg.com/content/view/371/40/
Others:
- Dopi, http://www.snorp.net/log/dopi/, is similar to Gtkpod.
- Exaile, http://www.exaile.org/, is a music player similar to Amarok but for GTK+ and written in Python.
- FUSEpod, http://sourceforge.net/projects/fusepod/, uses the Linux kernel's Filesystem User Space Environment (FUSE) hooks to present any iPod's iTunesDB library as if it were a mounted filesystem (currently read-only a/o 2008-01).
- Kpod, http://sourceforge.net/projects/kpod/, is a KDE "ioslave" widget to allow KDE-aware apps such as Konqueror or Amarok to access stored music on iPods.
- Podtool, http://www.cactii.net/~bb/, is a Python utility to manage tracks between local music repositories and iPods, maintaining correct playcount and ratings synchronisation for playlists' benefit.
- Whale, http://florian.structbench.com/displayProject.php?name=21+Whale, is a simple tool to create playlists and store songs on iPods, under Linux.
- Listen Media Player, http://www.listen-project.org/, is a music player and DAAP client only; no iPod access.
- Lsongs, http://www.lsongs.com/, is a music player and DAAP client only; no iPod access.
- Xmms, http://www.xmms.org/ is an established, capable, highly extensible music player. Current 1.x series has no DAAP or iPod support, but upcoming XMMS2 will do DAAP: http://wiki.xmms2.xmms.se/index.php/SoC:DAAP
3. Streaming Servers for iTunes and compatible clients, using Digital Audio Access Protocol (DAAP):
(1) Firefly, formerly mt-daapd, is an open source digital
audio server that can stream your sound library to iTunes. (2)
daapd scans a directory for sound files (mp3, aac,
uncompressed) and makes them available via the Apple
proprietary protocol DAAP. DAAP clients can browse the
directory and retrieve individual files, either by streaming or
by downloading them. (3) Get It Together (GIT) is a Java DAAP
client/server backed up by an XML-based sound library and the
ability to access songs from iTunes/iPod sound libraries. Based
off of AppleRecords and One2OhMyGod. (4) Tangerine is an
application that allows you to publish sound files over the
local network, using DAAP. It runs on Linux, Windows, and Mac
OS X.
http://www.fireflymediaserver.org/ (Firefly Media Server)
http://sourceforge.net/projects/mt-daapd (Firefly devel. site)
http://www.deleet.de/projekte/daap/ (daapd)
http://getittogether.sourceforge.net/ (Get It Together)
http://www.snorp.net/log/tangerine/ (Tangerine)
http://www.macosxhints.com/article.php?story=20030711140157143 (Firefly article)
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/
5. Extra Credit Essay:
"When Pigs Fly: The Death of Oink, the Birth of Dissent, and a Brief History of Record Industry Suicide", http://www.demonbaby.com/blog/2007/10/when-pigs-fly-death-of-oink-birth-of.html. (Like him or hate him, Rob "demonbaby" Sheridan is telling the truth.)