Jump to content

AppleHDA patching in Mountain Lion

AppleHDA ML .xml.zlib

  • Please log in to reply
237 replies to this topic

#1
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary
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.

#2
Riley Freeman

Riley Freeman

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 934 posts
  • Gender:Male
  • Location:The Streets
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.

#3
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,149 posts
  • Gender:Male
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.

#4
Riley Freeman

Riley Freeman

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 934 posts
  • Gender:Male
  • Location:The Streets

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!

#5
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary
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?

#6
Riley Freeman

Riley Freeman

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 934 posts
  • Gender:Male
  • Location:The Streets

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.

#7
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,149 posts
  • Gender:Male

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.

#8
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary
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?

#9
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,149 posts
  • Gender:Male
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.

#10
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary
Thanks, I tried to patch wolfson, and here's what I got:
Posted Image

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? :/

#11
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,149 posts
  • Gender:Male
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.

#12
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary
I set that to layout 12 everywhere:

- layout12.xml
- applehdahardwareconfigdriver.kext's info.plist
- dsdt.aml

And now I get this:
Posted Image

nothing changed, just the 662 became 12.

(pathmap was "1" before too)

#13
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary

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


#14
DoiX

DoiX

    Homo discens

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,132 posts
  • Gender:Male
  • Location:Terra
  • Interests:Photography, design, beer.
@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.

#15
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,149 posts
  • Gender:Male
AFAIK you don't need to alter the Controller, just AppleHDA binary.

#16
DoiX

DoiX

    Homo discens

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,132 posts
  • Gender:Male
  • Location:Terra
  • Interests:Photography, design, beer.
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.

#17
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,149 posts
  • Gender:Male
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.

#18
DoiX

DoiX

    Homo discens

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,132 posts
  • Gender:Male
  • Location:Terra
  • Interests:Photography, design, beer.
Hm, interesting. My codec also requires IOAudioFamily.kext being patched, do you have any idea about this kext?

#19
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary
@TimeWalker75a, please tell me that I need only one command for binpatch, or I need that much as you wrote?

#20
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,149 posts
  • Gender:Male

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.





Also tagged with one or more of these keywords: AppleHDA, ML, .xml.zlib


0 user(s) are reading this topic

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