New style of AppleHDA.kext patching (take III)

A month ago I published a first blog article about a New style of AppleHDA.kext patching and two weeks ago in a New style of AppleHDA.kext patching (take II) I started to get a lot more feedback and as a result we now have a much better script. One that really works.

In this blog article, called a New style of AppleHDA.kext patching (take III) I would not only like to thank the people who helped me, like Toleda, but I would also like to ask all of you to give the next version a go – committed later today.

I’d also like to stress that my days are slowly counting down so please, please report bugs and other possible suggestions to make the script even better.

Update:
Done. Version 2.4 has been committed into my repository. Please test this version and report bugs here: https://github.com/Piker-Alpha/AppleHDA8Series.sh/issues

Edit:
Link to Github issues was broken. Now fixed.

Thank you!

38 thoughts on “New style of AppleHDA.kext patching (take III)

  1. Hello mate!!At first let me give you my kudos for the wonderfull train of thought of yours..It has so much potential!

    Secondly,I have a question.Is there any chance that you could implement a mode for those of us with unsupported codecs?Im not a novice or a pro neither,but what if I provide the configdata,a binary patch and the codec name,then,wouldnt it be possible to successfully create a kext?

    I would love such an addition to your script,me and the gazillion unlucky users with crappy codecs:P

    Best wishes from Greece,Angel:)

      • Thanks for the quick reply!!Im happy to say that i found that the correct bin patches for ALC662 and made me a kext and my day:P
        What I did was I patched ALC662 as ALC885 and ALC662 as ALC884.Plus layout 12 of course..In case you embed it in your script:D

  2. Here’s my test for v. 2.4
    – ASRock Z77E ITX, Intel i7 3770s, HD4000, Realtek® ALC898 codec
    With ./AppleHDA8Series.sh -b AppleHDA -b AppleHDAController it’s ok, but with ./AppleHDA8Series.sh -b AppleHDA:\x85\x08\xec\x10,\x85\x08\xec\x10 nothing is showing in audio output.
    The same for GA-Z87M- D3H, intel 4770s, HD4600, Realtek® ALC892 codec.

    • That is correct. The new option -b AppleHDA:\x85\x08\xec\x10,\x85\x08\xec\x10 was added to let people proceed, as in copy the AppleHDA binary from AppleHDA.kext but it won’t do any bin-patching on this binary. Hence the message:

      Warning: Search and replace patterns are the same!
      AppleHDA will be copied but will NOT be patched!

  3. What about clover boot loader? On Asus Z87i Pro, intel i7 4770s, HD4600, Realtek® ALC1150 codec, with simply ./AppleHDA8Series.sh, that doesn’t work. What am I missing, Pike?

  4. Hi Pike

    Nicely done 🙂
    I think its better to add one more flag to automate the process, or i just don’t know to put it

    ************************************************************
    The available Info.plist files for the ALC 887 are:

    [1] /tmp/887/Info-84.plist
    [2] /tmp/887/Info-85.plist
    [3] /tmp/887/Info-90.plist
    [4] /tmp/887/Info-91.plist

    Please choose the matching Info.plist (1/4)
    ***********************************************************

    • And This process is already automated i.e. the list with available files will only be shown if the OS version doesn’t match with any of the available plist files. So are you perhaps using OS 10.9.2 If yes… Toleda normally adds the plist after the OS is officially released.

  5. How can I help to make it work for ALC269VC too? I have codec dumps from Linux and from Windows registry, and also a working patched AppleHDA.kext (10.9.1)

  6. Checking the script, whats the difference of having \x8b\x19\xd4\x11|\x87\x08\xec\x10
    to be replace by our own choice of codec instead of \x85\x08\xec\x10|\x87\x08\xec\x10
    ?

  7. I try to patch alc 887 with ur script but wont work.

    [1] /tmp/887/Info-84.plist
    [2] /tmp/887/Info-85.plist
    [3] /tmp/887/Info-90.plist
    [4] /tmp/887/Info-91.plist

    you can detect info.plist by command “sw_vers -productVersion”.

    /tmp/887/Info-84.plist as 10.8 – 10.8.4
    /tmp/887/Info-85.plist as 10.8.5
    /tmp/887/Info-90.plist as 10.9.0
    /tmp/887/Info-91.plist as 10.9.1

    If I fixed you script and work for me can I fork (Modify) your script.
    I love your solution the way patch AppleHDA.
    But I want GUI with AppleScript.
    I need to fork it if its work for me.

    • What exactly doesn’t work for you?

      I already use “gProductVersion=”$(sw_vers -productVersion)” on line 209 so I wouldn’t know what it is that you want to “fix”.

      About the GUI. AppleScript is rubbish.

      • You seem to forget that the script is written for a wide audience. People with different versions of OS X and thus they want to be able to select a plist for a certain version of OS X, but this is only supported by boot loaders that can bin-patch the executable(s).

        Note: The script uses the plist files provided by Toleda and I won’t make any changes that may make it break for other people. Not to mention that you fail to state what the problem is so I cannot help you.

  8. – [[ $(cat /tmp/HDEF.txt | grep -o “PinConfigurations”) == “PinConfigurations” ]]
    +[[ $(cat /tmp/HDEF.txt | grep -c “PinConfigurations”) > 0 ]]

    I inject FakeSMC.kext By CloverEFI on EFI Partition.
    I try to copy FakeSMC.kext to /S/L/E. to Emulate this script.
    but same result.

    Looking in /System/Library/Extensions/FakeSMC.kext for ConfigData
    Error: ConfigData NOT found
    [code]
    
    first time  I try to Emulate /S/L/E/ 
    [code]
    sudo sh /Users/xenatt/Documents/a8patch.sh  -a 887 -l 1 -d /Users/xenatt/Desktop/ALC887 
    
    AppleHDA8Series.sh v2.4 Copyright (c) 2013-2014 by Pike R. Alpha
     patched XML files by Toleda and contributors
    ----------------------------------------------------------------
    Error: Invalid argument detected: -d /Users/xenatt/Desktop/ALC887 Aborting ...
    Done. 
    
    

    Screenshot

    ![Screenshot](https://lh5.googleusercontent.com/-QEpcnRmcyCw/Uu9AQ0tC3dI/AAAAAAAAC3g/QK1vIXcbBmI/w1231-h732-no/Screen+Shot+2557-02-03+at+14.07.16.png)

    • I don’t know what you are doing but /tmp/HDEF.txt is created by the script using:
      ioreg -rw 0 -p IODeviceTree -n HDEF > /tmp/HDEF.txt
      and thus there is only one PinConfigurations property. Not two or more.

    • There is only one HDEF device which is what ioreg -rw 0 -p IODeviceTree -n HDEF extracts and saves to /tmp/HDEF.txt The same file that is checked for PinConfigurations and thus there is only one.

  9. Updating to 10.9.2 made me loose audio. I was pretty sure that this method was “system update” safe. What am I missing?

    • That depends mainly on the boot loader. I mean Chameleon cannot bin-patch the executables but RevoBoot and Clover can and then you don’t need (a) symbolic link(s) or patched executables, which I presume is the problem.

  10. Hey Pike, thanks for this script, its really cool 🙂
    Did not dive yet into clover or revoboot so I’m with chameleon for now. I ran ./AppleHDA8Series.sh -b AppleHDA and restarted when it was done. Sounds works perfectly. 🙂

    Now, excuse my newbieness but how sound its working when AppleHDA.kext is not loaded? Not even the AppleHDA892.kext that its the one produced by the script.

    Thanks again for your time.

  11. Pingback: New style of AppleHDA.kext patching for Yosemite | Pike's Universum

  12. Hi Pike. I’m in the middle of transferring a computer from an old Chameleon bootloader to the newest Clover one, I’m still using an USB for the bootloader instead of the EFI partition. Should I then target /Volumes/USB/EFI/CLOVER/kexts/10.9/ instead of /S*/L*/E* ?

Leave a comment