5.1 surround sound playback on Mac (and maybe Apple TV)

I’ve been investigating 5.1 [tag]Dolby[/tag] Digital playback on the Mac, and I’ve discovered some limitations with using 5.1 audio under QuickTime – especially when trying to output it to the Mac’s S/PDIF optical output. This makes me wonder about some not-yet-mentioned features of the upcoming [tag]AppleTV[/tag] and its support for surround sound, and Apple’s approach of using 6-channel AAC audio instead of AC-3.

First up, a bit about AC-3, also known as Dolby Digital or A52. AC-3 is Dolby’s way of encoding several channels of audio into a stream which can be passed down an optical S/PDIF cable, and decoded at the other end by a suitable decoder (i.e. your surround sound amp). AC-3 is the format used for 5.1 Dolby Digital surround sound on DVDs. It has five channels for normal-range speakers: Center, Left Front, Right Front, Left Surround, and Right Surround. The extra “.1″ is a Low Frequency Effects (LFE) channel for a subwoofer. Dolby Digital isn’t limited to 5.1 – but this is the most common use you’ll find.

Now, all new Macs come with some form of optical S/PDIF output – either a combined optical digital output/headphone out (minijack) for the MacBook, MacBook Pro, iMac and [tag]Mac Mini[/tag], or a dedicated optical output on the Mac Pro. So, you’d think that playing 5.1 sound would just be a case of connecting the optical output of your Mac to the optical input of your 5.1-savvy amp. Not so.

Thing is, that optical output doesn’t appear as a six-channel output device on your Mac. In order to send six channels down the optical wire, it has to be encoded into a supported stream such as AC-3. The maximum number of discrete (unencoded) channels you can send via the optical output is two channels, and that’s all you’ll get if you play a movie on a Mac with the optical wire plugged into your stereo, rather than the six channels you might expect

QuickTime doesn’t come with an [tag]AC-3[/tag] codec by default. There is an open-source QuickTime component available, called A52Codec, which enables QuickTime to open, import and export AC-3 audio. (It does this using a free AC-3 library called liba52.) A52Codec provides some form of support for working with AC-3 under QuickTime, at least for file conversion and export. What the A52Codec can’t do, however, is to enable applications to stream encoded AC-3 data straight to the optical output on the Mac.

Apple’s DVD Player application – included for free on every Mac – can play the 5.1 AC-3 audio from a physical DVD directly through the optical output of your Mac. DVD Player does this by streaming the encoded AC-3 straight from the DVD to the optical out, bypassing QuickTime. Some other players – notably VLC (which also uses liba52) – will stream AC-3 straight to your optical output, too. But any application which uses QuickTime for its audio playback – and this includes Front Row, iTunes, and QuickTime Player – works by first decoding audio into its discrete channels, before outputting it to your system audio device. The AC-3 encoding is lost in the process. So if you want a Mac Mini and Front Row to run your home theatre, with 5.1 sound from third-party movie files, then it’s not so easy.

What does this all mean? It means that right now, the only way to play multichannel audio (from a .mov file or .mp4 file) on a Mac is to buy a six-channel sound card – something like the Gigaport AG – and set this up in Audio MIDI Setup to support 5.1 sound. You then need to plug the six discrete outputs into an amp with six discrete inputs. You also need to install A52Codec if your source file has an AC-3 soundtrack. Which means that very, very few people will bother to do so.

However, here’s where it gets interesting. For some time now, Apple has been distributing its HD movie trailers with 5.1 audio. But not as an encoded AC-3 audio track – as after all, neither QuickTime player, iTunes, nor FrontRow can play those as mentioned above. Instead, Apple’s trailers come with an AAC-format soundtrack containing six discrete channels, matching the 5.1 channels mentioned above.

Why would Apple bother to ship 5.1 audio, if it’s very hard for most Mac users to play it? This is just a guess, but I think the reason is called Apple TV.

The Apple TV comes with an optical output on the back. This pretty much guarantees that it will somehow output Dolby Digital 5.1 through the optical port. It’s just a hunch, but I’d guess that the Apple TV will have a built-in AC-3 encoder, which will take the six channels from an Apple trailer or movie and encode this into an AC-3 stream on the fly.

So why not just ship these files with an AC-3 soundtrack from the off? This is where I think Apple are being clever. QuickTime 7 is very good at converting between different channel mappings. So, it’s perfectly set up to downmix the six AAC channels into a stereo mix for the average Mac user. The same file, synced to an Apple TV, would then have its six channels encoded into a 5.1 AC-3 stream, to be played through the AppleTV’s optical output to an appropriate amp. This maintains the iPod-like syncing with iTunes, in a file format which iTunes, QuickTime, Front Row and Apple TV can all support. It also means that Apple can pay for a Dolby encoder license as part of each Apple TV sale, without needing to fork out for an encoder license for every QuickTime user in the world.

I might be wrong, and a future version of QuickTime could also include an AC-3 encoder, which would mean Mac owners could benefit from 5.1 optical output too. But it seems more likely that 5.1 is going to be one of the selling points of the Apple TV.

So for now, we’re going to follow Apple’s lead, and make our multichannel movies with six AAC channels too :-)

42 thoughts on “5.1 surround sound playback on Mac (and maybe Apple TV)

  1. I think you are onto something, and you’re the first I’ve heard talking about it. No confirmation on Apple’s site one way or the other.

    I ordered mine, so soon I’ll know for sure!

  2. I usually don’t wirte stuff, but… I’m impressed. I’ll be waiting to know about the conclusions, but I have to admit they seem to follow. Amazing, I ‘googled’ for the codec link, but found a decent blog – one that has some thought, and more importantly, some research.
    Thanks.

  3. Like Orion, I don’t normally write comments. But well done! This is very succinctly put.

    I have been trying to encode files with 5.1 (AC-3) to be played back with Front Row/QuickTime, but I will probably revert back to Front Row/DVDAssist until Apple get their finger out.

    Again, thanks for a very informative note.

    Thanks

  4. This is great information. Thank you! It confirms what I thought was happening.

    I don’t understand why 5.1 functionality is not included in QuickTime Pro. Apple would have the revenue to pay the license this way. I would buy QuickTime Pro just for 5.1 audio.

  5. Great article. You may be right about appleTV transcoding(?) 6-channel AAC to AC-3. If so, I would hope this comes with a Quicktime update from Apple that gives mini owners the same capability. It would be unfortunate for the lower-priced appleTV to sport this functionality but not the mini.

  6. Well, this is a bit distressing, especially as I’ve just ordered a Mini to work with my EyeTV 500.

    if you want a Mac Mini and Front Row to run your home theatre, with 5.1 sound from third-party movie files, then it’s not so easy.

    Let me see if I understand. We’re talking about movies ripped from DVDs, or (il?)legally downloaded from the net? I’m not sure I really get why else playback from movie files would be a big deal, unless you’re talking about playing those 5.1 movie trailers.

    The vast majority (in my experience) of TV torrents are still stereo. And if the DVD Player in OS X can pass through the 5.1 to the optical port, then that’s all I care about.

    Great info, btw.

  7. This is something we’re looking into at the moment… we have the ability to develop video, animations and spacial adio exhibits using 5.1 channel output but would like to take advantage of playback on G5/Macs. As far as we knew there was no such output directly from the Mac with only a few hardware options pop up – firewire system from Griffin Technology, PCI audio boards. Will be interested to see how this functionality plays into the new software/hardware coming out of AppleTV.

  8. To answer my own thoughts/questions in comment #8 above — yes.

    After playing much with my Mini and EyeTV, all audio is only stereo. DVD pass-through audio is 5.1, and that’s good enough for me.

  9. Thanks for the easily digestible and informative information. I’m upgrading and want to use my mac book pro to play dvd movies along with my AV receiver with 5.1 sound until the blue ray/hd dvd thing pans out and the prices come down.
    I am also trying to find out if I could play a dvd in my mac and stream it to my tv via appleTV. So far, it looks like it cannot be done…

  10. Firstly, great website – very useful.
    Secondly, you mention in this article the DVD Player will output 5.1 (AC-3 encoded) directly to the optical output.
    I have an optical cable connecting my MacBook Pro to my LG plasma and then onto my Yamaha 5.1 (actually 7.1 but I’m missing 2 speakers).
    The best I ever get though is Pro-logic.
    Am I missing something???

  11. Elgato EyeTV 500 does stream HDTV broadcasts with 5.1 dolby digital audio to the surround sound amplifier via the optical output on a mac. So there is obviously a way as Elgato has figured out how to do it. Maybe they used the A52Codec varient to do it ? I will say there have been a handful of times it would stop working but a reboot would fix it.

    btw: ( I have a dual 2ghz G5 mac and EyeTV 500 )

  12. doh ! It always pays to read the entire article before posting a comment. Sorry for my previous post. Basically, Dave explained why EyeTV can stream dolby digital 5.1 in realtime while Quicktime does not. Regardless, I think Dave has it correct that Apple TV will be able to encode 6 channels AAC to AC3 for output otherwise the optical output on AppleTV would be largely useless.

    Jake

  13. Correct me if I’m wrong, but could Apple be avoiding advertising AC-3 for licensing fees? If they use their own technology couldn’t they then by-pass paying royalties to Dolby Labs? By the way, this comment bar doesn’t work well with Firefox :-(

  14. Well, I’m starting to change my mind about my original article. QuickTime 7.1.5 has an “Export to Apple TV” option, which mixes a 5.1 AAC track down to a stereo AAC track. This doesn’t categorically say that Apple TV *can’t* play 5.1 AAC – but it suggests that it might be reserved for Apple-provided content, e.g. from the iTunes Store. Apple TVs have apparently started shipping, so we shall see!

  15. Thank you, Digitalclips, for posting a link to this site. This article was very interesting and informative. I do hope there is an option in the future for AppleTV to play 5.1 sound not just from movies/TV shows bought from the iTunes Store.

  16. This is a great write-up, Dave, thanks. Finally some sense about all this. Please do investigate further, I’m sure everyone would love to see what can be done now that Apple TV has been unleashed.

  17. Pingback: This Much I Know - » So does the Apple TV support 5.1 audio?

  18. Pingback: JEDI » Blog Archive » links for 2007-06-27

  19. anyone know if I can achieve 5.1 when playing hd dvd’s? I have a macbook, focusrite saffire, digital 5.1 reciever, hdtv and minidvi to hdmi. I think the spdif on the saffire is only stereo. Lame.

    • I have the Saffire Pro40 (Mac Pro, Lion), and have tried to get AC-3 output with no complete success so far. I’ve tried both the optical toslink and S/PDIF outputs. Focusrite’s Mixcontrol software has a setting where you can select “Use S/PDIF for AC-3 Output” (ie have it send a Dolby Digital Surround signal), and got some interesting results when playing a surround speaker testing track in VLC player. Using the S/PDIF connection to my surround decoder, I got different results based on the setting. When set to non AC-3 mode, I got a stereo signal in which all the speakers played indiscriminately. After activating AC-3 mode, I got the left and right front speakers playing only their proper surround channels, but the rest of the speakers were dead silent. This leads me to believe that it’s still a Mac issue, and not a sound card problem.

  20. Thanks, you have provided an excellent summary of exactly what I have been trying to figure out when nobody else seems to care.

  21. thanks for a great article, I was searching for this info in pursuit of buying an AppleTV. I got everything I needed to know here. thanks

  22. Does iTunes support 5.1 audio? I’m not sure I totally understood the article, but did you say a 5.1 receiver won’t convert the signal from the Mac into dolby digital, or 5.1 if it has the built in processor in the receiver? (From what I gathered the answer is no, but I hope I’m wrong.)

    I know on my PC sound card I have to disable the processor in order to get correct sound from my speakers since I can’t disable the processor in the receiver to my speakers.

  23. Type your comment here.I have a MacPro and I want to play a DVD and output the 6 discretes digital audio channels for my speakers. Is it possible? If not, how can I have the 6 discretes digital audio channels?

  24. There is perhaps another way?

    Doesn’t HDMI support multichannel PCM (uncompressed) audio? Isn’t it therefore likely/ possible that all the ATV has to do is to decode the 5.1AAC, and output the stream straight on to the HDMI cable?

  25. Pingback: HDTV, Blue-ray, HD DVD, HDV, PVR, TV & Macs at bioneural.net

  26. First off, I echo the comments on the clarity of the article.
    Secondly, thanks to Chooh for the link to macaudiopro.
    Having not got around to connecting the surround speakers to my amp, I didn’t realise that my hard disc collection of DVDs were not outputting in D5.1
    After changing the midi properties to Encoded Audio, the amp is lighting up as designed. Cheers.
    If I can just get rid of the frame judder in Front Row, I’ll be very happy with my Intel mini’s performance as a home theatre system. If anyone has any idea why FR produces the judder while DVD player doesn’t, I’d be happy to hear.

  27. Pingback: Surround Sound 5.1 - MacTalk Forums

  28. Pingback: Playing 5.1 audio from a MacBook | Tongfamily.com

  29. Pingback: muistiinpanoja ja muutamia ajatuksia. » Apple 5.1

  30. Pingback: usb to 3.5mm set - Mac-Forums.com

  31. Hi there,

    seems like you got off on the wrong foot there. I realize that your post is from 2007, but my MacBook actually is built 2006, so what I say still applies to your posts.
    I certainly struggled the get a52 (6 channel sound) working on my MB whilst being connected via Toslink to my Harman&Kardon HK 3490, but I got it working. The magic can be done from within VLC – when being started only once with “–force-dolby-surround” on the commandline, it changes the system settings(which I unfortunately coulnd’t find anywhere else in OSX..). After that it works like a charm, not only in VLC.

    Greets,
    Alain

  32. Pingback: HDTV, Blue-ray, HD DVD, HDV, PVR, TV & Macs | bioneural.net

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>