Jump to content
nyolc8

AppleHDA patching in Mountain Lion

239 posts in this topic

Recommended Posts

Hi!

I always patching the latest AppleHDA for my ALC662 codec. I tried to patch AppleHDA in Mountain Lion with the same method like before, using these binary patches:

 

sudo perl -pi -e 's|\x84\x19\xd4\x11|\x62\x06\xec\x10|g' /System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA


sudo perl -pi -e 's|\x83\x19\xd4\x11|\x00\x00\x00\x00|g' /System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA

 

Then I made my patched layout and platforms xml files to zlib with revogirl's converter. And changed everything like before (plists in applehda, dsdt...) But it's not working.

 

I have the sound connectors listed perfectly in System Profiler > Sound (Intel High Definition Audio section), but the Devices section is empty there.

Do I need some extra binary patch for my sound? Or what could I do? I checked twice, and I made everything like before, but it's not working... I'm using my patched AppleHDA from 10.7.4 and Sound working with that one perfectly, but I want the newest kext patched if possible.

 

Can anyone help me find out what could be the problem with newest AppleHDA?

 

Edit.: I tried new binary patch from RevoGirl:

sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\xa7\x01\x00\x00|\x62\x06\xec\x10\x0f\x84\x68\x03\x00\x00|g' AppleHDA

sudo perl -pi -e 's|\x74\x19\xad\x15\x0f\x8f\x77\x01\x00\x00|\x00\x00\x00\x00\x0f\x84\x5d\x03\x00\x00|g' AppleHDA

sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x91\x01\x00\x00|\x62\x06\xec\x10\x0f\x84\x4a\x03\x00\x00|g' AppleHDA

sudo perl -pi -e 's|\x74\x19\xad\x15\x0f\x8f\x61\x01\x00\x00|\x00\x00\x00\x00\x0f\x84\x3f\x03\x00\x00|g' AppleHDA

But still not working. :(

 

Edit: works, see last post.

Share this post


Link to post
Share on other sites
Advertisement

I ran into the same problem with my ALC883. I had it working perfectly in 10.6.8 but couldn't get the binpatch/xml files to work in anything higher. So I've been using my 10.6.8 kext ever since.

 

Maybe some codecs were dropped in later builds of AppleHDA so binpatching doesn't work.

Share this post


Link to post
Share on other sites

ADI 1983 which you are trying to "zero out" is definitely not there anymore. Also ADI 1984 has had some checks implemented. That's why it fails to work. Try patching out the alc262 codec as it still has widget call in place.

Share this post


Link to post
Share on other sites

Also ADI 1984 has had some checks implemented. That's why it fails to work. Try patching out the alc262 codec as it still has widget call in place.

Thanks to this I finally have the current AppleHDA working with my ALC883 :)

 

I guess ALC885 must have some checks in place too, or has been nerfed in some other way. Binpatching ALC262 instead has got it working. Thanks for the info!

Share this post


Link to post
Share on other sites

Could you please help me what should I do to binpatch alc262? :$

 

I just need to do this in terminal:

sudo perl -pi -e 's|\x62\x02\xd4\x11|\x62\x06\xec\x10|g' /System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA

or something else?

 

Because I don't really understand the "xd4|x11" part....

 

edit: I just realized that x62|06 is not representing alc662... but how do i found out alc 262 codecid?

 

edit2.: nevermind, found the codecid, now I'll try...

 

edit3.: I tried binpatch alc262 without any zero-out, now even system profiler doesn't shows anything about sound.

Any help?

 

edit4.: I found these in console:

2012.07.12. 14:49:36,000 kernel[0]: Sound assertion in AppleHDAFunctionGroupFactory at line 143
2012.07.12. 14:49:36,000 kernel[0]: Sound assertion in AppleHDACodecGeneric at line 342

 

I used this binpatch:

sudo perl -pi -e 's|\x62\x02\xec\x10|\x62\x06\xec\x10|g' /System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA

Then I placed patched layout and platforms into resources (converted into zlib of course), then I modified the plist in AppleHDAHardwareConfigDriver.kext, (codec id, layout, pinconfig) but sound not working :/

 

When I binpatched ADI 1983 I got a list of my sound jack connectors in System Profiler and then I'm not getting this console messages. So maybe 262 is not the right choice for me to bin patch. But then what else could I binpatch? Or I need to stay on the Lion AppleHDA kext for my alc662?

Share this post


Link to post
Share on other sites

I used this binpatch:

sudo perl -pi -e 's|\x62\x02\xec\x10|\x62\x06\xec\x10|g' /System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA

That's the right command to patch ALC662 over ALC262. Did you make sure to use a fresh AppleHDA binary each time you tried binpatching?

 

Seeing as ALC262 worked for my ALC883 codec you would think you'd have no trouble with ALC662. But I'm no expert in the variations between the Realtek codecs.

Share this post


Link to post
Share on other sites
Because I don't really understand the "xd4|x11" part....

it's vendor id with bytes flipped. eg 0x11d4 which translates to AD (Analog Devices Inc.) whereas, as pointed out by Riley Freeman 0x10ec stands fro Realtek (the maker of ALC HD Audio chips)

When I binpatched ADI 1983 I got a list of my sound jack connectors in System Profiler and then I'm not getting this console messages.

Open up the binary w/ HexFiend for example and look for 83 19 d4 11 in the Find field. You will be surprised to find no occurrences of this codec in the binary.

 

Try patching out the Wolfson codec (ff 87 ec 1a) then. It works for ALC665 and ALC269, should be ok for you too.

Share this post


Link to post
Share on other sites

Sorry I mean ADI 1984.

But thanks for that wolfron codec, I'll try it.

Could you please tell me why is zero-out is needed exactly? Or how I know if I still need to zero-out something?

Share this post


Link to post
Share on other sites

You don't need to be zeroing out thing (it just done to avoid assertions) by any means.

I was able to achieve the same thing she did with


sudo perl -pi -e 's|\xff\x87\xec\x1a|\x69\x02\xec\x10|g' AppleHDA
sudo perl -pi -e 's|\x74\x19\xad\x15|\x92\x08\xec\x10|g' AppleHDA

sudo perl -pi -e 's|\x0f\x8f\x47\x02\x00\x00|\x0f\x84\xad\x01\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\x0f\x8f\xf1\x03\x00\x00|\x0f\x84\xa1\x01\x00\x00|g' AppleHDA

sudo perl -pi -e 's|\x0f\x8f\x2e\x02\x00\x00|\x0f\x84\xad\x01\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\x0f\x8f\xa6\x03\x00\x00|\x0f\x84\xa1\x01\x00\x00|g' AppleHDA

sudo perl -pi -e 's|\x83\x19\xd4\x11|\x00\x00\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\x84\x19\xd4\x11|\x69\x02\xec\x10|g' AppleHDA

by just using (patching out Wolfson here, see?)


sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x96\x02\x00\x00|\x69\x02\xec\x10\x0f\x84\xfc\x01\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x7d\x02\x00\x00|\x69\x02\xec\x10\x0f\x84\xfc\x01\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x97\x02\x00\x00|\x69\x02\xec\x10\x0f\x84\xcc\x01\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x7e\x02\x00\x00|\x69\x02\xec\x10\x0f\x84\xcc\x01\x00\x00|g' AppleHDA

And I have no assertions whatsoever. The only downside is .. you have to recalculate the binary patch each time the binary changes, because offsets change and so do the codec that are included, so the lines in the binary are not the same from version to version. This particular code snippet is only useful for 10.7.4 and won't do any good in 10.8 GM as the binary is arch x86_64 only now, so at least 2 of these lines are obsolete.

Share this post


Link to post
Share on other sites

Thanks, I tried to patch wolfson, and here's what I got:

caqH0.png

 

Devices section empty, but intel high definition audio section shows my jack connectors correctly. And No sound.

 

I got exactly this result when I bin patched ADI 1984. Any idea? :/

Share this post


Link to post
Share on other sites

Firs of all I see that your layout is set to be 662.

You can't do that in 10.8! You have to use one of the vanilla layouts (12 preferably) also path-map id should be from 1 to 5.

In most cases this is a key to success in enabling audio under 10.8. Correct this issues and report back.

Share this post


Link to post
Share on other sites

I set that to layout 12 everywhere:

 

- layout12.xml

- applehdahardwareconfigdriver.kext's info.plist

- dsdt.aml

 

And now I get this:

CFdh6.png

 

nothing changed, just the 662 became 12.

 

(pathmap was "1" before too)

Share this post


Link to post
Share on other sites

You don't need to be zeroing out thing (it just done to avoid assertions) by any means.

I was able to achieve the same thing she did with


sudo perl -pi -e 's|\xff\x87\xec\x1a|\x69\x02\xec\x10|g' AppleHDA
sudo perl -pi -e 's|\x74\x19\xad\x15|\x92\x08\xec\x10|g' AppleHDA

