Jump to content

AppleHDA patching in Mountain Lion

AppleHDA ML .xml.zlib

  • Please log in to reply
237 replies to this topic

#61
VCH888

VCH888

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 585 posts
@ nyolc8

It's impossible to get ExtMic because ExtMic might be related to /AppleHDA/Contents/PlugIns/AppleMikeyDriver.kext. You should get mikey sound assertions if you attempt to make ExtMic.

So, the simple solution is just to use which ports are available.

#62
whitegerry

whitegerry

    InsanelyMac Protégé

  • Members
  • PipPip
  • 59 posts
  • Gender:Male

@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.


My patched appleHDA here works fine in ML GM: Attached File  AppleHDA.kext.zip   1010.14KB   759 downloads

The layout id is set to 88:

			    Method (_DSM, 4, NotSerialized)
			    {
				    Store (Package (0x12)
					    {
						    "AAPL,slot-name",
						    Buffer (0x08)
						    {
							    "PCIe x1"
						    },
						    "device-id",
						    Buffer (0x04)
						    {
							    0x65, 0x06, 0xEC, 0x10
						    },
						    "built-in",
						    Buffer (One)
						    {
							    0x00
						    },
						    "layout-id",
						    Unicode ("X"),
						    "device_type",
						    Buffer (0x11)
						    {
							    "Audio Controller"
						    },
						    "name",
						    Buffer (0x0F)
						    {
							    "Realtek alc665"
						    },
						    "model",
						    Buffer (0x0F)
						    {
							    "Realtek alc665"
						    },
						    "PinConfigurations",
						    Buffer (Zero) {},
						    "hda-gfx",
						    Buffer (0x0A)
						    {
							    "onboard-1"
						    }
					    }, Local0)
				    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
				    Return (Local0)
			    }


#63
CutOffz

CutOffz

    InsanelyMac Protégé

  • Members
  • Pip
  • 8 posts

Hello!



Someone here, who was able to patch the new AppleHDA.kext and get it working with AD2000B on ASUS P5Q-E? I used the same layout12.xml, Platforms.xml and info.plist files as in 10.7.4. I compressed the files using the perl script created by revogirl and replaced them inside the AppleHDA.kext. Also i used the Bin Patch on AppleHDA. I suppose the AppleHDA binary is uncompress or do i need to uncompress it with the script, too? My DSDT contains the HDEF Device and in combination with the mentioned files und bin patch it worked perfect in 10.7.4.


However, i got no working with 10.8, however my old 10.7.4 AppleHDA.kext still works in 10.8.


Any working solution for 10.8 AppleHDA.kext?


Tnx 4 help!



#64
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,277 posts
  • Gender:Male

P.S.S. I have another reported case of audio working in ML GM w/ the binary patch I have previously calculated, this time for ALC662. See THIS
Mind to try it as well ? Just swap the codec ID for your IDT. Also try the patch in my previous post as i have suggested to the person by that link.

I just got around to patching 10.8 AppleHDA for my IDT audio, and the patch was minimal. In fact I only had to replace the two occurrences of the AD1984 codec ID with my IDT codec id. Ie the fix was the same as in 10.6, not requiring the patching of a range comparison as in 10.7 (the range comparisons are there, but this build I got "lucky" and IDT codec id fits within the range checks).

Also, for my IDT codec, the xml resources patches for 10.8 was unchanged vs 10.7 (they simply needed to be compressed).
If anyone wants to see the package installer I did for my IDT codec, it's here: http://www.insanelym...ttach_id=111763

#65
breakingbad

breakingbad

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 690 posts
  • Gender:Male
  • Location:Brasil
Hi guys.
I'm facing problems with sound too, but mine codec is a ALC888 on a EP45-UD3L.
In Lion, my sound was working perfectly using only AppleHDA (patched) + Plataform.xml + layout888.xml all added with HDA Wizard.
In Mountain Lion the same trick didn't work. It's true that it showed the speaker icon to the desktop menu bar, but no sound or even options to select in System Preferences.
I could manage to work the sound with voodoohda.kext but sound and configuration are terrible.
In ML is there any other file that should be used and patched besides AppleHDA.kext?

Cheers,
bb.

#66
VCH888

VCH888

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 585 posts
@ breakingbad

