Jump to content

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

AppleHDA binary patch

  • Please log in to reply
133 replies to this topic

#41
Mirone

Mirone

    InsanelyMac Legend

  • Local Moderators
  • 1,342 posts
  • Gender:Male
  • Location:Brazil

Hello!!
Can I use this script for patching for ALC268??? I tried every possible combination on the script, but no result, and every patched AppleHDA around available for ML is actually from Lion...
Thanks!!!


For ALC268:
replace 8b19d411 -> 6802ec10
replace: 8419d411 -> 00000000

#42
kidalive

kidalive

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 260 posts
  • Gender:Male

Thanks, hope it works out that way. It can if the codec list gets further contributions.

bcc9, this is not working on my VIA VT2021 of my motherboard.

#43
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,277 posts
  • Gender:Male

bcc9, this is not working on my VIA VT2021 of my motherboard.

This script can patch the AppleHDA binary for the via vt2021 codec; I've tested it with a gigabyte z77mx-d3h system.  Of course you do also have to patch your Platforms.xml & layout xml as part of a complete solution.  This script makes upgrading between OSX releases easy in that you only have to copy over your xml changes and re-run the script to migrate to the latest AppleHDA.



#44
joe2108

joe2108

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 102 posts

This script can patch the AppleHDA binary for the via vt2021 codec; I've tested it with a gigabyte z77mx-d3h system.  Of course you do also have to patch your Platforms.xml & layout xml as part of a complete solution.  This script makes upgrading between OSX releases easy in that you only have to copy over your xml changes and re-run the script to migrate to the latest AppleHDA.

I got this but I don't know how to apply on xml

 

Attached File  Screen Shot 2013-06-26 at 2.52.01 PM.png   13.51KB   11 downloads

 

Attached File  Result.zip   43.24KB   13 downloads

 

could you help me patch the xml..

 

or maybe just point me how to next

 

thanks



#45
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,277 posts
  • Gender:Male

could you help me patch the xml..
 
or maybe just point me how to next

Writing the pathmap from scratch is time consuming and beyond the scope of this thread, I referenced a starting point in post #1. For ordinary users who do not wish to read up on the details, you can usually search and find someone who has already written the xml for your exact model of motherboard.

There are several existing configs posted for via vt2021 codec systems. Once someone has written the first one for a codec, the tweaks required to support different layouts for different hardware using the same codec are usually simple enough for people to make without starting from scratch. But even that's beyond the scope of this thread and I don't have time to help on that.

#46
necrophagous

necrophagous

    InsanelyMac Protégé

  • Members
  • PipPip
  • 66 posts
  • Gender:Male
  • Location:3rd World Country

What about alc 271x?



#47
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,277 posts
  • Gender:Male

What about alc 271x?

If someone has that codec working, they can contribute the change to patch-hda-codecs.pl here.
Notice that all the current ALC codecs in the patch database either use ALC 885 or ADI 1984, so those would be the obvious choices to test against.

#48
Mirone

Mirone

    InsanelyMac Legend

  • Local Moderators
  • 1,342 posts
  • Gender:Male
  • Location:Brazil

What about alc 271x?

Alc271x is nothing more than an ALC269.
the id is the same 0x10ec0269, you can use the same patch for it.


#49
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,277 posts
  • Gender:Male
Here's a new version of my AppleHDA binary patching script.   This version has 3 main improvements
  • The codec config database, patch-hda-codecs.pl has been simplified, so that it should be easier for users to make additions.  There are now two tables to maintain. First there is the codec_names_to_num table which provides the simple mapping between codec names and their codec id.  Second is codecs_map which maps one's hackintosh codec name to the runtime AppleHDA codec (target codec), again referenced by name.  This second table allows for multiple choices, so for example, the hackintosh realtek alc889 can be patched to either alc 885 or adi 1984.  -c 1 lets you select choice #1 (the default), -c 2 the second choice, and so on.
  • The internal codec match lists have been updated to include 10.9 support.
  • You can now specify a codec ID that is not already in patch-hda-codecs.pl, and the script will attempt to patch your codec to use the ADI 1984 choice (the most common).  For example, the following would patch a realtek alc801 codec
    ./patch-hda.pl 0x10ec0801
    OSX version 10.8 detected
    Couldn't find a codec map to apply for '0x10ec0801'.
    Would you like to try using ADI 1984 (the default) (Y/N)? y
    Patching AppleHDA codec 11d41984 with 10ec0801
    2 codec range comparison(s) to patch
    Patching range comparison 10ec0884
    Patching range comparison 10ec0885
    AppleHDA patched successfully.
    
I could use a little feedback, and assuming everything's fine, I'll then clean up post #1 with this version.

Update: Moved to post #1. See new version there.

#50
philip_petev

philip_petev

    InsanelyMac Protégé

  • Members
  • PipPip
  • 72 posts
  • Gender:Male
  • Location:Haskovo, Bulgaria

It seems I'm first.

works like a charm on 10.8.1 and 10.8.4 (executed from the shell) and on 10.8.1 and 10.8.2 (executed from the ProBook Installer).



#51
PiSToLBR

PiSToLBR

    InsanelyMac Protégé

  • Members
  • Pip
  • 43 posts
  • Gender:Male
  • Location:Brazil - Recife - PE

Can I use this to patch AppleHDA for AD2000b (  Asus MB) ?



#52
k3nny

k3nny

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 538 posts
  • Gender:Male
@PiSToLBR: Yes, your chip is even listed in the example provided by bcc9

#53
PiSToLBR

PiSToLBR

    InsanelyMac Protégé

  • Members
  • Pip
  • 43 posts
  • Gender:Male
  • Location:Brazil - Recife - PE

@PiSToLBR: Yes, your chip is even listed in the example provided by bcc9

Thanks,

 

 Didn't see that at first. Managed to patch and It worked. Thank you for this good work.



#54
thuvn205

thuvn205

    InsanelyMac Protégé

  • Members
  • Pip
  • 5 posts

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



#55
Johanmartin

Johanmartin

    InsanelyMac Protégé

  • Members
  • Pip
  • 38 posts

This tool does not work for ADI-Ad2000b. I followed instructions and no sound. Could anyone help me? Anyone got this tool working with ADI-AD2000b? Anyone got it working at all?



#56
k3nny

k3nny

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 538 posts
  • Gender:Male
@Johanmartin: Yes, PiSToLBR for example two posts before you. Using this script to patch the binary alone is not enough, read the first post.
You might want to take a look at the download section for a patched kext.

#57
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,277 posts
  • Gender:Male
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

#58
Mirone

Mirone

    InsanelyMac Legend

  • Local Moderators
  • 1,342 posts
  • Gender:Male
  • Location:Brazil
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!!


#59
darkera13

darkera13

    InsanelyMac Protégé

  • Members
  • Pip
  • 31 posts
  • Gender:Male

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?



#60
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,277 posts
  • Gender:Male

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.





1 user(s) are reading this topic

0 members, 1 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