Jump to content

Updating yours AppleHDA


  • Please log in to reply
45 replies to this topic

#1
Mirone

Mirone

    InsanelyMac Deity

  • Local Moderators
  • 1,831 posts
  • Gender:Male
  • Location:Brazil
 
                                                               140619020937263817.png
 
 
 
 .This tutorial is to explain a simple way to update your AppleHDA for the current version of your system.
 . This is a tutorial  " Do it your self " it means that I will not do the work for you.
 
   To update your AppleHDA you will need to replace 3 files and make a correction in the AppleHDA binary.
   The files to be replaced are:
 
   1-Layout x.xml.zlib (Where "X" is the number of your layout can be 1,2,3,4,12 ... etc.)
   2-Platforms.xml.zlib
   3-The values ​​inside Plist of AppleHDA.kext / Plugins / AppleHDAHardwareConfigDriver.kext.
 
. FIRST: Copy Layout"x".xml.zlib e Platforms.xml.zlib in Resources folder inside AppleHDA.kext copy the two to Resources folder in the kext you gonna update.
 
. NOTE: To Know your LayoutID in use go to system info / Audio. 
Example : This is layout id is 4 so is layout4.xml.zlib.
 
 
post-702532-0-81775800-1385421471.png
 
. SECOND: Copy the values inside Plist from AppleHDA.kext/Plugins/AppleHDAHardwareConfigDriver.kext./Contents/Info.plist copy the values inside key IOKitPersonalities/HDA Hardware Config Resource/HDAConfigDefault
 
post-702532-0-15940400-1385421882.jpg
 
. THIRD: Finally we fix the AppleHDA.kext binarie found in: AppleHDA.kext / MacOS.
for this we use the Script de bcc9
 
Copy the folder into desktop and with already edited and installed AppleHDA.kext in S/L/E go terminal and do this commands:
cd ~/desktop/patch-hda
./patch-hda.pl 10ec0887
. NOTE:  Open the folder hda-patch-hda-codecs.pl file inside it is all supported codecs for the script for more information: Script to patch AppleHDA binary for osx10.7/10.8/10.9
 
A tip if your codec is not supported by the script you can try to fix manually using a binary editor like HexFiend and replace one of the codecs used, by correction for you.
In the example above was corrected binary for ALC887-VD codec if you are correct for your codec is necessary to replace the 10ec0887 by the id of your codec.
In binary they are written from right to left ie 10ec0887 = 8708ec10.
 
. IMPORTANT:
 
The Mountain Lion kext / Mavericks have a new structure and the files are compressed in. Zlib to unpack and edit these files will use zlib.
This application is based on RevoGirl script, it makes the process of files. Zlib from AppleHDA.kext to decompress / compress easier. Just drag the file zlib. The application and it will unzip or drag the xml file. And it will compress to. Zlib.
So if you own an old kext from Lion can compress files using this APP.Download Zlib.
 
After is only repair permissions and rebuild caches using KextWizard
 
Credits: RevoGirl, bcc9.


#2
pokenguyen

pokenguyen

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 452 posts
  • Gender:Male

Piker_alpha introduced a way to reduce step 1 and step 2 for new update, we only need to patch AppleHDA by bcc9 after update.



#3
Mirone

Mirone

    InsanelyMac Deity

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

LegacyAppleHDAHardwareConfigDriver.kext?

Two methods work,

you are free to choose between them.


#4
pokenguyen

pokenguyen

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 452 posts
  • Gender:Male

 

LegacyAppleHDAHardwareConfigDriver.kext?

Two methods work,

you are free to choose between them.

 

http://pikeralpha.wo...-kext-patching/



#5
Mirone

Mirone

    InsanelyMac Deity

  • Local Moderators
  • 1,831 posts
  • Gender:Male
  • Location:Brazil
What I understand is that it creates a legacy kext.
but every update of AppleHDA you do not
would have to do the same process to update the kext?
In my topic explain how to pass from that old kext
Lion to version Mavericks.


#6
Pike R. Alpha

Pike R. Alpha

    InsanelyMac Geek

  • Developers
  • 232 posts
  • Gender:Male

 

What I understand is that it creates a legacy kext.
but every update of AppleHDA you do not
would have to do the same process to update the kext?
In my topic explain how to pass from that old kext
Lion to version Mavericks.

 

It is not a legacy kext and people who use a symbolic link to AppleHDA won't have to do a thing, because they let the boot loader patch AppleHDA i.e. only people who copy AppleHDA into AppleHDA8Series.kext/C*/MacOS – or whatever name they use – may have to replace AppleHDA after an OS update, and then they may need to patch it – like they normally would do. 



