Jump to content

Script to patch AppleHDA binary for osx10.7/10.8/10.9


bcc9
 Share

168 posts in this topic

Recommended Posts

  • 3 weeks later...

Here's a new version of patch-hda.pl, version 3.0. This version attempts to auto-detect your system's codec and offers that as a default. Also, you can run the script interactively with a bit more help than the wrapper script had before. For example:

% ./patch-hda.pl
OSX version 10.9 detected
Default target codec: 10ec0892 detected.
Enter codec-id or codec-name for AppleHDA patch.  Eg. 111d7675 or IDT 7675
Press enter for default, or ? for help (Default: 10ec0892)
? <enter>
There are 2 choices for target codec
Choose codec number to patch to (1 thru 2) (default 1)
Choice 1: ALC 885
Choice 2: ADI 1984B
? 2
Patching AppleHDA codec 11d4198b with 10ec0892
1 codec range comparison(s) to patch
Patching range comparison 11d41984
This script requires superuser access to update AppleHDA
Password:
/System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA patched successfully.
%
The new command line argument -y allows you to pick up the auto-detected codec without running the script interactively. So the non-interactive equivalent of the above:

sudo ./patch-hda.pl -y -c 2
I think this auto-detection is pretty handy even for more experienced users; (I find it difficult to remember which of one's machines is running which codec when re-applying the AppleHDA binary patch).

 

Technical details: This script grabs the codec out of the ioregistry, which should work assuming AppleHDA is able to start at all. With a little more effort, I could probe the system's PCI devices to get the codec if the ioregistry approach is not sufficient.

 

Edit: script moved to post #1

  • Like 6
Link to comment
Share on other sites

Here's a new version of patch-hda.pl, version 3.0. attachicon.gifpatch-hda.3.0.zip This version attempts to auto-detect your system's codec and offers that as a default. Also, you can run the script interactively with a bit more help than the wrapper script had before. For example:

% ./patch-hda.pl
OSX version 10.9 detected
Default target codec: 10ec0892 detected.
Enter codec-id or codec-name for AppleHDA patch.  Eg. 111d7675 or IDT 7675
Press enter for default, or ? for help (Default: 10ec0892)
? <enter>
There are 2 choices for target codec
Choose codec number to patch to (1 thru 2) (default 1)
Choice 1: ALC 885
Choice 2: ADI 1984B
? 2
Patching AppleHDA codec 11d4198b with 10ec0892
1 codec range comparison(s) to patch
Patching range comparison 11d41984
This script requires superuser access to update AppleHDA
Password:
/System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA patched successfully.
%
The new command line argument -y allows you to pick up the auto-detected codec without running the script interactively. So the non-interactive equivalent of the above:

sudo ./patch-hda.pl -y -c 2
I think this auto-detection is pretty handy even for more experienced users; (I find it difficult to remember which of one's machines is running which codec when re-applying the AppleHDA binary patch).

 

Technical details: This script grabs the codec out of the ioregistry, which should work assuming AppleHDA is able to start at all. With a little more effort, I could probe the system's PCI devices to get the codec if the ioregistry approach is not sufficient.

 

Can you add a param to allow custom location of AppleHDA.kext?

Link to comment
Share on other sites

Great Work bcc9,

I think you perfected our conversation and

did efficiently though without a GUI.

I can help in any way with the PCI's device's?

All the best!!

Thanks. I should have mentioned that your private PMs helped to push me to make this latest version a bit more user friendly.

Sure, you could hack up a kext that dumps out the information (similar to the lspci port). Then I can just invoke the kext and parse the result from this script.

Can you add a param to allow custom location of AppleHDA.kext?

The functionality is already in there, I just hadn't documented all the command line switches:

-s <directory> to specify an alternative to /System/Library/Extensions

-r <volume root> to specify an alternate disk volume to use as the root for everything (particularly useful when you have multiple installs of OSX and you want to patch OSX on one of those other volumes.

 

Also, for both of the above the script determines the OS release based upon the AppleHDA kext version. If for some reason the script gets this wrong, there's also

-o <os version number> to override the auto-detected OS version (10.7/10.8/10.9)

And lastly,

-t to run the script in test-only mode, where AppleHDA is not actually patched.

  • Like 6
Link to comment
Share on other sites

Hy there

 

I already have some help from olarila forum, however without sucess, i try dsdt and patched applehda but don't know why the applehda doens't load, only hdacontroller... the finally result is that i never get the sound work

 

I have 10.9 chipset 80821H with audio coded AD1988 (not B) anyone can help me?

 

Thanks

Link to comment
Share on other sites

I already have some help from olarila forum, however without sucess, i try dsdt and patched applehda but don't know why the applehda doens't load, only hdacontroller... the finally result is that i never get the sound work

 

I have 10.9 chipset 80821H with audio coded AD1988 (not B) anyone can help me?

I haven't heard of 80821H before. I'd first search to see if anyone has already built a pinconfig/pathmap for such an audio chip (seems like maybe that's just an HP part number not an audio chip/codec)?

Else follow the thread I linked to in post #1 in the "What this thread is not" section.

Link to comment
Share on other sites

The codec is actually Analog Devices AD1988B as stated in the post. As far as I remember the device ID 11D4:198B is already in the binary (little endian 8B19d411 as usual) so you don't even need to use the script from this thread for that particular codec. Should be fairly easy to get a semi working pathmap and pinconfig data for it and further fine tune it.

Link to comment
Share on other sites

@BCC9 the 80821h is the intelchipset 8r from the board, the audio codec is AD1988 (not AD 1998B @TimeWalker75a) and that is my main problem, i only find patch versions for AD1998B and that versions don't work with mine :(

 

This is my board, http://www.asus.com/Motherboards/P5BPlus_Vista_Edition/#specifications and no i don't believe it is easy to get it to work... mirone already try help me and we can't put put it to work..

Link to comment
Share on other sites

You need to be more careful with your reading, I never mentioned 1998B. Your codec is a legacy AD1988A (that's revision A) then and nobody has ever made it work with AppleHDA due to reasons unknown. Back in the day only line-out was possible through use of Azalia. Your best bet right now would be Voodoo, but that's way off topic here.

Link to comment
Share on other sites

The codec is actually Analog Devices AD1988B as stated in the post. As far as I remember the device ID 11D4:198B is already in the binary (little endian 8B19d411 as usual) so you don't even need to use the script from this thread for that particular codec. Should be fairly easy to get a semi working pathmap and pinconfig data for it and further fine tune it.

I see a B there :P and i type the wrong number :P

Anyway thanks for your help, i'm try both of them (at a time of course...) but can't put it work with anyone of them..

Link to comment
Share on other sites

I even tried

Fix AppleHDA for your ADI1988 codec.

unsuccessfully, the pathmaps / pinconfigs are etamentes

such as ADI1988B itself but still does not work.

in your DSDT had no device HDEF and added myself to it.

there is something strange'm still analyzing.

Link to comment
Share on other sites

Can I use this for Realtek ALC275 and the HDMI audio out for my Laptop? Thanks.

 

I also have RealTek ALC275

 

To date I've been using an old Snow Leopard AppleHDA patched for ALC275 which does work under ML & Mavericks but would love to get a native 10.9.0 AppleHDA working, has anybody had any success using this tool for ALC275 ?

 

Cheers

Jay 

Link to comment
Share on other sites

I also have RealTek ALC275

 

To date I've been using an old Snow Leopard AppleHDA patched for ALC275 which does work under ML & Mavericks but would love to get a native 10.9.0 AppleHDA working, has anybody had any success using this tool for ALC275 ?

 

Cheers

Jay

Show me the patch you used for 10.7 for alc275 and we can add it to patch-hda-codecs.pl. Probably it works with the default choice of adi1984, and you can just test that for us and report back.

You do of course need to migrate your layout/pathmap to the new format. That should be straightforward if you really have a working AppleHDA config already. But this thread isn't for layout/pathmap discussion, there are plenty of existing threads for that.

Link to comment
Share on other sites

Show me the patch you used for 10.7 for alc275 and we can add it to patch-hda-codecs.pl. Probably it works with the default choice of adi1984, and you can just test that for us and report back.

You do of course need to migrate your layout/pathmap to the new format. That should be straightforward if you really have a working AppleHDA config already. But this thread isn't for layout/pathmap discussion, there are plenty of existing threads for that.

 

@Bc9,

 

That would be great and i'll be happy to test and report back for you. The attached archive has my latest codec dump from Linux as well as my old but working SL solution and my current DSDT. I'm still having a hard time getting my head around the layout/pathmap edits, can you recommend a good guide ?. I've tried many times to copy the layout/pathmap from the old (working) SL solution but none of the guides really show how to convert it, as the verb info seems to be in a totally different format ?.

 

It would be great to get to the stage where i have the tools and edits in order to patch a new AppleHDA as and when they come out, even more so now that Mavericks is here which is the target platform for me at the moment.

 

I'm pretty confident in most area's of working on HackingTosh such as DSDT editing/patching and kext/plist edits ..etc. However,  ApplHDA just seems to continually confound me, there are many guides but the ones i've used so far don't go into quite enough detail for me to understand the whole process, I think this is partly to do with the fact that ALC275 is not so common. I think its really great that your creating a tool that helps to automate the binary patching side of things.

 

Cheers

Jay

Sony-SE_ALC275.zip

Link to comment
Share on other sites

 Share

×
×
  • Create New...