Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Music Businesses Media Apple

Opensource Apple Lossless Decoder Released 294

Cody Brocious writes "David Hammerton has released version 1.0 of an ALAC decoder. This allows users of operating systems not supported by iTunes/QuickTime to listen to their Apple Lossless files, a proprietary competitor to FLAC. This is a large leap forward in audio codec interoperability, and paves the way for an ALAC encoder." The site also asks for additional help on the project.
This discussion has been archived. No new comments can be posted.

Opensource Apple Lossless Decoder Released

Comments Filter:
  • by winstonmeister ( 863683 ) on Saturday March 05, 2005 @04:39PM (#11854445)
    ...but I just don't see why Apple felt it was necessary to make another lossless format. While Apple in the past has been accused of often suffering from NIH (Not Invented Here) syndrome, it seemed like they were improving in this area: the iMac helped popularize USB, the open-source core of OS X has its roots in BSD, iTunes supports MP3s, their web browser gives source back to Konquerer, etc. Anyone have any theories as to why they didn't just use FLAC? After all, the work was already done for them...
    • by SuperQ ( 431 ) *
      According to an article by a developer of the Rio Karma, they needed something that could be decoded by the iPod's CPU.

      The Rev 1-3 iPods have a smaller CPU cache than the Rio Karma, or the iPod Rev 4 and the iPod Mini. The preformance hit for accessing memory while decoding is too great, so you must fit the decoder in the cache.

      ALAC was designed for the simple reason that it has a smaller decoder on the iPod than FLAC.

      Same reason why OGG can't be used on iPod Rev 1-3. (and for consistancy, not on the o
      • by crazney ( 194622 ) on Saturday March 05, 2005 @04:51PM (#11854550) Homepage Journal
        I don't really believe that. As I mention on the web page, ALAC is very similar to FLAC - however it is slightly more complicated, not less. It requires more CPU power to decode ALAC than it does to decode FLAC. That said, it should generally have a better rate of compression.
        • So, I have to ask a question, having looked at your site.

          Why bother with reverse engineering ALAC? So far, I have seen / read mention of only one major useful thing that has been learned: ALAC uses adaptive compression algorithms.

          You state on your site that you don't like being locked into restrictive DRM formats. So, don't allow yourself to get locked into it. Don't support it.

          Given the information you have gathered about the format, it seems to me that it would be far more productive to join the FLA
          • So, what does ALAC have to do with DRM? Hmm?
          • adding adaptive compression to FLAC

            In what way is FLAC's compression not adaptive?
          • AirTunes. (Score:3, Interesting)

            by Yaztromo ( 655250 )

            Why bother with reverse engineering ALAC? So far, I have seen / read mention of only one major useful thing that has been learned: ALAC uses adaptive compression algorithms.

            One possible reason would be in order to stream to an AirPort Express with AirTunes. AirTunes uses a standard streaming protocol (RTSP), but streams the data in Apple Lossless format. Because of this, you currently require either a Mac OS X or Windows XP machine running iTunes to steam audio to the AirPort Express.

            Being able to st

        • ALAC is based on, and for all I know is just a straightforward implementation of, the MPEG-4 lossless audio codec. And Apple is a pretty big supporter MPEG-4, so it's not surprising they would use it. (The MPEG-4 lossless codec is in turn based on something called LPAC.)

          Now, this is pure speculation, but I think one of the reasons why large companies avoid open source codecs like FLAC or Xvid is that they are afraid of getting sued. In today's everything-is-patented world, many open source codecs out ther

          • by cbrocious ( 764766 ) on Saturday March 05, 2005 @06:36PM (#11855178) Homepage
            You're very, very far off.

            ALAC has absolutely nothing to do with the MPEG-4 lossless encoding. (I should know, as I worked on the decoder as well. See the authors list on the site)
            This is a common misconception that having an opensource decoder (and encoder soon... I have a prototype already) will hopefully fix.
        • by Anonymous Coward on Saturday March 05, 2005 @06:04PM (#11854960)
          I don't really believe that. As I mention on the web page, ALAC is very similar to FLAC - however it is slightly more complicated, not less. It requires more CPU power to decode ALAC than it does to decode FLAC. That said, it should generally have a better rate of compression.
          Huh? Comparison tests have found that ALAC compression is, on average, slightly worse than FLAC.

          http://members.home.nl/w.speek/comparison.htm [members.home.nl]
          http://flac.sourceforge.net/comparison.html [sourceforge.net]

        • Optimizing at a level that low is counter-intuitive. An algorithm that's more "complicated" might take up less memory or have a more favorable memory access pattern. For example, and I have no idea of the difference between FLAC and ALAC so this is just an example, if a more complicated algorithm has a larger number of stages but they all fit in cache when they're running, it could easily perform better.

          For example, Google for "AlphaSort". Basically, they made a mutli-phase sort where the initial stage fit
      • by damiam ( 409504 ) on Saturday March 05, 2005 @05:06PM (#11854619)
        Same reason why OGG can't be used on iPod Rev 1-3

        I wouldn't say that quite so authoritatively. At the moment, the reason Vorbis can't be played on the ipod is because no one's put much effort into optimizing the decoder. It may be that it's impossible, but I've heard several Vorbis and iPodLinux developers say they think the iPod has the potential to play Vorbis, albeit maybe with reduced battery life.

        • Two 70 MHz ARM cores. Yeah, should be more than three times the horsepower needed. Reportedly, Tremor can function in as slow as a single 40 MHz core.

          Of course, I don't know if the cores are symmetric, and I think the iPod Linux stuff only supports the primary core, so in its current state, no, it probably isn't possible....

          At least conceptually, to get decent performance you want to do something like the following:

          1. Set up a worker thread on the main core (under Linux or whatever) that fetches block
    • Could be because the author of FLAC used to brag about how FLAC losslessly encoded all DRM into zero bits. Maybe Apple felt like it needed it's own format to "protect" the connection to AirportExpress and whatever else they have up their sleeve. Maybe it's because people at Apple are somewhat isolated in an Ivory Tower and weren't aware of FLAC. Maybe they looked at flac and decided it wasn't going anywhere. Maybe they flipped a coin.
      • The DRM is added in the transport layer... the audio encoding algorithm itself has no concept of DRM. DRM can be added to FLAC in an OGG container, just as it is added to ALAC in a QuickTime container.

        ALAC probably exists because of an algorithmic or patent-related reason.
    • by gl4ss ( 559668 ) on Saturday March 05, 2005 @04:49PM (#11854529) Homepage Journal
      there's a better reason than the already mentioned ipod cpu..

      now it's their format - possibly with a compression scheme they got a patent going for, so they own it.

      why did sony keep insisting on atrac so long? because it was their format, their control. if it had made it big then they could have cashed on it.

      true, itunes supports mp3's and ipods do as well - but they have to, nobody would have used them otherwise.
      • by mcc ( 14761 )
        Sony freaks out on their formats because they actually have some kind of power they can gain from those formats. They have an agenda. For example they wanted to turn ATRAC or Minidisc or whatever into a distribution format, one that other people used but that they controlled. They wanted to supplant mp3 and then leverage this to pressure people into using other Sony products. They wanted to control distribution.

        But ALAC isn't even intended or positioned for distribution. There's no power in it. ALACs are c
        • *But ALAC isn't even intended or positioned for distribution. There's no power in it. ALACs are created in iTunes and ripped from CDs you own, and they're intended to be played back in iTunes and copied to your own personal iPod. Going through the particularly obvious or convenient interface paths in iTunes, there's no reason that once someone creates an ALAC file that ALAC would ever pass into the possession of anyone except them. Apple seems to be almost resisting the idea people could start distributing
        • They are probably positioning themselves to be able to sell lossless encodings through itunes. Once they are selling these expect the output mp3 feature to disappear.
    • by mrchaotica ( 681592 ) on Saturday March 05, 2005 @04:51PM (#11854548)
      In addition to SuperQ's answer regarding the iPod, they needed a codec that could be encoded in realtime, to work with the Airport Express. FLAC is significantly smaller, but it takes significantly longer to encode so it wasn't suitable for their purpose.
      • Huh? I could encode flac at over 15x realtime on my old Athlon 900.
        • Dude (Score:3, Funny)

          by Anonymous Coward
          The Airport Express is a router. I don't think it has an Athlon 900
    • They needed cheap transcoding to a lossless format for the AirPort Express. Read the streaming sound section of this article [macdevcenter.com].
  • Yes but... (Score:5, Interesting)

    by FiReaNGeL ( 312636 ) <`moc.liamtoh' `ta' `l3gnaerif'> on Saturday March 05, 2005 @04:39PM (#11854454) Homepage
    Will he get sued? Proprietary format... Apple... Lawsuits...

    Also, considering that "Apple never released any documents on the format", its incredible that this guy wrote a decoder. Some people are truly amazing sometimes...
    • Honest answer (Score:5, Informative)

      by mcc ( 14761 ) <amcclure@purdue.edu> on Saturday March 05, 2005 @06:47PM (#11855261) Homepage
      Nah. "Proprietary format" just means "the real world doesn't know how to decode it yet". There isn't some inherent right for proprietary formats to remain proprietary.

      There are only a handful of ways a proprietary format can remain proprietary:
      1. License agreements. This is the most common one, and almost certainly Apple is using this one. The idea is that if you give someone a document describing how your formats work you say "if you don't agree to use this information only in certain ways you can't have it", or if you give someone a decoder for the format you say "if you don't agree not to take apart this decoder and see how it works you can't have it". I'd guess the iTunes clickthrough agreement says something like the latter. But this is sort of the entire idea of cleanroom reverse engineering; license agreements like those on iTunes really are no hindrance whatsoever to a reverse engineer, so long as they choose to do that reverse engineering in a way that doesn't violate the license agreement. And that's not really that hard. Pretty much just don't use a disassembler and you're fine.
      2. Patents. I'm pretty sure this one really doesn't work. As far as I am aware-- I can't find an explicit cite for this in a brief google search, maybe someone else can give us one-- reverse engineered implementations created for purposes of compatibility can provide protection against patent claims. Since "formats" and "compatibility" are almost the same word, this makes it often implausible to use patents as a block on unauthorized use or interpretation of a format, such as an audio codec or a video game API. Apple probably has some sort of patent on ALAC-- like all research-oriented commercial software developers, they patent absolutely everything they do-- but I've never known Apple to use patents in this exact fashion and as far as I can tell their success would be incredibly questionable even if they tried. I'd ask the guy who reverse engineered the decoder to look through apple's entries in the USPTO database to see if he can find anything that might refer to ALAC, but he really shouldn't, since hilariously you're safer from patent damage claims if you culture a state of blissful ignorance as to what patents exist out there.
      3. The Digital Millennium Copyright Act. This one is scary, as it grants powers which are essentially stronger than copyrights or patents to anyone who can construe what they do as involving in some way "DRM". The DMCA seems to assert that "mechanisms which effectively control access to a copyrighted work" have some sort of inherent right to remain unbroken. This seems to imply people with proprietary formats do have a right to keep them proprietary so long as they can pretend there's "DRM" in it. However there's a few problems here. It has been questioned whether the nature and implementation of the law is enforceable against a serious challenge, and some uses of the law-- for example putting some kind of "DRM" in a printer cartridge and then using the DMCA to shut down anyone who makes compatible printer cartridges-- have already been smacked down by the courts. Apple has already used the DMCA to keep down software which removes the "DRM" from iTunes Music Store purchases, though the best they can do is force that software to use hosting providers outside the U.S.. But, well, even though the law is wrong, that's actually sort of exactly what the letter and intent of the law are intended to do-- protect things like Fairplay. But attacking unauthorized use of ALAC would follow neither. Attempting to claim ALAC is covered by the DMCA is simply laughable; as has been observed elsewhere in this discussion, it is not and does not contain "DRM" and it provides no limitations on the flow of copyrighted material whatsoever.
      4. Technical barriers. The idea here is, as Microsoft does with SMB or Word, you design your format in such a way as to naturally resist reverse engineering. This is sort of a moot point with ALAC. The decoder's alre
      • Actually, SMB was originally a standard, but MS decided to "embrace" it, and we all know how that goes.

        Also, I don't really understand what you mean by saying that once something is decodeable it is an open standard. If this were the case, no one would've been sued over the DeCSS stuff.
  • Small correction (Score:5, Informative)

    by bajo77 ( 632115 ) on Saturday March 05, 2005 @04:40PM (#11854459)
    This initial release is version is 0.1, not 1.0
  • by gl4ss ( 559668 ) on Saturday March 05, 2005 @04:40PM (#11854465) Homepage Journal
    gif-like, could i use it in a real project?

  • Stream Ripping? (Score:4, Interesting)

    by CtrlPhreak ( 226872 ) on Saturday March 05, 2005 @04:41PM (#11854470) Homepage
    As I understand it, all the wireless Airport express streams use apple lossless codecs. How long before we can have a program to intercept these wireless music streams and then convert to mp3s or whatever you want? Pretty crappy way of getting music, slow etc the more I think about it, but why not?
    • Re:Stream Ripping? (Score:5, Informative)

      by crazney ( 194622 ) on Saturday March 05, 2005 @04:44PM (#11854495) Homepage Journal
      Hey,

      I'm the author of the decoder in quesiton.

      I originally started doing the decoder so I could have my own little Airport Express emulator.

      However, Apple have (for once) secured their system pretty well, and I have been unable to break their encryption so far. I know exactly what I need to do, and I'm fairly confident that I'll be able to do it... But first I actually need to get one of these devices. [craz.net]

      So yeah, It's certinately on the table. Shouldn't be too far off.
    • The real question is can this be used to stream *to* the Airport Express from any arbitrary program?
  • by maynard ( 3337 ) on Saturday March 05, 2005 @04:47PM (#11854522) Journal
    Because Apple is the New Microsoft [slashdot.org]. They use courts to squelch free speech rights of those who would impart Apple trade secrets to the public; they legally commit restraint of trade by mixing proprietary hardware with proprietary software so competitors can't break into their non-monopoly markets with alternative products; and they don't give all their code away for free, but instead select to give away or hold secret that which maximizes profit for their shareholders. Evil bastards! *cough!* --M
    • wait..so you mean they're a company thats for profit?
    • " Because Apple is the New Microsoft. They use courts to squelch free speech rights of those who would impart Apple trade secrets to the public; they legally commit restraint of trade by mixing proprietary hardware with proprietary software so competitors can't break into their non-monopoly markets with alternative products; and they don't give all their code away for free, but instead select to give away or hold secret that which maximizes profit for their shareholders. Evil bastards! *cough!* --M"

      Nice sp
  • by KingOfTheNerds ( 706852 ) on Saturday March 05, 2005 @04:54PM (#11854566) Homepage
    We used ALAC all the time at the studio where I worked, but alas, some of our software was linux only and would not compile under OS X. This was very frustrating and required multiple computers. Finally with this system we can move over to this software as a solution. I love linux and would rather use it, but of the people I work with don't want to learn it claiming that it is more complex. Anyway, thats great that we can do the job with ALAC decoder! I'm sure other studios forced to use ALAC will be very happy with all of this.
  • Gstreamer + iTMS (Score:3, Interesting)

    by Goalie_Ca ( 584234 ) on Saturday March 05, 2005 @05:09PM (#11854640)
    If you're a gnome user you should probably check up on Planet Gnome [gnome.org]. Here's one blog [advogato.org] in particular that may be of interrest.
  • Download & Changelog:

    * 0.1.0 - March 5, 2005: Initial release. Download Now!
    MD5: f554fc11ee41a30bc5baf15a0fd07256

    Confusing 1.0 with 0.1.0 - way to go, editors! Would like to write more, but gone compiling new 6.11 Linux kernel.
  • Nice. (Score:3, Interesting)

    by theparanoidcynic ( 705438 ) on Saturday March 05, 2005 @05:31PM (#11854758)
    I was just thinking this morning how nice it would be if both my iPod and my Linux boxen supported a lossless format besides uncompressed PCM, and here's the solution.

    Desire warping reality? Nah, if my desires warped reality I wouldn't be quite as single. ;)

    Regardless, my compliments on a superb piece of hacking. As near as I can tell the thing works perfectly, and only a few months after Apple released the format.

    I assume that somebody will whip up an XMMS plugin based on the library and/or get it into Mplayer's CVS over the next week or so, but even being able to do "alac file | aplay" is a great improvement in functionality for me.
  • by Foolomon ( 855512 ) on Saturday March 05, 2005 @05:49PM (#11854874) Homepage
    ...they combine the two formats to get the AFLAC format. "It's the format with additional benefits!"
  • by stephenisu ( 580105 ) on Saturday March 05, 2005 @05:59PM (#11854915)
    When you have many embedded devices to program for, it is convenient to have control over the future of the CODEC you are using.

    While FLAC is great, Apple has no controll over what direction FLAC takes.
  • by John Fulmer ( 5840 ) on Saturday March 05, 2005 @06:54PM (#11855294)
    Hmph. I moved to a Mac mini a few weeks ago, and decided that I would finish up ripping all my CD's. Up to then, they had all been ripped as flac, and I was converting from flac -> ogg as necessary.

    Now, with iTunes on my main PC and my wife's laptop, i thought 'Wouldn't it be great if we could use a daap server and stream all our music?' So, I thought I would use iTunes to rip the rest of my cd's, and maybe convert my current flac files to ALAC. Then I could convert to ogg, and SURELY i could stream those.

    That's when the drums of doom started playing.

    First, I found that iTunes couldn't handle streaming off files. The Quicktime ogg plugin works okay for playing off the local hard drive, but no nice streaming from my daap server.

    No problem, I'll convert to AAC and stream those.

    (The drums started playing louder)

    Then, I found there is no way to really get iTunes to play or convert FLAC files. There's a plugin, but I can't for the life of me get it to work. And , I found there was no ALAC -> anything, so I ran the risk of being locked into a format that was non portable.

    No problem, I'll just find an opensource ripper to convert to FLAC, the to AAC.

    (The drums started playing MUCH louder)

    I started using 'abcde', a rather nifty shell script that rips and converts cd's to any of a number of formats, including FLAC. It even uses Freecddb for the track information.

    But... On OSX, the only real way to easily rip CD tracks is to copy the AIFF files that OSX presents to you when it mounts the audio CD.

    And FLAC does NOT like the particilar AIFF files OSX presents.

    (The drums are deafening)

    24 hours, a bunch of research and hacking on FLAC, I make a custom flac binaries that can handle the AIFF files. And there's the opensource 'faac' program that can convert the flac files to AAC.

    Except.... the AAC files faac creates can't be streamed or played by iTunes. Something about the MP4 headers faac generates aren't compatable.

    (THE DRUMS ARE IN MY HEAD!)

    Another 24 hours of researching, and I come up with the MPEG4IP project at Cisco, which has a nifty little program called 'mp4creator', which is designed to create or modify mp4 files. It has an '--optimize' function which modifies the headers of an existing .m4a (aac) file so something iTunes can handle.

    I threw everything into a script, and now I can rip files on my Mac mini, store them as FLAC, and then convert and play them as AAC/M4a files via iTunes.

    But Apple could have made things MUCH easier by making iTunes more open to other codecs or providing more information for others to creat iTunes codecs.

    And now I find someone has written an ALAC converter, so I could have used the ALAC format to being with.

    well THANK YOU. THANK YOU SO BLOODY MUCH!

    • I don't understand your first point at all.

      I've always been able to 'stream' my iTunes library from my desktop to my laptop; is it that your wife's computer doesn't have iTunes?
    • by Qwerpafw ( 315600 )
      I posted a simple guide on Mac Update to using the Quicktime FLAC plugin. I'm working on an Applescript to simplify the process of batch converting FLAC files into various AAC/MP4 files (without QTpro or iTunes) and still preserve the tag information, but I haven't quite ironed out the kinks (it crashes with some tag info, for some reason).

      Go to MacUpdate [macupdate.com] to download the plugin if you don't have it.

      (1) Once you've downloaded and uncompressed the file, you'll see two items in the plugin folder. One

The Tao is like a glob pattern: used but never used up. It is like the extern void: filled with infinite possibilities.

Working...