#7
Mirone

Mirone

    InsanelyMac Deity

  • Local Moderators
  • 1,831 posts
  • Gender:Male
  • Location:Brazil
interesting
Pike R. Alpha
but you said it's possible to do the same for other kexts correct?
this is the good side of everything!


#8
Pike R. Alpha

Pike R. Alpha

    InsanelyMac Geek

  • Developers
  • 232 posts
  • Gender:Male

Yes. I have one with all required kexts for my motherboard in the PlugIns folder. Everything tidied up in one kext so to speak.



#9
JUN Ho

JUN Ho

    InsanelyMac Protégé

  • Members
  • Pip
  • 41 posts

There is simpler way for auto patching of AppleHDA.kext, when you are use clover.

Clover supports custom rc scripts, so you can make your own custom rc script for AppleHDA.kext auto patch.

I attach my custom rc script : '50.custom.local'

Open it using text editor, and moditfy it.

You have to change scripts according to your system sound chip, and where to put needed files for patching.

In my case, my system sound uses ALC 889. 

I make "patch" folder on "DATA" partion, and I put 3 files (Platforms.xml.zlib, layout1.xml.zlib, and info.plist of AppleHDAHardwareConfigDriver.kext) in that folder.

You have to put your '50.custom.local' file in etc/rc.shotdown.d/

 

If you want to test it patches correctly, just install non patched original AppleHDA.kext using Kext Utility, and reboot.

That's it !

 

Attached Files



#10
philip_petev

philip_petev

    InsanelyMac Protégé

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

 

ej3z.png
* This tutorial is to explain a simple way to update your AppleHDA for the current version of your system.
* This is a tutorial  " Do it your self " it means that I will not do the work for you.
 
   To update your AppleHDA you will need to replace 3 files and make a correction in the AppleHDA binary.
   The files to be replaced are:
 
   1-Layout x.xml.zlib (Where "X" is the number of your layout can be 1,2,3,4,12 ... etc.)
   2-Platforms.xml.zlib
   3-The values ​​inside Plist of AppleHDA.kext / Plugins / AppleHDAHardwareConfigDriver.kext.
 
First: Copy Layout"x".xml.zlib e Platforms.xml.zlib in Resources folder inside AppleHDA.kext copy the two to Resources folder in the kext you gonna update.
Note: To Know your LayoutID in use go to system info / Audio. 
Example : This is layout id is 4 so is layout4.xml.zlib.
 
 
post-702532-0-81775800-1385421471.png
 
Second: Copy the values inside Plist from AppleHDA.kext/Plugins/AppleHDAHardwareConfigDriver.kext./Contents/Info.plist copy the values inside key IOKitPersonalities/HDA Hardware Config Resource/HDAConfigDefault
 
post-702532-0-15940400-1385421882.jpg
 
Third: Finally we fix the AppleHDA.kext binarie found in: AppleHDA.kext / MacOS.
for this we use the Script de bcc9
 
Copy the folder into desktop and with already edited and installed AppleHDA.kext in S/L/E go terminal and do this commands:
cd ~/desktop/patch-hda
./patch-hda.pl 10ec0887
Note:  Open the folder hda-patch-hda-codecs.pl file inside it is all supported codecs for the script for more information: Script to patch AppleHDA binary for osx10.7/10.8/10.9
 
A tip if your codec is not supported by the script you can try to fix manually using a binary editor like HexFiend and replace one of the codecs used, by correction for you.
In the example above was corrected binary for ALC887-VD codec if you are correct for your codec is necessary to replace the 10ec0887 by the id of your codec.
In binary they are written from right to left ie 10ec0887 = 8708ec10.
 
*Important:
 
The Mountain Lion kext / Mavericks have a new structure and the files are compressed in. Zlib to unpack and edit these files will use zlib.
This application is based on RevoGirl script, it makes the process of files. Zlib from AppleHDA.kext to decompress / compress easier. Just drag the file zlib. The application and it will unzip or drag the xml file. And it will compress to. Zlib.
So if you own an old kext from Lion can compress files using this APP.Download Zlib.
 
After is only repair permissions and rebuild caches using KextWizard
 
Credits: RevoGirl, bcc9.

 

Heh, this is the same technique I'm using in the HP ProBook Installer to patch AppleHDA.kext. :D



#11
Edkroket

