Jump to content

GUIDE: HDMI Audio with unsupported on-board audio: VoodooHDA and AppleHDA at the same time.

voodoohda applehda ati amd hdmi audio 10.8 mountain lion

  • Please log in to reply
37 replies to this topic

#1
Lord Kamina

Lord Kamina

    InsanelyMac Protégé

  • Members
  • PipPip
  • 51 posts
  • Gender:Male
  • Location:Santiago, Chile
DISCLAIMER:I have made this guide for people using ATI/AMD GPUs because that is what I have, because as-far-as-I-know AMD uses only one audio codec and because it's what I've tried and know, works. Still, the principle should be just as valid for NVIDIA or even Intel HD cards.

My Build:
  • Motherboard: Asus P5G41T-M LX PLUS
  • CPU: Intel E7400, overclocked @ 3.37GHz
  • Memory: 4GB Ram DDR3 1333
  • Ethernet: Realtek RTL8169
  • Audio Codec: ALC887-VD
  • Graphics: XFX Radeon HD 5570 1GB DDR3
  • OS: Mountain Lion 10.8.2
I bought this Asus board a couple months ago and mostly it works very well. Now, when I bought it I looked at the audio codec but I didn't search for actual user experiences getting it to work (my mistake) and to my surprise, upon getting home I quickly realized that AppleHDA and my board just weren't the best of buddies.

Flash-forward a couple of weeks and I'm resigned to using VoodooHDA. Now, VoodooHDA doesn't make friends with my HDMI audio so I have to choose between AppleHDA and HDMI or Voodoo and on-board and frankly, that sucks.
The solution? Use both at the same time!

Now, usually this will result in a kernel panic. Why? Because by default both these kexts try to match devices by their PCI-Class and logically end-up trying to take control of the same devices and that's not good.

But, with a few minor edits it's possible to have them both coexist peacefully.
Normally, AppleHDA(AppleHDA.kext/Contents/Plugins/AppleHDAController/Contents/Info.plist) will have these lines near the bottom:

<key>IOClass</key>
<string>AppleHDAController</string>
<key>IOPCIClassMatch</key>
<string>0x04020000&amp;0xFFFE0000</string>
<key>IOProviderClass</key>
<string>IOPCIDevice</string>

And VoodooHDA.kext/Contents/Info.plist will have these:

<key>IOClass</key>
<string>VoodooHDADevice</string>
<key>IOPCIClassMatch</key>
<string>0x04020000&amp;0xFFFE0000</string>
<key>IOProviderClass</key>
<string>IOPCIDevice</string>

See the similarity?
Now, if instead you change them to the following (note, the actual values might and probably will change depending on your actual on-board codec and GPU)