You need to rename layout888.xml to layout12.xml and edit inside layout12.xml to be as following

<key>LayoutID</key>
<integer>12</integer>

get perl script from zlib.pl.zip (by Revogirl, R.I.P.)

how to:
(compress)
perl zlib.pl deflate layout12.xml > layout12.xml.zlib

(decompress)
perl zlib.pl inflate layout12.xml.zlib > layout12.xml

also;
perl zlib.pl deflate Platforms.xml > Platforms.xml.zlib

copy *.xml.zlib to /System/Library/Extensions/AppleHDA.kext/Contents/Resources/
patch AppleHDA

#67
breakingbad

breakingbad

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 690 posts
  • Gender:Male
  • Location:Brasil
@VCH888

Thanks for the hint.
I'll try this method here and posts results as soon as I get it.

Just one thing I'm still in doubt is how to use the script from Revogirl.
I'll do a little research on that, since I'm not that into commands like that...

Cheers,
bb.

EDIT
Hi VCH888, while deflating the layout12.xml to layout12.xml.zlib worked fine.
But when inflating it, got error and script generate a Zero bytes file.

I guess I missed some points on using it.

Cheers,
bb.


Lil doubt
It's necessary to use any kind of HDAEnabler after patching the AppleHDA.kext or this kext is just gone?

Cheers again,
bb.

SUCCESS :thumbsup_anim:
Thanks VCH888.
This technic of you is a killing one!
Sound works perfectly again, without voodooHDA.
Thank you so very much.

Cheers,
bb.

#68
DoiX

DoiX

    Homo discens

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,130 posts
  • Gender:Male
  • Location:Terra
  • Interests:Photography, design, beer.
@whitegerry, funny thing. Using the layout ID you use, my sound is working fine. If i use 65 or any other it doesn't work, and yes, i modified the .xml files accordingly for each number. Weird situation.

#69
ErmaC

ErmaC

    127.0.0.1

  • Supervisors
  • 4,631 posts
  • Gender:Male
  • Location:Canary Islands

-= ADI AD2000B =-


First of all I wont give the proper credits.
- Samantha (aka Revogirl, DHP) R.I.P. we miss you. For the script (Inflate/Deflate zlib)
- TimeWalker75a , I suppose is the same as TimeWalker on Applelife.ru post #338
for find the binpatch for this controller.

So let's go.
1) The binpatch
sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x53\x01\x00\x00|\x9b\x98\xd4\x11\x0f\x84\x2a\x01\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x2f\x01\x00\x00|\x9b\x98\xd4\x11\x0f\x84\x06\x01\x00\x00|g' AppleHDA
2) DSDT edits for HDEF (We change from Layout 12(0C) to 99(63)
Spoiler

3) The compressed .xml and .info files (layout99.xml.zlib, Platforms.xml.zlib, Info.plist)
Attached File  AD2000b.zlib.zip   10.22KB   671 downloads


Need to be replaced in the proper positions.
/System/Library/Extensions/AppleHDA.kext/Contents/Resources/layout99.xml.zlib
/System/Library/Extensions/AppleHDA.kext/Contents/Resources/Platforms.xml.zlib
/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHardwareConfigDriver.kext/Contents/Info.plist

Here the Already patched Mountain Lion AppleHDA GM(RTM) for AD2000b -->
New version in the download section http://www.insanelym...da-for-ad2000b/

Note: A warning to people who take and upload this files on other sites.
Remember to give the right credits!

EDIT: reupload the correct file and patched kext
Fabio

#70
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,052 posts
  • Gender:Male
  • Location:UK
Patching audio is something I've always looked at but never been able to properly get my head around. So consequently I fail in this area.

However, I've been watching the Applelife thread for a while and now this thread with interest in the attempt to gain some insight and also in the hope that somebody would post a solution for my AD2000B. And here above we have a solution. Brilliant! Thanks for posting the details Fabio.

So a huge thank you here to TimeWalker75a and everybody else (i.e. bcc9, THe KiNG, toleda, VCH888, Revogirl - the Applelife guys, and anyone who I haven't mentioned) who's tirelessly developed, worked and tested audio patching.

#71
masa

masa

    InsanelyMac Protégé

  • Members
  • Pip
  • 47 posts
Thank you ErmaC.
I just test your method on my P5Q-E, I could get sound output but with no input: there is digital input only and I can't use my mic.
I tried use your patched kext file and modifying AppleHDA manually.
Any advice will be appreciated, thank you.

Attached Files



#72
CutOffz

CutOffz

    InsanelyMac Protégé

  • Members
  • Pip
  • 8 posts
@ErmaC
@masa

I have a P5Q-E, too and the same problem here, only digital in in audio settings. Systeminformation shows in Audio Headphone and Line-In, however in audio settings i can't select it!

I will try to use my old dsdt settings and only change the device-id to 99. Probably this will work!

Tnx CutOffz

#73
masa

masa

    InsanelyMac Protégé

  • Members
  • Pip
  • 47 posts
CutOffz, thanks for your information.
I've tried that, still with no luck:(

@ErmaC
@masa

I have a P5Q-E, too and the same problem here, only digital in in audio settings. Systeminformation shows in Audio Headphone and Line-In, however in audio settings i can't select it!

I will try to use my old dsdt settings and only change the device-id to 99. Probably this will work!

Tnx CutOffz



#74
geeksunny

geeksunny

    InsanelyMac Protégé

  • Members
  • Pip
  • 1 posts
  • Gender:Male
  • Location:Chicago, IL
Hey guys, I have an ADI AD2000b sound card (ASUS P6T Deluxe V2 motherboard) and I am trying to get sound working in my new Mountain Lion install. I've tried Ermac's patches a number of times but no such luck. I think my problem must lie in the DSDT editing... I don't think I am doing it right. Could anyone walk me through the correct procedure for this? Or maybe point me in the right direction of a good guide?

I tried a package from OSx86.net that used a patched AppleHDA, a copy of HDAEnabler and HDEFenabler, and an AD2000b.kext file. That DID get me sound output, but all the channels (front stereo, rear stereo, center) were separated and I am hoping to have them all combined into one output if that is possible. Would this patching be able to achieve that?

Thanks!

#75
CutOffz

CutOffz

    InsanelyMac Protégé

  • Members
  • Pip
  • 8 posts
@masa

In the old patched kext from 10.7.4 with old DSDT (device-id 12) the mic works with ML. However, not very vanilla, but fine with the new speech recognition! Hope ErmaC can fix the mic!

#76
masa

masa

    InsanelyMac Protégé

  • Members
  • Pip
  • 47 posts

@masa

In the old patched kext from 10.7.4 with old DSDT (device-id 12) the mic works with ML. However, not very vanilla, but fine with the new speech recognition! Hope ErmaC can fix the mic!


yes, that's my current status too, looking forward to a new solution.

#77
ErmaC

ErmaC

    127.0.0.1

  • Supervisors
  • 4,631 posts
  • Gender:Male
  • Location:Canary Islands
Hi guys.
my mistake.
I forgot to change the layout also in the Info.plist.

I correct the file in the previous post and posted the patched (complete) kext for AD2000b..
enjoy

Fabio

#78
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,277 posts
  • Gender:Male
I've updated my AppleHDA patch script to handle multiple codec ids and also dynamically figure out which extra comparisons should be patched to get the matching to work properly. The script supports osx 10.7 and osx 10.8.: Attached File  patch-hda.pl.0.7.zip   3.31KB   503 downloads

The script works by continuing my idea of patching the codec comparisons by zeroing out the codec ids found as operands to the applicable comparison instructions. This is easier to do in a script than trying to compute a new jump location as the script does not even need to parse AppleHDA's match routine's instructions (see ati-personality.pl for an example of that kind of processing).

I think maintaining a script like this will be more generally useful & easier to maintain than a bunch of perl one-liner posts.

This script resembles the concept of HDA wizard http://www.insanelym...howtopic=266531 but instead of being GUI focused, it focuses on getting the AppleHDA binary patching done automatic&right across osx releases.

I've only added support for a few codecs that I've used on hackintoshes (idt 7675, alc 889 and alc992). I could try to fold in the codecs from HDA wizard, as well as this thread, if this looks good.

Examples, under 10.7:

% ./patch-hda.pl 111d7675
Patching AppleHDA codec 11d41984 with 111d7675
1 codec range comparison(s) to patch
Patching range comparison 11d41983
AppleHDA patched successfully.
under 10.8:
% ./patch-hda.pl 111d7675
Patching AppleHDA codec 11d41984 with 111d7675
No codec range comparisons require patching
AppleHDA patched successfully.
% ./patch-hda.pl 10ec0889
Patching AppleHDA codec 10ec0885 with 10ec0889
No codec range comparisons require patching
AppleHDA patched successfully.
% ./patch-hda.pl 'Realtek ALC889+inputs'
Patching AppleHDA codec 11d41984 with 10ec0889
No codec range comparisons require patching
AppleHDA patched successfully.
% ./patch-hda.pl
Usage: patch-hda.pl <codec-id>|<codec-name>
Examples: patch-hda.pl 111d7675
Examples: patch-hda.pl 'IDT 7675'
Supported codecs:
Target          Patch           Name
Codec ID        Codec ID
-------------------------------------------
111d7675        11d41984        IDT 7675
111d76d1        11d41984        IDT 76d1
111d76e0        11d4198b        IDT 76e0
10ec0269        11d41984        Realtek ALC269
10ec0889        10ec0885        Realtek ALC889
10ec0889        11d41984        Realtek ALC889+inputs
10ec0892        10ec0885        Realtek ALC892
10ec0662        10ec0885        Realtek ALC662
10ec0882        10ec0885        Realtek ALC882
10ec0883        10ec0885        Realtek ALC883
10ec0887        10ec0885        Realtek ALC887
10ec0888        10ec0885        Realtek ALC888
111d7603        11d41984        IDT 7603
111d7605        11d4198b        IDT 7605
11d4989b        11d4198b        ADI AD2000B
11060441        11d41984        VIA VT2021

%

Note: Since there is debate as to which codec to use for alc889, I offer two choices above. I could just take the patch codec id as an optional argument, what do people think?

Update: I added a bunch more codecs (including all the codecs that HDA wizard had).

#79
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 931 posts
  • Gender:Male
Good job, bcc9!! Will give this a try when I get home.

#80
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 931 posts
  • Gender:Male
Tried the 0.5 here on my ALC269 (which I have added to the script, the patch_id is 0x11d41984) and ALC888 and it fails for 10.7 kext apparently:

~ g00dman$ sudo perl /Users/g00dman/Desktop/patch-hda.pl 10ec0269
Patching AppleHDA codec 11d41984 with 10ec0269
2 codec range comparison(s) to patch
Patching range comparison 10ec0884
Patching range comparison 10ec0885
Unexpected codec match count: 4 (2 expected)
Aborting with AppleHDA NOT patched

Same with the ALC888:
~ g00dman$ sudo perl /Users/g00dman/Desktop/patch-hda.pl 10ec0888
Patching AppleHDA codec 10ec0885 with 10ec0888
No codec range comparisons require patching
Unexpected codec match count: 4 (2 expected)
Aborting with AppleHDA NOT patched
The kext I was trying to patch is from 10.7.4 (2.2.0f3)

Whilst for the kext from ML (from the MAS) it worked for both of the codecs:
~ g00dman$ sudo perl /Users/g00dman/Desktop/patch-hda.pl 10ec0269
Patching AppleHDA codec 11d41984 with 10ec0269
2 codec range comparison(s) to patch
Patching range comparison 10ec0884
Patching range comparison 10ec0885
/Users/g00dman/Desktop/AppleHDA.kext/Contents/MacOS/AppleHDA patched successfully.

~ g00dman$ sudo perl /Users/g00dman/Desktop/patch-hda.pl 10ec0888
Patching AppleHDA codec 10ec0885 with 10ec0888
No codec range comparisons require patching
/Users/g00dman/Desktop/AppleHDA.kext/Contents/MacOS/AppleHDA patched successfully.

I can't test the ALC269 patch for ML since I have reverted back to 10.7.4 for now as I was experiencing a lot of problems with my laptop.
The 269 is more tricky to get working (as it needs 2 range comparison patching) so it would've been interesting to see if it works, but oh well...
Will give my ALC888 a test and update this post thereafter.

UPD:

Yup. ALC888 works absolutely fine in 10.8. But then again, i have never had problems with it .. just swapping 885 out with 888 always used to do the trick, whereas ALC269 left me puzzled for some time even in 10.7.





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