InfiniteMac OSx86

InfiniteMac OSx86 (http://infinitemac.com/forum.php)
-   Snow Leopard 10.6 (http://infinitemac.com/forumdisplay.php?f=87)
-   -   [GUIDE] How to port AppleHDA to SL (http://infinitemac.com/showthread.php?t=3981)

mormegil 09-08-2009 03:15 AM

[GUIDE] How to port AppleHDA to SL
 
3 Attachment(s)
Okay. I've been getting a lot of requests from people who wants to convert their Leopard AppleHDA.kext into Snow Leopard.
This guide assumes you have fully working kext or at least one which works well enough for your needs.

Edit: This guide also assumes you have injected your audio by DSDT. Check out snow's guide
If you can't find any AZAL or HDEF in your dsdt, just insert it manually like this.

Things you need:

1. Vanilla SL AppleHDA.kext
2. Working AppleHDA.kext (make sure it works in leopard!)
3. PlistEdit Pro
4. HexEdit

1) First off, these are the codecs known to be supported natively without any binary patching required.

Code:

Name          Codec ID (dec)  Codec ID (hex)
AD1984        299112836        0x11D41984
AD1988        299112843        0x11D4198B
STAC9220    -2088470912        0x83847680
ALC262        283902562        0x10ec0262
ALC885        283904133        0x10ec0885

If your codec id matches one of these you can skip this step.
Else, look into your vanilla SL AppleHDA.kext (Right click -> Show Package Contents) and browse to:

Code:

(SL)AppleHDA.kext/Contents/MacOS/
Open up the AppleHDA binary with HexEdit. You are going to replace one of the codec ids above with your own.
In this example I'm going to replace the codec 0x10ec0885 (ALC885) with 0x10ec0888 (ALC888).

So hit Command+F and search for 8508ec10 (byte-flip of 10ec0885) and replace with 8808ec10 (byte-flip of 10ec0888).
Then just hit "Replace All". There will be 4 instances just to double check. Once you're done, Save and Exit.

2) Next, the plists. You will have to edit two of them in your SL kext.

Firstly you need to edit:

Code:

(SL)AppleHDA.kext/Contents/PlugIns/AppleHDAHardwareConfigDriver.kext/Contents/Info.plist
Open it up with your plist editor, go to:

Code:

IOKitPersonalities/HDA Hardware Config Resource/HDAConfigDefault/
and delete everything under it.

Now, depending on which version your working applehda is, open either one of these:
Code:

(Leo)AppleHDA.kext/Contents/PlugIns/AppleHDAController.kext/Contents/Info.plist
(Leo)AppleHDA.kext/Contents/PlugIns/AppleHDAHardwareConfigDriver.kext/Contents/Info.plist

Then browse through until you see something like this:
Attachment 615

Right click on the key (number 0 in the picture above) containing your CodecID and copy.
Also, take note of the LayoutID you're using. It should be 12.

Now go back to your SL plist above, click on HDAConfigDefault and paste as child. Save and exit.

3) Next, you need to edit:

Code:

(SL)AppleHDA.kext/Contents/PlugIns/AppleHDAPlatformDriver.kext/Contents/Info.plist
Go to:

Code:

IOKitPersonalities/HDA Platform Resource/
and delete everything under Layouts and PathMaps

Again, depending on which version your working applehda is, open either one of these:
Code:

(Leo)AppleHDA.kext/Contents/Info.plist
(Leo)AppleHDA.kext/Contents/PlugIns/AppleHDAPlatformDriver.kext/Contents/Info.plist

Then browse through until you see something like this:
Attachment 613

Right click on the key under Layouts (the number 0 in the picture) which contains your LayoutID (12) and copy.
Take note of the PathMapID being used. In this case it's 9.
Also make sure CodecID is correct.
Now go back to your SL plist above, click on Layouts and paste as child.

Back to the Leo plist, browse through until you see something like this:
Attachment 614

Right click on the key under PathMaps (number 0) which has your PathMapID (9 in this case). Copy.
Go back to your SL plist, click on PathMaps and paste as child.

infinitek 09-08-2009 03:58 AM

Thanx for the info.....can u post your alc888 patched applehda...?????

mormegil 09-08-2009 04:09 AM

This plist works best. I'm not going to upload patched applehda from now on.

Snow 09-08-2009 06:36 AM

Great and thorough guide bro, good job!

xxxslayeriiixxx 09-08-2009 06:41 AM

i hope this will work for me. thx for the post

Pietruszka 09-09-2009 12:17 PM

Hi

what if I've got more (not only 0) numbers in my old appleHDA.kext...I've got form 0...to 23...

which one need to copy ???

thanks for help

mormegil 09-09-2009 12:45 PM

In step no. 2, search for your codec id (decimal) under the key CodecID. Once you've found it, take not the LayoutID it's using. If it's not 12, change it.

Search again, just to make sure it appears only once. You can safely remove the other layouts and keep your plist clean.

Pietruszka 09-09-2009 12:53 PM

thanks

copied all pathmaps and layouts but didn't work..... I'll try yous suggestions...

thanks for help

p.s. if doesn't work can I post working applehda form leo and the new one from 10.6???

mormegil 09-10-2009 03:23 AM

Quote:

Originally Posted by Pietruszka (Post 34147)
thanks

copied all pathmaps and layouts but didn't work..... I'll try yous suggestions...

thanks for help

p.s. if doesn't work can I post working applehda form leo and the new one from 10.6???

have you patched dsdt?

Pietruszka 09-10-2009 09:07 AM

yes I've patched DSDT

still doesn't work for me...maybe I do something wrong.....

anyway thanks for help