Jump to content

AppleHDA patching in Mountain Lion


nyolc8
 Share

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.

Link to comment
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!

Link to comment
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?

Link to comment
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.

Link to comment
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.

Link to comment
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?

Link to comment
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.

Link to comment
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? :/

Link to comment
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.

Link to comment
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)

Link to comment
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

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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.

  • Like 1
Link to comment
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 :)

Link to comment
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

Link to comment
Share on other sites

 Share

×
×
  • Create New...