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

Posted by Dave on January 15th, 2007

I’ve been investigating 5.1 Dolby 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 AppleTV 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 Mac Mini, 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 AC-3 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 :-)

Technorati Tags: , , ,



Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

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!

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.

No problem! I’m surprised it hasn’t been mentioned anywhere else, tbh. I also await the results with interest :)

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

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.

Excellent article, this info is hard to find elsewhere and confusing when you do.

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.

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.

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.

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.

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…

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???

Good post. I am gonna buy Mac Mini to use it as HTPC. And i want to connect it to my video receiver through S/PDIF.

There is example, how to stream encode audio via optical out. http://macaudiopro.digitalmedianet.com/articles/viewarticle.jsp?id=69934
May be this one can help you?

finally here !!!!! firewave will do 5.1 audio for mac finaly!!!

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 )

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

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 :-(

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!

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.

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.

[…] No. And yes. In that order. This article gives the full detail behind what that really means. A little while back, I posted an article discussing the possibilities for the Apple TV supporting 5.1 audio playback. It’s well worth reading that article first, as it talks a little bit about what “5.1 playback” actually means. Now that the Apple TV is available, and I’ve been able to run some tests, I’ve been able to see what it can and can’t do. It’s a mixed bag of news; not as good as expected, and a little surprising, too. […]

Now that the Apple TV is available, I’ve posted a follow-up article with my latest set of findings:

http://www.thismuchiknow.co.uk/?p=34

Dave.

[…] This Much I Know - » 5.1 surround sound playback on Mac (and maybe Apple TV) (tags: macmini sound) […]