Different surround sound speaker mappings depending on Dolby setting?

I’ve been working with Surround Sound and the new Apple TV a bit lately, and I can’t quite understand some of the results I’m seeing.

My setup:

  • Apple TV connected to a Dolby Digital capable receiver via HDMI. This receiver supports HDMI v1.4
  • 5.1 speaker setup

I encode my audio files using Adobe Audition CC 2015. This version of Audition supports exporting ac3 and ec3 Dolby Digital and Dolby Digital Plus formats. The resulting ec3 files are 48KHz, 320bps with 5.1 channels.


My app uses AVAudioPlayer to play back these files. I set my audio session and preferred number of channels appropriately before starting playback.

When I have my Apple TV’s Audio/Video Surround mode set to Dolby Digital, everything works as I would expect. My receiver switches over to DD, and all sounds play on the correct channels. Querying my AVAudioSessions maxOutputNumberOfChannels returns 6, as I would expect.

If I leave the Apple TV in its default “auto” state, I get different results. The AVAudioSession maxOutputNumberOfChannels returns 8 (more than the receiver supports), and playing back my files results in a completely different (and wrong) channel mapping. I don’t see my receiver switch over to Dolby Digital like I do when the Apple TV is forced into Dolby Digital mode.

The last test I did was to export my audio files in pcm (wav) form. This results in surround sound files that work for all channels regardless of the Apple TV Dolby Digital setting (as I would expect since they aren’t Dolby Digital encoded). However, wav files are massive, and I really don’t want to go that route…


So what exactly is happening here? Why might I be seeing different channel mappings depending on the Apple TV audio setting?


My guess is that with Dolby Digital encoded files, leaving the Apple TV in auto mode causes the Apple TV to decode the files and send raw audio to the receiver, but with an incorrect channel mapping. If the Apple TV is in Dolby Digital=On mode, that enables HDMI passthrough and the receiver does the decoding of the file.

Is there a different way I should be encoding my files so that they are decoded correctly by both the Apple TV and receiver?

Answered by pnb2001 in 87143022

Wow, so I found a solution. I think this is a bug on Apple's side. I switched from AVAudioPlayer to just AVPlayer, and now ac3/ec3 encoded files play on the correct channels.

(cross-posting the same answer to your earlier thread:)


Hi pnb2001,


When set to "Dolby Digital = On" mode, the Apple TV re-encodes audio to Dolby Digital (AC-3) for compatibility with devices that only support Dolby Digital bitstream passthrough.


When set to "Auto", the Apple TV will decode audio (including Dolby Digital or Dolby Digital Plus audio) to multichannel PCM and pass that over HDMI. This means that the receiver will not say "Dolby Digital Plus" or "Dolby Digital" since it is not receiving a bitstream, however you should get the correct decoded audio (this is what happens for iTunes movies for example).


What is the incorrect channel mapping that you are seeing?

Also, what is your channel order when you kick off the encode in Adobe Audition?


cheers,

Hugo

Thanks for the details Hugo! When I encode in Adobe Audition, I only have one option for channel mapping, and that is L, R, C, LFE, Ls, Rs. What ends up playing when the ATV is in auto mode is:


L plays on L

R plays on LFE

C plays on R

LFE plays on Rs

Ls plays on C

Rs plays on Ls


These results are the same across various types of receivers, and match results reported by some of my users.

In order to get an AC3 file to play properly on the Apple TV in "Auto" surround mode, I had to change my channel mappings in my source WAV file to match the results I saw above:

1) FL

2) LFE

3) FR

4) Rs

5) Center

6) Ls

Rather than use Adobe Audition, I used Audacity to encode the file (using ffmpeg) with this channel mapping.

Accepted Answer

Wow, so I found a solution. I think this is a bug on Apple's side. I switched from AVAudioPlayer to just AVPlayer, and now ac3/ec3 encoded files play on the correct channels.

Different surround sound speaker mappings depending on Dolby setting?
 
 
Q