sudo perl -pi -e 's|\x0f\x8f\x47\x02\x00\x00|\x0f\x84\xad\x01\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\x0f\x8f\xf1\x03\x00\x00|\x0f\x84\xa1\x01\x00\x00|g' AppleHDA

sudo perl -pi -e 's|\x0f\x8f\x2e\x02\x00\x00|\x0f\x84\xad\x01\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\x0f\x8f\xa6\x03\x00\x00|\x0f\x84\xa1\x01\x00\x00|g' AppleHDA

sudo perl -pi -e 's|\x83\x19\xd4\x11|\x00\x00\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\x84\x19\xd4\x11|\x69\x02\xec\x10|g' AppleHDA

by just using (patching out Wolfson here, see?)


sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x96\x02\x00\x00|\x69\x02\xec\x10\x0f\x84\xfc\x01\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x7d\x02\x00\x00|\x69\x02\xec\x10\x0f\x84\xfc\x01\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x97\x02\x00\x00|\x69\x02\xec\x10\x0f\x84\xcc\x01\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x7e\x02\x00\x00|\x69\x02\xec\x10\x0f\x84\xcc\x01\x00\x00|g' AppleHDA

And I have no assertions whatsoever. The only downside is .. you have to recalculate the binary patch each time the binary changes, because offsets change and so do the codec that are included, so the lines in the binary are not the same from version to version. This particular code snippet is only useful for 10.7.4 and won't do any good in 10.8 GM as the binary is arch x86_64 only now, so at least 2 of these lines are obsolete.

 

Do I need that much binpatching? Because I only run this command:

 

sudo perl -pi -e 's|\xff\x87\xec\x1a|\x62\x06\xec\x10|g' /System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA

Share this post


Link to post
Share on other sites

@TimeWalker, what files must be patched? AppleHDA and AppleHDAController binaries only?

 

I tried to patch AppleHDA using the old method but like you said... it's useless. However i couldn't find what needs to be patched in the AppleHDAController binary with ALC665 chip.

 

Mind pointing me in the right direction plus some tips?

 

I'm on mountain lion and nothing is working for me, applehda or voodoohda.

Share this post


Link to post
Share on other sites

I'm asking because on Lion, all AppleHDA patched kext show evidence of Controller binary being patched as well, but i wasn't able to identify what was patched and what was not. And i can't really ask the patcher as the kexts appeared on the internet.. i suppose from some chinese forum.

Share this post


Link to post
Share on other sites

I have been patching the AppleHDA myself since Lion DP1 trough current 10.7.4 for ALC1200 (ALC888 technically) and recently (just in 10.7.4) for ALC269.

I have never touched the Controller plugin of the kext. Also take a look at what HDA Wizard is patching: http://puu.sh/If0O

 

Just /Resources/Platforms.xml (now xml.zlib), Resources/layoutXX.xml (zlib now as well) and lastly the Info.plist in AppleHDAHardwareConfigDriver.

Share this post


Link to post
Share on other sites

Hm, interesting. My codec also requires IOAudioFamily.kext being patched, do you have any idea about this kext?

Share this post


Link to post
Share on other sites

@TimeWalker75a, please tell me that I need only one command for binpatch, or I need that much as you wrote?

Share this post


Link to post
Share on other sites

Hm, interesting. My codec also requires IOAudioFamily.kext being patched, do you have any idea about this kext?

In fact I do. Take a look here

 

@nyolc8

I can't tell yet. I have't installed GM yet and not planning to until the sources will be out, it will be a couple of weeks after the official release.

Share this post


Link to post
Share on other sites

Oh, yes i've seen it. Unfortunately i need the sources to apply it... damnit i'm stuck with broken/dubstepping sound.

Share this post


Link to post
Share on other sites

My main OS was pretty much dead so i said why install lion only to reinstall ML next week.

Share this post


Link to post
Share on other sites

@nyolc8

I can't tell yet. I have't installed GM yet and not planning to until the sources will be out, it will be a couple of weeks after the official release.

Okay, then I use Lion's AppleHDA for sound until there is no solution :)

Share this post


Link to post
Share on other sites

Solved, needed two new binpatch, now works! :D

 

sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x53\x01\x00\x00|\x62\x06\xec\x10\x0f\x84\x1f\x01\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x2f\x01\x00\x00|\x62\x06\xec\x10\x0f\x84\xfb\x00\x00\x00|g' AppleHDA

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By ltooz_audis
      Some people do have problem understanding AppleALC, how to use it for their own codecs. Here's how I used it for both Realtek ALC and IDT audio codecs.
      https://youtu.be/ZNUzQkb6p5g
      For more info on Catalina click here.
      Cheers,
      Louis
    • By grisno
      Hi people,
       
      Installer to activate the sound card REALTEK ALC282-v2 (10ec:0282) with LayoutID 1 or 3 in MacOS. This installer does not contain AppleHDA patched Kext. To work properly, it must be installed over vanilla AppleHDA.kext.
       
      I want to thank the whole community for their efforts and content provided, because without these it would not be possible to create this installer.
       
      I would appreciate comments and suggestions!!
       
      Status:
      Speakers : OK Headphones : OK HDMI Audio : OK (Intel HD4K Tested) LineIn : N/A (Model Without LineIn) MicInt : OK MicIntNoiseReduction : OK MicExt : N/A (Model Without MicExt) AutoDetectLineIn : N/A (Model Without LineIn) Sleep : OK WakeUp : OK AutoSleep : OK Hibernate : OK Siri : OK   Tested Laptops:
       
      - HP Pavillion 15-D002SS
       
      Coming Soon:
       
      - Unified installer for the different supported operating systems.
      - Support model with LineIn jack.
       
      Modified Verbs:
      01271C20 01271D00 01271EA0 01271F90 01471C10 01471D00 01471E17 01471F90 01871CF0 01871D00 01871E00 01871F40 01E71CF0 01E71D00 01E71E00 01E71F40 02171C30 02171D10 02171E21 02171F00 01470C02   DSDT:
       
      Patch to apply with MaciASL in your DSDT
      ######################################### HDEF v1.00######################################## into method label _DSM parent_label HDEF remove_entry;into device label HDEF insertbeginMethod (_DSM, 4, NotSerialized)\n{\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "layout-id", Buffer() { 0x01, 0x00, 0x00, 0x00 },\n //"layout-id", Buffer() { 0x03, 0x00, 0x00, 0x00 },\n "hda-gfx", Buffer() { "onboard-1" },\n "PinConfigurations", Buffer() { },\n })\n}\nend;  
    • By grisno
      Hi people,
       
      This is a preliminary installer to activate the sound card IDT 92HD87B2/4 (111D:76D9) in MacOS. This new version of the installer does not contain AppleHDA patched Kext. To work properly, it must be installed over vanilla AppleHDA Kext.
       
      I want to thank the whole community for their efforts and content provided, because without these it would not be possible to create this installer.
       
      I would appreciate comments and suggestions!!
       
      Status:
      Speakers : OK Headphones : OK HDMI Audio : OK (Intel HD3K/4K Tested) LineIn : OK MicInt : OK MicIntNoiseReduction : OK MicExt : OK AutoDetectLineIn : OK Sleep : OK WakeUp : OK AutoSleep : OK Hibernate : OK Siri : OK   Tested Laptops:
       
      - HP Pavillion G6-2209SS
      - HP Probook 4440S
       
      Coming Soon:
       
      - Unified installer for the different supported operating systems
       
      Original Verbs:
      00a71cf0 00a71d00 00a71ef0 00a71f40 00b71c1f 00b71d10 00b71e21 00b71f04 00c71c20 00c71d10 00c71ea1 00c71f04 00d71c10 00d71d01 00d71e17 00d71f90 00f71cf0 00f71d00 00f71ef0 00f71f40 01171c30 01171d01 01171ea3 01171fd5   Modified Verbs Layer ID 3 & 12:
      00A71CF0 00A71D00 00A71EF0 00A71F40 01371C40 01371D10 01371E21 01371F04 00C71C20 00C71D10 00C71E81 00C71F04 01471C10 01471D01 01471E17 01471F90 00F71C50 00F71D00 00F71EF0 00F71F40 01171C30 01171D01 01171EA0 01171F90  
      Modified Verbs Layer ID 2:
      00B71C10 00B71D10 00B71E21 00B71F04 00C71C20 00C71D10 00C71E81 00C71F04 00D71C30 00D71D00 00D71E17 00D71F90 01171C40 01171D00 01171EA0 01171F90  
        AppleHDAHardwareConfigDriver.kext > Info.plist (Layer ID 2, 3 & 12): <key>HDAConfigDefault</key> <array> <dict> <key>AFGLowPowerState</key> <data> AwAAAA== </data> <key>Codec</key> <string>IDT 92HD87B2/4</string> <key>CodecID</key> <integer>287143641</integer> <key>ConfigData</key> <data> AKcc8ACnHQAApx7wAKcfQAE3HEABNx0QATce IQE3HwQAxxwgAMcdEADHHoEAxx8EAUccEAFH HQEBRx4XAUcfkAD3HFAA9x0AAPce8AD3H0AB FxwwARcdAQEXHqABFx+Q </data> <key>FuncGroup</key> <integer>1</integer> <key>LayoutID</key> <integer>2</integer> </dict> <dict> <key>AFGLowPowerState</key> <data> AwAAAA== </data> <key>Codec</key> <string>IDT 92HD87B2/4</string> <key>CodecID</key> <integer>287143641</integer> <key>ConfigData</key> <data> ALccEAC3HRAAtx4hALcfBADHHCAAxx0QAMce gQDHHwQA1xwwANcdAADXHhcA1x+QARccQAEX HQABFx6gARcfkA== </data> <key>FuncGroup</key> <integer>1</integer> <key>LayoutID</key> <integer>3</integer> </dict> <dict> <key>AFGLowPowerState</key> <data> AwAAAA== </data> <key>Codec</key> <string>IDT 92HD87B2/4</string> <key>CodecID</key> <integer>287143641</integer> <key>ConfigData</key> <data> ALccEAC3HRAAtx4hALcfBADHHCAAxx0QAMce gQDHHwQA1xwwANcdAADXHhcA1x+QARccQAEX HQABFx6gARcfkA== </data> <key>FuncGroup</key> <integer>1</integer> <key>LayoutID</key> <integer>12</integer> </dict> </array>   DSDT:
       
      Patch to apply with MaciASL in your DSDT. You must change the value of the layout-id before applying the patch. In MacOS Mojave should always be 0x02
      ######################################### HDEF ######################################## into method label _DSM parent_label HDEF remove_entry; into device label HDEF insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "built-in", Buffer () { 0x00 }, \n "hda-gfx", Buffer() { "onboard-1" }, \n "layout-id", Buffer () { 0x03, 0x00, 0x00, 0x00 }, \n "PinConfigurations", Buffer () {}, \n "MaximumBootBeepVolume", Buffer () { 0x4d } \n })\n }\n end;  
    • By warty
      On 8/20/2018 at 5:22PM, TessereKt said:
       
      On 8/21/2018 at 7:34AM, insanelyDeepak said:
       
      @insanelyDeepak, I would like to try cloverHDA, but I need help understanding how to use it.
       
      I have an Asus laptop that uses Realtek ALC295.
       
      My questions with regard to using cloverHDA:
      1.  I am running High Sierra (10.13.6). Is cloverHDA directly compatible? If not, can it easily be made compatible with adjustments I can apply?
       
      2.  What needs to be done with the original AppleHDA.kext that is already present in /S/L/E? Should it be left alone? Should it be removed? If it is removed, does the AppleHDA.kext that comes with cloverHDA, for example /Vanilla AppleHDA/Mac OS Sierra 10.12.6/AppleHDA.kext, need to be installed in its place?
       
      3.  In the 21 aug 18 reply to TessereKt, you mentioned "there is ALCPluxfix must install this." I noticed that there is a directory for alc_fix in one ALC295 directory (the ALC295_v2 Asus UX430UA directory) but not in the other ALC 295 directory that is provided (the ALC295/3254 directory). In which situation(s) is ALCPlugFix required?
       
      4.  My pathmaps are somewhat different from those in the cloverHDA.kext. Is there an easy way for me to customize the kext? For example, if I just switch the values in the xml files, will that be enough? Or does the whole thing then need to be recompiled?
       
      needed pathmaps:
      33-2
      23-3
      7-36-18
      9-34-19
       
      (My highest priority for the moment is getting headphone working, which is 33-2, and I might even be able to use the 33-3 that is already included. But I would like to eventually get all of them working.)
       
       
    • By maiconjs
      I have a receiver with 7.1 channels, in which I transmit the formats Dolby Digital and DTS without problems by Windows, through the HDMI output of HD4000. On that same Laptop, I have the Hackintosh, with the High Sierra 10.13.6, and with audio enabled using AppleALC, but in the audio preferences, I can not enable the Digital audio format. Also did not find players like Mirillis SplashPro (which I have used in Windows) with the option of HDMI output Bitstream. Is it possible to enable this digital output on Hackintosh?
×