Fix for AAC 6 channel output mappings.
#1
Hi Everyone,

I was having issues with AAC multi channel audio so I loaded up visual c++ express and took a look.
According to the AAC spec page at Apple, there are four different channel maps for AAC 5.1 and 5.0. I found that channel map "A" was what worked for me.
With these arrays changed as follows, AAC audio works for me in 4 movies (and an aac 5.1 setup video) that I had available.
To be clear, I use multi channel analog output, I don't know how this will affect HDMI/SPDIF audio.

From Apples spec page:

kAudioChannelLayoutTag_MPEG_5_1_A
MPEG 5.1-channel layout A (left, right, center, low-frequency effects, left surround, right surround).

kAudioChannelLayoutTag_MPEG_5_0_A
MPEG 5-channel layout A (left, right, center, left surround, right surround).

Corresponding arrays in Win32DirectSound.cpp:
const unsigned char aac_51_Map[] = {2,0,1,4,5,3}; // Sent as C, FL, FR, SL, SR, LFE
const unsigned char aac_50_Map[] = {2,0,1,4,5}; // Sent as C, FL, FR, SL, SR

Attached is the aac 5.1 test video I used to confirm my channel mappings.
http://www.mediafire.com/?mz5vwzovkwn

Thanks to all the XBMC devs for all their hard work!
Paulicat.
Reply
#2
Please create a proper ticket on trac with unified diffs of the full code. Your binaries are technically in violation of the GPL, so it might be in your best interest to take them down or post the FULL source code along side them.
Reply
#3
i want that code now! Smile
Reply
#4
I editted the binary links, sorry for that. I don't have the time to do full trac etc, if someone else wants to take credit for my change and add it to the tree thats fine with me, I only wanted to help fix a problem that seemed to be a pain to test/develop for.
However, the lines of code I changed are still in my post, anyone can download the svn tree, change the arrays, compile and they'd be good to go.
Reply
#5
sure, not a biggie. but let's do it properly Smile

from the looks of it yours is but a hack. any way to detect these different layouts properly?
Reply
#6
if you have time to build the exe's., you must surely have time to do 'svn diff > somefile' (right click -> create patch in tortoise) and attach that to a ticket.
Reply
#7
Not sure about auto detecting the layouts, for that matter I'm not sure whats up with apple having 4 different layouts for aac 5.x audio...
The layout I used above seemed to be "most compatible" for the test files I have (read: worked for all my files).
What I was wondering was whether 5.1(A) is the most common of the 4 mappings...
I'm actually an apple guy, but I'm not too impressed with this aac stuff.

Point taken...I'll see what I can do.
Reply
#8
Ok, I can't log into trac, but this ticket sounds exactly like my problem: http://trac.xbmc.org/ticket/7196

And here's a diff file. Wink
http://www.mediafire.com/?yntymtrwnzm

Doing some more digging, the mapping I ended up using is also considered "ITU 3.2.1" if that helps anyone...
Reply
#9
Paulicat, just wanting to tell you that the time you are dedicating to this is much appreciated. Kudos!
Reply
#10
Thanks for the comment. I hope it actually helps someone else out besides myself though...
Reply
#11
I'm sure anime fans will greatly appreciate it.
Reply
#12
How can i test it ?

Rob
Reply
#13
Are you able to compile svn yourself?
If so, grab the latest svn and find the two arrays that I changed in Win32DirectSound.cpp from my first post and recompile.
Both dx and gl build will have the "fix" in it.
Reply
#14
Hi Paulicat
Help me out here because i am little bit confused. I am windows user and i am using XBMC SVN build 22516.
I send the sound via optical output to external amp that supports DD5.1 and DTS 5.1/7.1. Always (as i can remember) in XBMC when i play mkv files with AAC 6 channels sound my amp shows 2 channel stereo signal. In other files (mkv or others) with DD5.1 & DTS sound the multi-channel signals are showing correct in my amp.

You say "Fix for AAC 6 channel output mappings". I don't even get 6 channel (with wrong or right mapping) from files containing multi-channel AAC sound.
I get only 2 channels.

Did i miss something in my settings or my XBMC setup ?

Thanks
Nessus
Reply
#15
Hi Nessus, not really related to the problem I'm referring to in this thread, however, if you can, post a sample I could test...
Reply

Logout Mark Read Team Forum Stats Members Help
Fix for AAC 6 channel output mappings.0