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:

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 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. (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. (JHymn, currently non-useful a/o 2008-01) (Historical details) (HYMN project nature and history) (MyFairTunes6, QTFairUse6) and, in particular, (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 (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. (iTMS_Client) (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) (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:

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. (running the iTunes app on WINE) (SHA1 hashing added to iTunesDB) (CrossOver Linux's iPod support) (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.

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. (thread with download links) (story) (SharpMusique explanation) (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:

Comparison of six of the above:


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. (Firefly Media Server) (Firefly devel. site) (daapd) (Get It Together) (Tangerine) (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. (Apple lock-in introduced with iTunes 7.x) (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.)

5. Extra Credit Essay:

"When Pigs Fly: The Death of Oink, the Birth of Dissent, and a Brief History of Record Industry Suicide", (Like him or hate him, Rob "demonbaby" Sheridan is telling the truth.)