Edkroket

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 132 posts
  • Gender:Male
  • Location:Amsterdam
  • Interests:Music, I'm a bass player

There is simpler way for auto patching of AppleHDA.kext, when you are use clover.
Clover supports custom rc scripts, so you can make your own custom rc script for AppleHDA.kext auto patch.
I attach my custom rc script : '50.custom.local'
Open it using text editor, and moditfy it.
You have to change scripts according to your system sound chip, and where to put needed files for patching.
In my case, my system sound uses ALC 889. 
I make "patch" folder on "DATA" partion, and I put 3 files (Platforms.xml.zlib, layout1.xml.zlib, and info.plist of AppleHDAHardwareConfigDriver.kext) in that folder.
You have to put your '50.custom.local' file in etc/rc.shotdown.d/
 
If you want to test it patches correctly, just install non patched original AppleHDA.kext using Kext Utility, and reboot.
That's it !

Hi I'm very interested in this methode.
I know how to change paths and so on to point at the right files but I have three questions
1- I know my layout ID =1 and I have ALC 892 but what do I change to what in regarding my 892 codec
2- On my System 10.9.1 there is no etc/rc.shotdown.d/ ??
3- How do I config this 50.custom.local script in Clover config file?
 
I want to put the 3 files (Platforms.xml.zlib, layout1.xml.zlib, and info.plist of AppleHDAHardwareConfigDriver.kext) on the EFI Partition where CLOVER is.
 
Could you point me or help me?
 
Thanks in advance.
Ed
 
Here is my config file.Attached File  config.plist.zip   1.35KB   13 downloads

 

 



#12
JUN Ho

JUN Ho

    InsanelyMac Protégé

  • Members
  • Pip
  • 41 posts

@Edkroket

Sorry for late ^^

1. If you use Layout ID =1 following Toleda's patch, then  bianary patch script is simple.

    Just change 889 to 892 as like this.

 

    if [[ `perl -le "print scalar grep /\x8b\x19\xd4\x11/, <>;" "/System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA"` > 0 ]]; then

 
    perl -pi -e 's|\x8b\x19\xd4\x11|\x92\x08\xec\x10|g' "/System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA" 
 and 
    echo "ALC889 is newly patched"   --> echo "ALC892 is newly patched"
 
2. You have to chose option "Install RC Scripts on target volumes " when you use installer package, then it will makes  etc/rc.shotdown.d/
3. You don't need anything change on your config.plist. Just inject your Layout ID at Device/Audio (You are already done)
4. You can Put 3 files in EFI partition, but in that case you have to set up to mount EFI partition always. When the EFI partition unmounted, the patch doesn't work. I think use other place is better.(Make patch folder, and make that folder invisible on the finder.).
It's your choice.

 

 

 



#13
Edkroket

Edkroket

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 132 posts
  • Gender:Male
  • Location:Amsterdam
  • Interests:Music, I'm a bass player

@ JUN Ho

 

Thanks anyway!

I'm gonna try that later this week and let you know!



#14
Edkroket

Edkroket

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 132 posts
  • Gender:Male
  • Location:Amsterdam
  • Interests:Music, I'm a bass player

 

@Edkroket

Sorry for late ^^

1. If you use Layout ID =1 following Toleda's patch, then  bianary patch script is simple.

    Just change 889 to 892 as like this.

 

    if [[ `perl -le "print scalar grep /\x8b\x19\xd4\x11/, <>;" "/System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA"` > 0 ]]; then

 
    perl -pi -e 's|\x8b\x19\xd4\x11|\x92\x08\xec\x10|g' "/System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA" 
 and 
    echo "ALC889 is newly patched"   --> echo "ALC892 is newly patched"
 
2. You have to chose option "Install RC Scripts on target volumes " when you use installer package, then it will makes  etc/rc.shotdown.d/
3. You don't need anything change on your config.plist. Just inject your Layout ID at Device/Audio (You are already done)
4. You can Put 3 files in EFI partition, but in that case you have to set up to mount EFI partition always. When the EFI partition unmounted, the patch doesn't work. I think use other place is better.(Make patch folder, and make that folder invisible on the finder.).
It's your choice.

 

OK I've sorted it out!

changed your 50.custom.local with my used paths like this;