<key>IOClass</key>
<string>AppleHDAController</string>
<key>IOPCIPrimaryMatch/key>
<string>0xaa601002</string>
(0x1002:aa60 is the PCI Vendor ID for my Radeon's HDMI device, you can check these by using "System Info.app")
<key>IOProviderClass</key>
<string>IOPCIDevice</string>

And

<key>IOClass</key>
<string>VoodooHDADevice</string>
<key>IOPCIPrimaryMatch</key>
<string>0x27d88086</string>
(0x8086:27d8 is the PCI Vendor ID for my on-board ALC887 device, you can check these by using "System Info.app")
<key>IOProviderClass</key>
<string>IOPCIDevice</string>


Now Voodoo will know to try and match only your on-board audio and AppleHDA will know to try and match only your GPU's audio.

Clearly, you're not yet quite done. For this to work, you will need more-or-less the same DSDT edits you would use to enable HDMI audio normally (and if you're using an AMD card like me, you need to be sure your Framebuffer is correct, which I won't go into now)

The only departure from the tried-and-true DSDT edit for AMD cards is the following (I'm not entirely sure it is needed but I did it this way and it worked)
You must add the layout-id that normally goes in the HDEF section to the HDAU section, like this:

Device (HDAU)
{
Name (_ADR, One)
Method (_DSM, 4, NotSerialized)
{
Store (Package (0×04)
{
“hda-gfx”,
Buffer (0x0A)
{
“onboard-1″
},
"layout-id",
Buffer (0x04)
{
0x01, 0x00, 0x00, 0x00
}

}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}


Once all that is done, you need to edit AppleHDA proper:

Since Mountain Lion supports ATI HDMI audio OOB, you only need to change the layout/pathmap to suit your card. You will find numerous tutorials explaining in details how to do that. For now, what I did was use layout id: 1 and defined it thus:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com...yList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LayoutID</key>
<integer>1</integer>
<key>PathMapRef</key>
<array>
<dict>
<key>CodecID</key>
<array>
<integer>268610049</integer> (My Radeon's codec ID in decimal, should be the same for all ATI/AMD cards)
</array>
<key>HDMI</key>
<dict/>
<key>Outputs</key>
<array>
<string>HDMI</string>
</array>
<key>PathMapID</key>
<integer>268610049</integer> (Following Apple's example on a layout that included an Nvidia HDMI audio, I used the Device ID as the PathMapID, the actual number is mostly irrelevant as long as it matches Platforms.xml though)
</dict>
</array>
</dict>
</plist>

And then in Platforms.xml, I did this:

<key>PathMaps</key>
<array>
<dict>
<key>PathMap</key>
<array>
<array>
<array>
<array>
<dict>
<key>NodeID</key>
<integer>3</integer>
</dict>
<dict>
<key>NodeID</key>
<integer>2</integer>
</dict>
</array>
</array>
</array>
</array>
<key>PathMapID</key>
<integer>268610049</integer> See? Same ID
</dict>
</array>


The Node IDs I just get from a codec dump of my HDMI card done in Linux.
After all this was done, I deleted all other layouts and Pathmaps (left the DSP section alone, though) and compressed those XMLs again using zlib.pl, just ran MyFix, rebooted and all was working as expected.I am attaching both my own modified AppleHDA (done as per the instructions here, the binary itself is intact, I just messed with the Info.plists, pathmaps and whatnot) and my IORegistry so you can have fun with it:

Attached Files



#2
Rampage Dev

Rampage Dev

    InsanelyMac Deity

  • Local Moderators
  • 2,032 posts
  • Gender:Male
It was fun working on this project. -Beta

#3
Lord Kamina

Lord Kamina

    InsanelyMac Protégé

  • Members
  • PipPip
  • 51 posts
  • Gender:Male
  • Location:Santiago, Chile

It was fun working on this project. -Beta


Blood, sweat and tears! Definitely wouldn't have gotten it working without your blog and commenting here and there.

#4
plsh2me

plsh2me

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 181 posts
  • Gender:Male
  • Location:Bangladesh

Blood, sweat and tears! Definitely wouldn't have gotten it working without your blog and commenting here and there.


Thought it is a easy process :D . But no!!!!
Tried your procedure, for me not working :( .
Any suggestion?
Thank you
Palash

#5
Lord Kamina

Lord Kamina

    InsanelyMac Protégé

  • Members
  • PipPip
  • 51 posts
  • Gender:Male
  • Location:Santiago, Chile
The only way to know what's wrong in your attempt would be to provide more detail. Whether you're using a DSDT or not, whether you're using GraphicsEnabler=Yes or not, which Framebuffer you are actually working under, whether that framebuffer has all connectors properly defined, etc.

At the very least you should specify those and get/upload an IORegistry. Now, keep in mind that the kext I attached here won't work in 10.8.3 because 10.8.3 changed AppleHDA and increased the version numbers for it and most of its dependencies, among other stuff. Obviously, you can take a fresh 10.8.3 kext and modify it in the same way and it will work.

#6
plsh2me

plsh2me

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 181 posts
  • Gender:Male
  • Location:Bangladesh
I have patched my graphics kexts using this guide - http://www.insanelym...n/#entry1655903 (Old method), works fine :D .
Apple default Shrike frame buffer for ATI Radeon HD 4600 series :
02 00 00 00 40 00 00 00 09 01 00 00 02 01 00 03
02 00 00 00 00 01 00 00 09 01 00 00 20 01 02 02
00 04 00 00 04 03 00 00 00 01 00 00 10 00 01 01 replaced with -
My card frame buffer:
02 00 00 00 40 00 00 00 09 01 00 00 12 00 02 07 LVDS
10 00 00 00 10 00 00 00 00 01 00 00 00 10 00 01 VGA
00 08 00 00 00 02 00 00 00 01 00 00 10 01 01 02 HDMI
For inject graphics using ATY_Init.kext, No GraphicsEnabler=Yes/No flag on boot.plist, Using DSDT.

To patch HDMI taken a fresh kext from 10.8.3, but failed. HDMI pins seems similar to you. Tried both radeon default codec id - as you said -268610049 & mine 268610104 (0x1002aa38). Only one thing no device entry on audio, but can increase or decrease volume(of what don't know :P )!!!
Attached edited AppleHDA.kext, DSDT, ioreg & voodoo dump files for your consideration.
Thank you
Palash

Attached Files



#7
Lord Kamina

Lord Kamina

    InsanelyMac Protégé

  • Members
  • PipPip
  • 51 posts
  • Gender:Male
  • Location:Santiago, Chile
I haven't looked more in-depth than this yet but one error I've found is in your edit of AppleHDA, where you put



   <key>IOPCIClassMatch</key>
   <string>0xaa381002</string>

It should be


   <key>IOPCIPrimaryMatch</key>
   <string>0xaa381002</string>

Try that and report.

#8
plsh2me

plsh2me

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 181 posts
  • Gender:Male
  • Location:Bangladesh

I haven't looked more in-depth than this yet but one error I've found is in your edit of AppleHDA, where you put



<key>IOPCIClassMatch</key>
<string>0xaa381002</string>

It should be


<key>IOPCIPrimaryMatch</key>
<string>0xaa381002</string>

Try that and report.


Corrected & found the device :D .
This time the device has no output controls :( .
Attached File  hdmi audio.jpg   238.88KB   29 downloads
Follow the picture, have patched the device on layout 1, but device is showing on 12. Don't know actual fact with this. I have also also tried by renaming the layout 1 to layout 12 :) (obviously also changed info). Remains same.
Now attached ioreg with voodoo+apple combined, please give a look on this.
Attached File  ioreg.zip   470.85KB   14 downloads
Thank you
Palash

#9
Lord Kamina

Lord Kamina

    InsanelyMac Protégé

  • Members
  • PipPip
  • 51 posts
  • Gender:Male
  • Location:Santiago, Chile

Corrected & found the device :D .
This time the device has no output controls :( .
Attached File  hdmi audio.jpg   238.88KB   29 downloads
Follow the picture, have patched the device on layout 1, but device is showing on 12. Don't know actual fact with this. I have also also tried by renaming the layout 1 to layout 12 :) (obviously also changed info). Remains same.
Now attached ioreg with voodoo+apple combined, please give a look on this.
Attached File  ioreg.zip   470.85KB   14 downloads
Thank you
Palash


Do keep in mind you will never get output controls for HDMI. It's always assumed you will handle volume and such from the device itself. (even on vainilla Mac with Thunderbolt)

From your IOReg I am gathering that your on-board audio is being picked with Layout 12 but the HDMI is Layout 1. The whole point of this fix is to be able to use both devices in a completely independent manner from each other, since it may happen that one is supported well with one kext and the other with the other.

AppleHDA is now attached to HDAU and Voodoo is attached to HDEF; that's as it should be. Make sure the rest of the HDMI settings are as I instructed in my first post and then just test it. Remember that you need to boot the mac with the HDMI device already connected for it to work properly. To my knowledge that is something nobody's been able to fix yet.

#10
plsh2me

plsh2me

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 181 posts
  • Gender:Male
  • Location:Bangladesh
May be you are right, will never get output control with HDMI :( .
As the kexts loading on their own points- AppleHDA for HDAU & Voodoo for HDEF, But the device seems not work !!!
Controled again n again got nothing, Although I havn't knowledge more than your guide :P .
Don't know more than this what can do :idea:
Thank you
Palash

#11
Lord Kamina

Lord Kamina

    InsanelyMac Protégé

  • Members
  • PipPip
  • 51 posts
  • Gender:Male
  • Location:Santiago, Chile
The Output controls thing is not a bug, it's just how OSX is designed.

So... You connect the monitor, get picture but no sound? If that's the case, reboot with the HDMI connected and get a new IOReg, post that along with the kext and DSDT you're currently using.

Something else I noticed, atleast from your codec dumps (cannot open ioregs on my phone); your audio codec is not 0xaa381002, it's 0xaa011002

#12
plsh2me

plsh2me

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 181 posts
  • Gender:Male
  • Location:Bangladesh

The Output controls thing is not a bug, it's just how OSX is designed.

So... You connect the monitor, get picture but no sound? If that's the case, reboot with the HDMI connected and get a new IOReg, post that along with the kext and DSDT you're currently using.

Something else I noticed, atleast from your codec dumps (cannot open ioregs on my phone); your audio codec is not 0xaa381002, it's 0xaa011002

Yes, when connect the monitor seems ok, except sound. Tested with display connected, no change at all :( .
I have also noticed that on dump file, but with this also a doubt. If run system info.app shows device aa38.

On the other hand if I use 0xaa011002 device not shows, If I use 0xaa381002 device shows on System info & About this Mac.
One more addition, with AIDA64 from windows got this -
HD Audio

[ ATI RV710/730/740 - High Definition Audio Controller ]

Device Properties:
Device Description ATI RV710/730/740 - High Definition Audio Controller
Device Description (Windows) High Definition Audio Controller
Bus Type PCI
Bus / Device / Function 1 / 0 / 1
Device ID 1002-AA38
Subsystem ID 1028-0447
Revision 00
Hardware ID PCI\VEN_1002&DEV_AA38&SUBSYS_04471028&REV_00

[ ATI Radeon HDMI ]

Device Properties:
Device Description ATI Radeon HDMI
Device Description (Windows) High Definition Audio Device
Device Type Audio
Bus Type HDAUDIO
Device ID 1002-AA01
Subsystem ID 00AA-0100
Revision 1001
Hardware ID HDAUDIO\FUNC_01&VEN_1002&DEV_AA01&SUBSYS_00AA0100&REV_1001

[ Intel Ibex Peak PCH - High Definition Audio Controller [B-3] ]

Device Properties:
Device Description Intel Ibex Peak PCH - High Definition Audio Controller [B-3]
Device Description (Windows) High Definition Audio Controller
Bus Type PCI
Bus / Device / Function 0 / 27 / 0
Device ID 8086-3B56
Subsystem ID 1028-0447
Revision 06
Hardware ID PCI\VEN_8086&DEV_3B56&SUBSYS_04471028&REV_06

[ IDT 92HD81B1X ]

Device Properties:
Device Description IDT 92HD81B1X
Device Description (Windows) IDT High Definition Audio CODEC
Device Type Audio
Bus Type HDAUDIO
Device ID 111D-7605
Subsystem ID 1028-0447
Revision 1001
Hardware ID HDAUDIO\FUNC_01&VEN_111D&DEV_7605&SUBSYS_10280447&REV_1001

From device manager of windows 8 got -
IDT High def. audio:
hardware id -
HDAUDIO\FUNC_01&VEN_111D&DEV_7605&SUBSYS_10280447&REV_1001
compitable id -
HDAUDIO\FUNC_01&CTLR_VEN_8086&CTLR_DEV_3B56&VEN_111D&DEV_7605&REV_1001

High def. Audio:
hardware id - HDAUDIO\FUNC_01&VEN_1002&DEV_AA01&SUBSYS_00AA0100&REV_1001
compitable id -HDAUDIO\FUNC_01&CTLR_VEN_1002&CTLR_DEV_AA38&VEN_1002&DEV_AA01&REV_1001.
Now please tell me which one exactly have to use?

Attached necessary files for you Attached File  ioreg,DSDT,AppleHDA.zip   1.21MB   15 downloads.

Thank you
Palash

#13
Lord Kamina

Lord Kamina

    InsanelyMac Protégé

  • Members
  • PipPip
  • 51 posts
  • Gender:Male
  • Location:Santiago, Chile
In that case aa38 is right and the first dump you posted was from a different card.
I'll check the new files when I get home.

#14
Lord Kamina

Lord Kamina

    InsanelyMac Protégé

  • Members
  • PipPip
  • 51 posts
  • Gender:Male
  • Location:Santiago, Chile
From what I have seen, you have edited everything correctly and OSX _THINKS_ it's giving you audio through that HDMI. If you're not getting anything it most likely means that the error is in the Framebuffer edit you made and that's what you need to correct.

I might be able to help you with that if you post your card bios dump and the personality you're using, etc etc.

#15
plsh2me

plsh2me

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 181 posts
  • Gender:Male
  • Location:Bangladesh

From what I have seen, you have edited everything correctly and OSX _THINKS_ it's giving you audio through that HDMI. If you're not getting anything it most likely means that the error is in the Framebuffer edit you made and that's what you need to correct.

I might be able to help you with that if you post your card bios dump and the personality you're using, etc etc.


Ok, Thank you very much for your interest.
My modded Shrike personalities :

02 00 00 00 40 00 00 00 09 01 00 00 12 00 02 07 LVDS
10 00 00 00 10 00 00 00 00 01 00 00 00 10 00 01 VGA
00 08 00 00 00 02 00 00 00 01 00 00 20 01 01 02 HDMI

Attached video bios from windows & connectors info.
Attached File  vga bios.zip   42.14KB   3 downloads

#16
Lord Kamina

Lord Kamina

    InsanelyMac Protégé

  • Members
  • PipPip
  • 51 posts
  • Gender:Male
  • Location:Santiago, Chile
Whoops, sorry. I've been working a lot this week and had forgotten about this.

Try the following:



02 00 00 00 40 00 00 00 09 01 00 00 12 00 02 07  LVDS 
10 00 00 00 10 00 00 00 00 01 00 00 00 10 00 01  VGA
00 08 00 00 04 02 00 00 00 01 00 00 22 05 06 02  HDMI

And report back.

#17
plsh2me

plsh2me

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 181 posts
  • Gender:Male
  • Location:Bangladesh

Whoops, sorry. I've been working a lot this week and had forgotten about this.

Try the following:



02 00 00 00 40 00 00 00 09 01 00 00 12 00 02 07 LVDS
10 00 00 00 10 00 00 00 00 01 00 00 00 10 00 01 VGA
00 08 00 00 04 02 00 00 00 01 00 00 22 05 06 02 HDMI

And report back.


Tested.
Normally Laptop display - ok.
DVI/VGA not working !!!

When start with DVI/VGA connected, Laptop display goes black :( .

Thank you
Palash

#18
Lord Kamina

Lord Kamina

    InsanelyMac Protégé

  • Members
  • PipPip
  • 51 posts
  • Gender:Male
  • Location:Santiago, Chile
What about HDMI?

Check you applied the patch correctly. If you look closely you will notice that the only thing I actually changed was the HDMI entry. The VGA shouldn't be affected AT ALL by my edit.

Also, as far as I can tell, your laptop DOES NOT have DVI. Just HDMI, VGA and internal screen, right?

Not to mention, I think most ATI cards support only two of those three at a time. I don't think you can have all three working simultaneously. At least I know on my Hackintosh I canot have DVI, HDMI and VGA at the same time (It's a desktop card) even when the three work perfectly fine on their own (or with up to one other)

#19
plsh2me

plsh2me

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 181 posts
  • Gender:Male
  • Location:Bangladesh

What about HDMI?

Check you applied the patch correctly. If you look closely you will notice that the only thing I actually changed was the HDMI entry. The VGA shouldn't be affected AT ALL by my edit.

Also, as far as I can tell, your laptop DOES NOT have DVI. Just HDMI, VGA and internal screen, right?

Not to mention, I think most ATI cards support only two of those three at a time. I don't think you can have all three working simultaneously. At least I know on my Hackintosh I canot have DVI, HDMI and VGA at the same time (It's a desktop card) even when the three work perfectly fine on their own (or with up to one other)


Yes, you are right.
I have no deep knowledge about this.
As you have changed HDMI info only, it might not effect other output. Strangely external display not working!!! So I can't test HDMI :( .
Would you please have a look on framebuffer edit, what goes wrong with others.
Thank you
Palash

#20
Lord Kamina

Lord Kamina

    InsanelyMac Protégé

  • Members
  • PipPip
  • 51 posts
  • Gender:Male
  • Location:Santiago, Chile
Okay...

1) Get me a log of a verbose boot.
2) Get a new IOReg
3) Why are you using ATY_Init.kext? You're already using a DSDT, which means you can easily implement Beta's method (http://rampagedev.wo...rd-into-a-dsdt/) and get rid of ATY_Init altogether.
4) I have no idea whether this makes any sort of difference at all or not but in my particular case, I got audio to work with


							 "hda-gfx",
							 Buffer (0x0A)
							 {
"onboard-2"
							 },

Most guides use onboard-1, but that didn't work for me. So you can also try changing that. Just make sure to remember that code is used several times, so you need to change all instances. (At least I put it on the GFX0 inside the PEGP device, on the HDAU and also on the HDEF, though come to think of it, that probably is irrelevant)

And keep in mind that I'm not an expert or anything, I learned by tinkering and trying different things and probably so will you if you keep at it.





Also tagged with one or more of these keywords: voodoohda, applehda, ati, amd, hdmi, audio, 10.8, mountain lion


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy