Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

How to get 5.1 audio out of AAC-surround-encoded audio System
[robg says: The following hint is presented as it was submitted. As noted in the comments by the hint's author, the introduction is misleading -- your Mac can do real surround sound, assuming the source has an AC3 soundtrack. However, what the author then goes on to describe explains how to convert certain AAC-surround-encoded files to AC3 mode for true surround playback.

I've chosen to leave the hint online, as the hint (and moreso, the comments) contain a wealth of useful information. Just take the intro to the hint with a grain of salt, as it's not the whole truth. I have also modified the title of the hint to more accurately reflect what it's about.]

Your Mac can not do real surround sound from its built-in optical audio port; in fact, not even your Apple TV can. "But Wait!" you say, "Yes it can, Apple even advertise surround sound as a feature of the Apple TV!" or "I can play a DVD and I'm hearing surround sound."

Well, the truth lies somewhere in between these two extremes. First, the Apple TV. Apple supply media to the Apple TV with one of two different options for the soundtrack. It sometimes uses a stereo soundtrack that uses Dolby ProLogic to do surround sound. This isn't "true" surround sound, it's surround information matrix-encoded into a regular two-channel audio stream, and done extremely cleverly.

Other times, and more often on the HD content, it is actually a real 5.1 surround soundtrack, but it's in AAC format. Your surround receiver probably can't decode AAC, and at any rate, the Apple TV won't send it as AAC, it decodes it, mixes it back up as a stereo soundtrack (using Dolby ProLogic) and outputs that. Either way, you're hearing Dolby ProLogic, not Dolby Digital.

Now, for the Mac. Under a certain set of circumstances, your Mac can output a surround stream from the optical output that a surround receiver can decode as proper surround -- this is if the media file you're using already contains an AC3 encoded soundtrack. AC3 is the codec that Dolby Digital uses, so if you've already got a Dolby Digital soundtrack, and your optical port is configured properly (as a digital passthrough), then you may get the AC3 stream output through the optical port, and your surround receiver decodes it. You will have real surround sound from this setup.

If you're watching media that uses, for example, an AAC-encoded multi-channel soundtrack (most of the Apple HD trailers are like this) then it will be like the Apple TV situation above -- your Mac can't send the AAC stream out the audio port, as it's only a two-channel device, so QuickTime player (or VLC or...) mixes it down to stereo and outputs this. If you're lucky, it'll be Dolby ProLogic; if you're not, it will be plain old 2.0 stereo.

Well, after a decent amount of research and tweaking, there is a solution to this problem. I wish you the best of luck getting this to work on an Apple TV, though. It works perfectly on my Mac mini, and the only downside is the manual configuration that needs to be performed.

This is going to be pretty heavy going, and it gets quite technical. If you're looking for a quick fix, you're not going to find it here; at the moment there is no easy solution. What solution there is, we can thank the author of AC3Jack (Jesse Chappell), and the authors of Jack OS X (Stephane Letz, Johnny Petrantoni and Dan Nigrin).

I did this on my Mac mini, which I use as a media center computer. It's an older model 1.83GHz Intel Core Duo with 2GB RAM. It should work on pretty much any Intel Mac, as I believe they've all got an optical output. If not, you're out of luck.

It's critical that the steps below are performed in the order listed. Don't, for instance, go and launch QuickTime before anything else, as it won't work.
  1. Hook up your surround processor or receiver to the Mac via an optical cable.
  2. Install Jack OS X version 0.8.1 -- the most recent version on the website.
  3. Reboot.
  4. Copy AC3Jack to the /Applications/Jack folder. (It probably doesn't need to live there, but it seemed like a good place.)
  5. Go into the JackPilot preferences and set Virtual output channels to six (five channels + one LFE). Set the Sample Rate to 48000 (48kHz). 44.1kHz and 48kHz both worked for me, but 96kHz didn't. My surround processor saw a two-channel PCM stream at 96kHz, but muted my speakers. My guess is it wasn't recognizing the encoding of the stream.
  6. Start up Jack OS X. Negligible CPU load at this statge -- about 0.5%.
  7. Open the Audio MIDI Setup app, from the JackPilot File menu, and set the Default Output to JackRouter.
  8. Launch QuickTime Player, playing an Apple HD trailer off the Apple Trailers website.
  9. Check in the movie inspector (Command-I) that the movie is using AAC 5.1 for the audio. In the inspector it should say:
    Format: H.264, 1280 x 688, Millions
    AAC, 5.1 (C L R Ls Rs LFE), 48.000kHz
  10. Note the order of the channels that it gives, or go into the movie properties (Command-J) and check under the Sound Track for the channel assignments. In my case it was (and I'd assume this is relatively standard):
    1. Centre
    2. Left
    3. Right
    4. Left Surround
    5. Right Surround
    6. LFE Screen
  11. As Jack was set as the default system output, QuickTime should now be using it for its output. Therefore, it's important to launch QuickTime after setting up the Jack virtual device and assigning it as the default in Audio MIDI Setup.
  12. Now it's time to launch AC3Jack. At this stage, my CPU load (as reported in the JackPilot window) jumped up to over 25%.
  13. In the AC3Jack GUI, using the assignment buttons set it up as follows:
    • Channels: 5 - Left/Centre/Right/L.Surr/R.Surr and tick the LFE checkbox.
    • Bitrate: 448 (depending on your receiver/surround processor, you can probably make this higher for better quality sound; 640 is the max)
    • Left: QuickTime Player:out 2
    • Centre: QuickTime Player:out 1
    • Right: QuickTime Player:out 3
    • L. Surr: QuickTime Player:out 4
    • LFE: QuickTime Player:out 6
    • R. Surr: QuickTime Player:out 5
    These channel mappings match the channel assignments that QuickTime player reported above.
  14. Tick Output to SPDIF Device and select Build-in Output (AC3). I didn't need to tick to Disguise as PCM box.
  15. Then, go back into QuickTime Player and start playing. At this point, my CPU Load in JackPilot jumped again to 35%-40%.
  16. Voila! Surround sound coming from the Mac mini, in real time. Plus, it's proper discrete 5.1 surround, not Dolby Prologic which is really 2.0
Unfortunately, this is a pretty involved manual process. I'm looking into ways that it can be automated, possibly with an AppleScript so that you can launch the AppleScript to watch a movie and it will set up all the sound mappings in the background and then begin playing.

[robg adds: I haven't tested this one, and I can't easily confirm or refute the statements about the output encoding.]
    •    
  • Currently 2.62 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (13 votes cast)
 
[87,802 views]  

How to get 5.1 audio out of AAC-surround-encoded audio | 22 comments | Create New Account
Click here to return to the 'How to get 5.1 audio out of AAC-surround-encoded audio' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Generate true 5.1 channel surround sound output
Authored by: VJrabauke on Feb 18, '09 08:08:29AM

What a tremendous effort!



[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: drebes on Feb 18, '09 08:39:31AM

Is it really not possible to output AAC through the optical port? I have a japanese receiver which supports surround AAC decoder (it's part of the ISDB standard) and would love to have this working...



[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: rxcfc on Feb 18, '09 08:47:05AM

Looks like it works. Too bad its so much work...



[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: edalzell on Feb 18, '09 08:48:42AM
Generate true 5.1 channel surround sound output
Authored by: dj_feare on Feb 18, '09 09:19:51AM

Modding the AC3 prefs file does work and it is certainly easier. My surround proc clearly denotes on the front panel display how many channels of audio it is receiving from the source *before *processing. With the AC3 prefs hack, I regularly see 5 discreet channels from HD QT trailers, mkv torrents, etc...

While I haven't tried the Jack method, it may offer some more flexibility and ease of changing settings.



[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: hazkid on Feb 18, '09 10:21:57AM

Actually, this hint does work, but ONLY if you have an AC3 soundtrack. The hint on this page explains how to get 5.1 if you do NOT have an AC3 soundtrack. Jack is a real time AAC->AC3 encoder. I happily use the Perian + AC3 Passthrough hack to enjoy 5.1 AC3 over optical from MKV and MPG/DVR-MS files.

Theoretically, 6Ch AAC passed over optical should be recognized if your receiver supports AAC - I've never heard of an American one that does this.

Finally, although I understand why (sort of) Apple uses AAC (AC3 is about 1.5x-2x the size of AAC) it boggles my mind when I try to think of why Apple uses AAC for movies bough on the AppleTV. The ATV has an optical output, is generally used with broadband connections, and would give users a much better experience if Apple simply used AC3 - which is universally supported in the US.

---
Naren Hazareesingh



[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: bmaxwell on Feb 18, '09 10:26:35AM
What about this KB from Apple:
http://support.apple.com/kb/TA25199


[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: zeligprod on Feb 18, '09 10:43:09AM

The latest version of Handbrake, the Apple TV settings, creates two sound tracks by default: AAC and AC-3. It complies with the Apple TV requirements to get true surround.



[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: Alrescha on Feb 18, '09 11:04:36AM

"Your Mac can not do real surround sound from its built-in optical audio port; in fact, not even your Apple TV can. "But Wait!" you say, "Yes it can, Apple even advertise surround sound as a feature of the Apple TV!" or "I can play a DVD and I'm hearing surround sound."


I find this a bit overstated. Lots of people are playing DVDs, or recorded TV from an EyeTV device on their Macs. The audio output (select the appropriate output device from within the the application) is Dolby Digital 5.1, exactly the same as from a DVD player or a digital television set. It's not Pro Logic, it's not watered down in any way.

In addition, lots of people are ripping DVDs with Handbrake and producing AppleTV content with Dolby Digital (AC3) tracks. These play fine on an Apple TV. Indeed, the power-up movie on an Apple TV is a 'real' Dolby Digital track (actually there are two - the stereo AAC track and an AC3 track).

It would be nice if Quicktime would natively support AC3, but I don't have hopes of that happening soon.

A.



[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: jaysoffian on Feb 18, '09 02:55:20PM
Also, some video content from the iTunes Store now has both a stereo AAC track and a 5.1 AC3 track. For example, I opened an HD episode of Lost from the iTunes Store in QuickTtime Player and noted the following tracks:

Name          Format
------------  -------------------
Main Program  AVC0 Media
Stereo        AAC (protected)
Surround      AC3 (protected)
Clicking on the AAC track, then Audio Settings shows two tracks (left and right). Clicking on the AC3 track, then Audio Settings shows all 5.1 tracks. Playing this on an AppleTV hooked up to a DD receiver would result in proper 5.1 surround sound. Renting movies on the AppleTV, you are also informed when movies contain 5.1 surround sound at the time of the rental.

[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: brw3sbc on Feb 18, '09 12:13:23PM

The opening statement is bold, but incomplete, and is contradicted in paragraph 4. There are several inaccurate statements in the posting.

The optical port is simply a serial digital data port, shovelling bits (ones and zeros - light on and light off) out in a sequence. It is up to the device at the other end to deal with the data that it receives.

The optical audio port of the Mac can indeed feed multi-channel data, if that is what is encoded in the bitstream. Several applications pass the data exactly as it is encoded in the source. I have some DTS-encoded CDs (Police, Moody Blues) that I keep in iTunes (AIFFormat). I can play them through the optical port or through AirTunes - my receiver (connected optically to an Airport Express) switches into DTS decoding automatically. The same when I play a DVD movie - the receiver (connected by optical cable or by coax with an optical-to-coax convertor at the Mac end) switches to decode as required. DTS-encoded material can be downloaded from Swedish National Radio, and played via iTunes - it is real surround - very real.

Other parts of the post are uncontested, by me. There may well be other sources where multi-channel data is encoded differently, and, yes, my receiver may not be able to decode them. What I interpret this post to offer is a conversion between one form of audio encoding to another form, the latter being one that the receiver can decode. All of that, however, has nothing to do with the capabilities of the optical port, which is already very capable.



[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: nek on Feb 18, '09 12:48:06PM
Wow, what bold claims, and so easily broken.
If you have non-DRM media files with AAC 5.1 tracks (Apple trailers for example) you can use Plex (www.plexapp.com) to convert the audio to AC3, no messing about needed.

[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: kaih on Feb 18, '09 02:31:44PM

I wasn't aware that Plex was able to do realtime AC3 transcoding. That's essentially what this hint is providing at a more generalised level.

Plex also has AC3 and DTS passthrough (as do many other apps, such as the Apple DVD Player and VLC) but that only helps if your media already has AC3/DTS encoded audio.

I'm going to have to check out Plex for the Mac mini media centre, it looks very cool.

---
k:.



[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: shonofear on Apr 16, '09 02:36:34PM

thanks 4 the PLEX link.
soooo good, re-encodes AAC 5.1 surround to AC3 on the fly to my amp. LEGENDARY
cheers



[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: kaih on Feb 18, '09 02:26:57PM

Thanks for the feedback - I was being deliberately half-wrong, and controversial in the opening paragraph in order to get people's attention - I then back down from that opening statement to more accurately (I hope) state the facts as I know them.

In short, to reply to some posters above, you're right. If you have audio in AC3 (aka Dolby Digital) in the media file you're playing, you can get surround sound through the optical port. This is AC3 Passthrough. Your Mac or Apple TV isn't generating the AC3 information in realtime, it's passing through a raw digital stream that's already encoded in AC3.

One thing that a lot of people don't realise is that the system only "sees" the optical port as a stereo output device, Mac OS X does not see the optical output port as a multichannel output device. Mac OS X on it's own can not dynamically generate and output surround sound through the SPDIF port as it only knows it as a two-channel output device. Other equipment, for instance the PS3, can do realtime Dolby Digital encoding so games and other software can generate AC3 multichannel output in realtime - it doesn't need to be pre-recorded and pre-encoded as AC3.

---
k:.



[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: Alrescha on Feb 18, '09 10:20:43PM

"Thanks for the feedback - I was being deliberately half-wrong, and controversial in the opening paragraph in order to get people's attention - I then back down from that opening statement to more accurately (I hope) state the facts as I know them."

Well gee thanks. What do you do for an encore?

Here's some feedback: I'd appreciate it if you didn't post anymore. The Internet is already full of misinformation without people spreading it on purpose.

A.



[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: rdas7 on Feb 19, '09 04:39:04AM

Um, yeah thanks for the misinformation then! WTF?!



[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: gil on Feb 21, '09 08:42:39AM

For what it is worth, I appreciate this hint. I have been looking for a solution to enable true 6-channel output through the SPDIF port. Not for video playback (since it's already AC3/DTS), but for gaming. Using the hint (with slight modifications), I can finally output surround sound in games like World of Warcraft.

Thanks :-)



[ Reply to This | # ]
Generate true 5.1 channel surround sound output
Authored by: mortem on Apr 07, '09 11:22:10AM

Yes, I agree! I did found this solution with AC3jack before but I did miss some documentation how to set this up. Now I found it here,...
As I could see, I did it right, but I can't test it because the lack of an A/V receiver. I will buying a receiver as soon I have a confirmation about the feasibility.
I do need a realtime encoder to monitoring out of LogicPro, when I mixing surround. But I'm still afraid, that this solution is not what I'm really looking for because of the cpu-load and eventually latency.

I would be much more amused, if I could find a 'Dolby Digital Live' (DDL) or 'DTS connect' USB or Firewire card for the mac. It makes me angry, that cards like that exists since 2005 for the PC but still nothing for the mac!



[ Reply to This | # ]
How to get 5.1 audio out of AAC-surround-encoded audio
Authored by: Orin on Feb 21, '10 06:56:18AM

WHAT optical port? I have four Intel Macs, including a Mac Mini 800 2.0Ghz and 4GB RAM, 2 iMac 24's, and a MBP 17, but that doesn't give me an optical port anywhere. I have optical ports on my drum machine, my Fast Track Pro, and a few other sundry items, but no optical outputs built into any of my Macs.

Isn't all this based on having an optical port on your Mac?



[ Reply to This | # ]
How to get 5.1 audio out of AAC-surround-encoded audio
Authored by: mediaphile on Feb 21, '10 02:15:33PM
I know for sure that your Macbook Pro has an optical port. It is a mini-Toslink port. The benefit of mini-Toslink is that it doubles as your headphone port. So if you plug regular headphones into your headphone jack, you get stereo, but if you plug a mini-Toslink cable into the same port, you get optical audio. What you probably want is a cable like this: Monoprice.com - Toslink to Mini Toslink, 6ft.

Not to sound like an advertisement for Monoprice, but I get all my cables from them because, for example, I got that cable for less than three bucks, and it works splendidly.

[ Reply to This | # ]
How to get 5.1 audio out of AAC-surround-encoded audio
Authored by: Orin on Feb 21, '10 04:34:50PM

Thanks for knowing more than a few Genius', mediaphile. I've already ordered cables and adapters for my attempt to bring life into my studio via SPDIF and the Toslink view of everywhere-sound.

Now, which tracks will I use for the big test... hmmm.

This is a nice entry for me coming into this new-found forum.

Danke.



[ Reply to This | # ]