if [[ `perl -le "print scalar grep /\x8b\x19\xd4\x11/, <>;" "/System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA"` > 0 ]]; then
 
    perl -pi -e 's|\x8b\x19\xd4\x11|\x92\x08\xec\x10|g' "/System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA"
 
    cp "/Volumes/Backup 2 TB/Patch/Platforms.xml.zlib" "/System/Library/Extensions/AppleHDA.kext/Contents/Resources"
    cp "/Volumes/Backup 2 TB/Patch/layout1.xml.zlib" "/System/Library/Extensions/AppleHDA.kext/Contents/Resources"
    cp "/Volumes/Backup 2 TB/Patch/info.plist" "/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHardwareConfigDriver.kext/Contents"

    touch "/System/Library/Extensions"
    echo "ALC892 is newly patched"
else
    echo "already patched"
fi
 

And first I had no audio although I could see that AppleHDA.kext was changed.

I checked console and saw permissions and WARNING - Invalid signature -67061 0xFFFFFFFFFFFEFA0B for kext "/System/Library/Extensions/AppleHDA.kext"

Than I extracted a original AppleHDA.kext with Pacifist and installed it in S/L/E/

repaired permissions and rebooted and hey now I have Audio!

 

Thank you my friend this will save me a lot of trouble when updating to newer OS.

 

Ed



#15
Edkroket

Edkroket

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 132 posts
  • Gender:Male
  • Location:Amsterdam
  • Interests:Music, I'm a bass player

@ JUN Ho

 

I've just installed 10.9.2 and found out that S/L/C needs to be emptied and rebuild.

I try to make it in the script but it doesn't work yet.

Here is my example of 40.custom.local

 

#!/bin/sh


# AppleHDA Patch
 
   if [[ `perl -le "print scalar grep /\x8b\x19\xd4\x11/, <>;" "/System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA"` > 0 ]]; then
 
    perl -pi -e 's|\x8b\x19\xd4\x11|\x92\x08\xec\x10|g' "/System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA"
 
    cp "/Volumes/Backup 2 TB/Patch/Platforms.xml.zlib" "/System/Library/Extensions/AppleHDA.kext/Contents/Resources"
    cp "/Volumes/Backup 2 TB/Patch/layout1.xml.zlib" "/System/Library/Extensions/AppleHDA.kext/Contents/Resources"
    cp "/Volumes/Backup 2 TB/Patch/info.plist" "/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHardwareConfigDriver.kext/Contents"

    rm -fr "/System/Library/Caches/*"
    touch "/System/Library/Extensions"
    echo "ALC892 is newly patched"
else
    echo "already patched"
fi

 

Is there a typo?

 

Ed



#16
JUN Ho

JUN Ho

    InsanelyMac Protégé

  • Members
  • Pip
  • 41 posts

I didn't try it on 10.9.2 yet. I don't know Apple change AppleHDA binary of 10.9.2 .

If they change the binary , then we have to find bianary patch code again.



#17
Edkroket

Edkroket

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 132 posts
  • Gender:Male
  • Location:Amsterdam
  • Interests:Music, I'm a bass player

I didn't try it on 10.9.2 yet. I don't know Apple change AppleHDA binary of 10.9.2 .

If they change the binary , then we have to find bianary patch code again.

My question was about the deleting of the cache files in S/L/C and rebuild them!

I can tell you the same script work wit the developer preview of 10.9.2 as I have perfect sound.

But I need to remove these cache files and restart the machine to have the newly patched kext to work.

 

The whole idea of this is not needing to replace AppleHDA.kext again and have no sound when updating OS.

I can live with moving caches to trashe by hand and restart but it could be automated I guess!?

 

So take a look at my/your modified script for the last part if you want to?

 

Thanks again! It helps me very much for future updates.

 

Regards Ed



#18
JUN Ho

JUN Ho

    InsanelyMac Protégé

  • Members
  • Pip
  • 41 posts

When you update system using appstore, it downloads and installs update files.

After that the scripts of custom.rc.local recognizes AppleHDA.kext is changed, then it starts patch.

The cache is rebuild when the system is update, so you don't need to delete cache and rebuild by hand. Just update and reboot.



#19
Edkroket

Edkroket

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 132 posts
  • Gender:Male
  • Location:Amsterdam
  • Interests:Music, I'm a bass player

There was another beta update today and I installed as usual and saw in console that AppleHDA was patches again.

I still need to restart to take changes affect but 'till now I'm so happy with this script patch.

This is realy so easy!  :)

 

Why do I look like the only one being happy about this???



#20
Mirone

Mirone

    InsanelyMac Deity

  • Local Moderators
  • 1,831 posts
  • Gender:Male
  • Location:Brazil
I believe that all methods here 
are of great advantage. 
Enjoy!






3 user(s) are reading this topic

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