Jump to content

[HOW TO] Patch AppleHDA - Knowledge Base


THe KiNG
 Share

392 posts in this topic

Recommended Posts

Guest BuildSmart

I'm still waiting to see a working STAC9221D or STAC9274D audio using the Leo AppleHDA.kext, others claim to have it working but I have yet to see a working solution, anyone developing it claim it's possible but again no working solution is offered which leads any sane person to conclude that it's nothing more than a phantom possibility.

Link to comment
Share on other sites

hy mister.. i've the same alc888 s/t on my lappy.. i tried your kext but kextload tell me

kextload: extension AppleHDA.kext appears to be loadable

kextload: no memory?

 

 

can you help me?

thanks!!

guido

Link to comment
Share on other sites

Soon (less then a month I hope) a new driver will fix all this. I can't say more about this b/c is not my work and the announce should be made by the maker, so IMHO better focus your energy to something else, soon all this patching hda stuff will go on the dark...

As example I've stopped patching AD1988b @ 99% only mute and input amp boost to fix remained...

Hello King,

 

I have an Asus P5Q Deluxe with adi ad2000b, I will try to patch hda with your description, the codec is similar to the 1988b . I will keep you informed if I any success !

 

Maybe I could need some help...

 

Greetings !

 

Gary

Link to comment
Share on other sites

hello king

i read and tried to apply your rules

 

then:

I've the codev verbs (or I think to have.. I would try)

 

but in your post at the end it's not clear what I must do with them.

You wrote that configdata is written in base64..

I took your attached kext..

 

pickup your plugin/AppleHDA.kext/info.plist

 

and DECODED with a tool online http://www.motobit.com/util/base64-decoder-encoder.asp

and I see a lor of strange words..

 

the question is : can you complete the manual?

because when I have the codec verbs I don't know where to put them. Shall I put the verbs.. with spaces.. without spaces.. or converted in base64.. with or without spaces?

 

in the bottom of your post you jump from the explanation of changing the applehda to other kext (the controller) but you

wrote: that's all ..

 

after.. you wrote about some kind of dsdt patch..

but there is another problem for me.. i didn't comprehend.. i've not HDEF in dsdt file.. and the pin.. what is the association between the pin and .. somehow in the hda verbs??

 

thanks

Link to comment
Share on other sites

Hi, I try to get the Adi AD 2000b to run ( it is AD 1989b)

 

I took the AD 1988B taruga hda and made some modifications

 

I can see the injected audio ports in the system profiler, but in system preferences I have no sound.

 

I would need the exact pinconfig override verbs, in my vista I can´t find "pinconfig" in the registry, I only find AD 1989 init verbs (only 36 lines)

This seems to be not the right verbs.

 

Taruga made some change in the apple hda codec (in the MacosFolder) I don´t know what he changed..

 

If I change the pinconfig override verbs from taruga the audio ports dissapear

 

It is crazy, if I only change the codec to mine in the applehda unix file (Hexedit) all injected ports dissapear

 

My question, is it a good sign that I can see the audio ports in the systemprofiler or is this of minor relevance, or can it be that applehda (unix executable file)

must be edited and not only the plists

 

Thanks, I hope somebody can help me further

 

Greetings !

Gary

 

PS. When I boot the system I have a short audio noise before the grafic comes up...Maybe there is a solution with ad2000b and applehda

Link to comment
Share on other sites

Hi to all,

 

did a new try on adi ad 2000b this time i began with the original 10.5.6 applehda.kext

 

I applied all codec ID´s

 

I inserted pinconfig verbs (they are equal to ad 1988b)

 

I changed codec ID 8B19D411 (AD 1988) to 9B98D411 (AD 2000b) in apple hda unix file

 

installed hda enabler

 

so following happens:

 

I have the devices in the system profiler:Intel High Definition Audio:

 

Device ID: 0x10438311

Audio ID: 12

Available Devices:

Headphone:

Connection: 1/8 inch Jack

Line Out:

Connection: 1/8 inch Jack

S/P-DIF Out:

Connection: Optical

Microphone:

Connection: 1/8 inch Jack

 

but no sound, no ports in the systempreferences

 

from console I got following message:

AppleHDAWidgetAD1984

Link to comment
Share on other sites

...

6. Editing AppleHDAPlatformDriver Info.Plist

Do the same and remove all {censored} that you don't need from HDA Platform Resource:

-from Layouts, keep only that one with LayoutID: 12 and change the codec id with yours

-from PathMaps, keep only that one with PathMapID: 9

Now the major changes you have to made are on PathMaps:

Item1 setup LineIn *here I have to figure out how to add Internal Mic support

Item2 setup SpdifIn

Item3 Setup Internal Speakers/ExternalSpeakers(you will see 2 child on it)

Item4 setup LineOut

Item5 setup SpdifOut

 

Once you have the right pins it will be piece of cake to change the value on each Item/entry

Now I will cover Item3 to show you why there are 2 childs on it, the first one is for internal speakers and the second is for HP Out. Why there are on the same Item?

B/c of Jack autodetection, that mean when you plug ext speakers/headphones in, internal are muted and it will automatically change to HP out.

Here is how should look:

 

Snapshot_2008-09-24_14-07-08.jpg

 

...

 

Hi King,

Great work KING! I follow your steps, but I have few questions:

Question1) It looks like that if I have codec verbs from Vista, I do not need codec dump from Linux, right?

 

Question2) From the step number 6), you mean to show values for Item 3 (Internal Speakers/ExternalSpeakers), but I see Item 4 is expanded in the picture. Did you mean to say that Item 4 is Internal Speakers/ExternalSpeakers? Which is correct?

 

Question3)Also, when I update AppleHDAPlatformDriver Info.Plist Item 1 to 5, am I only changing nodeID for each Item? If not, please let us know what other attribute within nodeID should I change? (and also where these values for the attributes come from)

 

 

Thank you!

Link to comment
Share on other sites

I'm still waiting to see a working STAC9221D or STAC9274D audio using the Leo AppleHDA.kext, others claim to have it working but I have yet to see a working solution, anyone developing it claim it's possible but again no working solution is offered which leads any sane person to conclude that it's nothing more than a phantom possibility.

 

Seems that you have serious trust issue...read bellow and if you still don't trust me or others then you should consider a visit to the medic...:

 

hy mister.. i've the same alc888 s/t on my lappy.. i tried your kext but kextload tell me

kextload: extension AppleHDA.kext appears to be loadable

kextload: no memory?

can you help me?

thanks!!

guido

I can't since you didn't understand what means "legacy" and also seems that you didn't bother to read the guide....

 

Hi, I try to get the Adi AD 2000b to run ( it is AD 1989b)

OK.

Since "that" driver seems to be "on hold" w/o any future notification and/or source I started to mess again with AplleHDA, and guess what? I fixed AD1988b codec

Seems that a good hacking break have results:

So what works?

IMHO ALL but lets explain for the people who don't trust..."

The kext I provide works in 2 way:

a) With HDAEnabler.kext

;) W/O it and with DSDT patch on audio.

I hope all of you know what is HDAEnabler.kext and what does....and that this kext works only with original applehda.kext in place!

About DSDT injection this is what have to be "injected" in DSDT:

            Device (HDEF)
           {
               Name (_ADR, 0x001B0000)
               Method (_DSM, 4, NotSerialized)
               {
                   Store (Package (0x08)
                       {
                           "codec-id", 
                           Buffer (0x04)
                           {
                               0x9B, 0x82, 0x43, 0x10
                           }, 

                           "layout-id", 
                           Buffer (0x04)
                           {
                               0x0C, 0x00, 0x00, 0x00
                           }, 

                           "device-type", 
                           Buffer (0x17)
                           {
                               "Analog Devices AD1988B"
                           }, 

                           "PinConfigurations", 
                           Buffer (0x20)
                           {
                               /* 0000 */    0x30, 0x40, 0x21, 0x01, 0x10, 0x40, 0x11, 0x01, 
                               /* 0008 */    0x40, 0x90, 0xA1, 0x01, 0x50, 0x30, 0x81, 0x01, 
                               /* 0010 */    0x60, 0x10, 0x01, 0x01, 0x20, 0x90, 0xA1, 0x01, 
                               /* 0018 */    0xF0, 0x11, 0x45, 0x01, 0x70, 0x60, 0x01, 0x01
                           }
                       }, Local0)
                   DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                   Return (Local0)
               }
           }

^^^ This replace the need of HDAEnabler.kext

Now if you look on the kext below you may ask wtf? Is just a plist in that kext!

How that can fix audio on my machine?

Simple as that, think on Apple audio driver as like on your computer, it just needs to know what to do, if you don't provide the right "commands" then the result is bad.

Apple was kind enough to leave us the way to fix it... ;)

Now the working stuff:

5.1 Analog out

Mute fixed

2 External Mic(front panel not tested since I don't have front panel on my case, but I bet on it)

Line In

Digital Out(optical)

Front Panel HeadPhone(not tested)

I ditched digital in to make room for the rest(guess nobody use it)

NO sound assertion errors on log/boot(just one on 10.5.7/snow b/c the beta kext is not finished, and YES works on that)!

And that with just a plist, want more make yourself!

Any more questions?

Guess not!

 

The kext: AD1988b.HDA.FIX

The "proof":

Snapshot_2009-03-05_18-56-52.jpg

Snapshot_2009-03-05_18-56-07.jpg

Snapshot_2009-03-05_18-56-22.jpg

Snapshot_2009-03-05_18-55-47.jpg

And the example on how can use a codec graph:

ubuntunewalsaAD1988b_dec_copy.jpg

 

A few words... I'm not responsible for those who can't understand what I write, I can't "print" my brain, I can't explain better then this, dunno how... I did my best, If someone can better, be my guest.

 

Next I will try to give you HDMI audio out.

Bye!

Link to comment
Share on other sites

Hello The King,

 

First, THANK YOU SO MUCH FOR YOUR WORK AND HELP!!! What you have laid out here is awesome!

 

I’m having problems with my Linux dump file and creating my SVG file. I followed the method below to create the dump file (but I took your advice and used the Mandriva Linux, which is COOL!):

 

 

http://www.insanelymac.com/forum/lofiversi...php/t46378.html

 

1) Get your favorite Linux Live ISO (I used the latest Ubuntu) and burn it to disc.

2) Boot of the disc get to the desktop. Open the terminal and type this:

cat /proc/asound/card0/codec#0

3) The terminal will scroll through the data. Copy the data and paste it into a text document and save it to a writeable media (live CDs often mount media read-only so you will need something like a thumb-drive or something)

4) Boot into OS X and then use this as the file for patching. It has been recommended to use the -legacy option upon booting.

 

The file output is like this (just a small sample here, not the whole file):

 

Codec: Realtek ALC885

Address: 2

Vendor Id: 0x10ec0885

Subsystem Id: 0x1458a102

Revision Id: 0x100101

No Modem Function Group found

Default PCM:

rates [0x560]: 44100 48000 96000 192000

bits [0xe]: 16 20 24

formats [0x1]: PCM

Default Amp-In caps: N/A

Default Amp-Out caps: N/A

GPIO: io=2, o=0, i=0, unsolicited=1, wake=0

IO[0]: enable=0, dir=0, wake=0, sticky=0, data=0

IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0

 

 

The converted file output looks like this:

 

Codec: Realtek ALC885

Address: 2

Vendor Id: 283904133

Subsystem Id: 341352706

Revision Id: 1048833

No Modem Function Group found

Default PCM:

rates [1376]: 44100 48000 96000 192000

bits [14]: 16 20 24

formats [1]: PCM

Default Amp-In caps: N/A

Default Amp-Out caps: N/A

GPIO: io=2, o=0, i=0, unsolicited=1, wake=0

IO[0]: enable=0, dir=0, wake=0, sticky=0, data=0

IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0

 

But when I try to create the codecgraph, I get the error output

mentioned in this post (for which the poster never took the time

to explain to the rest of us what the issue was):

 

 

http://www.insanelymac.com/forum/index.php?showtopic=127819#

 

 

Codec: Realtek ALC885

Exception around line 21

Traceback (most recent call last):

File "./codecgraph.py", line 496, in <module>

main(sys.argv)

File "./codecgraph.py", line 492, in main

ci = CodecInfo(f)

File "./codecgraph.py", line 442, in __init__

n = Node(self, item, subitems)

File "./codecgraph.py", line 106, in __init__

self.nid = int(m.group(1), 16)

AttributeError: 'NoneType' object has no attribute 'group'

 

 

What am I doing wrong and how can I correct it?

 

Thanks!

Link to comment
Share on other sites

Hi THe KiNG,

 

EDIT: Sorry, it actually working perfectly. -_- I just found out that my external microphone is broken. That is why when I plug in the external microphone, no audio captured. :D All are working - speaker, headphone, line in, mic & external mic. I don't have device to test Digital Out, so I don't know if it is working or not. I found out that line in was not working because I forgot to set Sequence to 0. I have uploaded new ConfigData along with codec dump, pin config override verbs (from vista), svg files & Info.plist - AppleHDAController & AppleHDAPlatformDriver. I also set each devices with individual Default Association.

 

Original ConfigData:-

systemprofileraudio.th.jpg

 

New ConfigData with individual Default Association:-

audioaceraspire9420.th.jpg

 

I have followed your guide & successfully patched AppleHDA.kext. However it is not complete where I can't get line-in (jack) & external mic (jack) to work. Funny thing is that when I put PathMap for external mic (pink) (jack) it actually making the internal mic working instead the external one.

 

This is my PathMap for the ALC883 (laptop):-

External Mic (Pink) (jack): 9 34 24 (by default, internal (built-in) mic working. no audio captured when external mic plugged - built-in mic auto disabled.)

Line in (Blue) (jack): 8 35 26

Line out external Rear (Black) (jack): 20 12 2 (auto-detect - default, audio will come out from internal speaker. when HP plugged, audio will come out from HP.)

SPDIF IN: 10 31

SPDIF OUT: 30 6

 

Here I attached files (codec dump, codec verbs, svg & Info.plist - AppleHDAController & AppleHDAPlatformDriver) that I collected during the process. I hope you can take a look & let me know if something wrong.

Thank you. :P

 

Patch directly to AppleHDA.kext (zip file also contain SVG file, codec dump, codec verbs & pin config):-

alc883_aceraspire9420_dump_kizwan.zip

Kext for use with Boot-132:-

ALC883Aspire9420.kext.zip

 

kizwan

Link to comment
Share on other sites

Hey Mr The king.. sure.. i've read and applied all your guide.. in this topic/page

http://www.insanelymac.com/forum/index.php...53773&st=20

 

me and all the acer 5930g owners are trying without succcess..

I've real the intel bible and microsoft bible on HDA specs..

i've created all the info about changing the kext (in that page there are all the bible.. my archive.zip with.. codec verbs.. map.. graphics map)

 

 

i've tried to use a basic template HDA audio from an hda like Taruga (10.5.2) wich is poor and without an axecutable HDAaudio..

i've tried to manipulate HDA from last kext of 10.5.6 which has DSP functions..

i've tried to use kexts from snow retail..

 

linking from a combinations of external kexts. (audio drivers.. pcifamily.. etc..)

 

but nothing

 

i know exactly the position of those pins.. but the device seems that never change!

 

the best is a kext (in attached) which activate only front speaker (not the rear1 and subwoofer) and activate external purple mic but when you rec from that jack the sound is blank.

 

recently i've tried to create a team with greek people.. italian people and other 5930 to try do manage starting from that last kext.. but any changes.. if I remove info on the Platformdriver and put the id of my sound card... no sound! and kexloading -v -t I see a lot of problem in system.log and sometimes a crash

 

We use 9.5 or 9.6 kernel.. 1.0 or 1.3

 

i've tried really a hundred of combinations.. it have been 3 weeks.. noght and day!!

 

it's very strange.. I know all the procedure.. but the facts are not good for us

 

help

ciao

Link to comment
Share on other sites

@The King:

do you know why do we need to inject the layout id in hdaenabler? In other words how does applehda detect the right layout in real macs?

B/c we don't have EFI

Those are "injected" in real macs by EFI.

Anyway on latest snow kitty apple seems to "extend" the HDA capability, what I mean to say is that now HDA reads verbs from BIOS! Still the need of HDAEnabler or DSDT injection is needed... I have to research more on it...

Link to comment
Share on other sites

maybe.. can I try to manage snow drivers into a 10.5.6 installation.. like a did for some other kext?

I see that the dependencied are few.. like Audiodriver and pcifamily..

but in newer hda driver I see a plugin called mickey.. and in system it give many errors,,,

 

B/c we don't have EFI

Those are "injected" in real macs by EFI.

Anyway on latest snow kitty apple seems to "extend" the HDA capability, what I mean to say is that now HDA reads verbs from BIOS! Still the need of HDAEnabler or DSDT injection is needed... I have to research more on it...

Link to comment
Share on other sites

Hey Mr The king.. sure.. i've read and applied all your guide.. in this topic/page

-------

I said you didn't read the guide b/c my kext is not a kext(lol) its a plist only kext that patch on the fly vanilla one.

So kextloading it will bring you nothing...

My fix kext must be used with hdaenabler/or dsdt injection and with original applehda.kext in place(/s/l/e)

If you want it to be on /Extra it must be on mkext format (Extensions.mkext)

 

maybe.. can I try to manage snow drivers into a 10.5.6 installation.. like a did for some other kext?

I see that the dependencied are few.. like Audiodriver and pcifamily..

but in newer hda driver I see a plugin called mickey.. and in system it give many errors,,,

Best IMHO if you want to play with snow kext is to test on snow, don't try to add more problems then you have already in leopard.

Just my 2 cents...

I will try to help you, if I can get some free time, but just to know the chance are very low, tried to help some friends of mine and failed.

Why? B/c is hard to do such many tests when you don't have that hardware under your fingers...

And BTW 3 weeks is just for warm...I spent more then 3 months on AD1988b patching and almost the same on ALC888 S/T from my lappie, so be prepaired if you want it done.

Funny! who edited my lappie kext?

Maybe you should ask that guy(Cnnn) to help you seems really good on what hes doing...what a lame!

Link to comment
Share on other sites

2 THe KiNG:

 

Can you help me with AD1988? Codec dump AD1988 looks very much like AD1988B.

Ubuntu codec dump:

AD1988_CodecDump.txt

Converted Svg Scheme (PDF file):

AD1988_ConvertCodecDump.txt.pdf

 

I give you fix kext and make some mode for AD1988:

1) Change Codec Id from 0x11d4198b to 0x11d41988 (2 places in plist)

2) Change AD1988B to AD1988

 

I make hex fix AppleHDA in AppleHDA.kext (change 8b19d411 to 8819d411)

 

After that I add HDEF in DSDT

Device (HDEF)
		{
			Name (_ADR, 0x001B0000)
			Method (_DSM, 4, NotSerialized)
			{
				Store (Package (0x08)
					{
						"codec-id", 
						Buffer (0x04)
						{
							0xe1, 0x81, 0x43, 0x10
						}, 

						"layout-id", 
						Buffer (0x04)
						{
							0x0C, 0x00, 0x00, 0x00
						}, 

						"device-type", 
						Buffer (0x17)
						{
							"Analog Devices AD1988"
						}, 

						"PinConfigurations", 
						Buffer (0x20)
						{
							/* 0000 */	0x30, 0x40, 0x21, 0x01, 0x10, 0x40, 0x11, 0x01, 
							/* 0008 */	0x40, 0x90, 0xA1, 0x01, 0x50, 0x30, 0x81, 0x01, 
							/* 0010 */	0x60, 0x10, 0x01, 0x01, 0x20, 0x90, 0xA1, 0x01, 
							/* 0018 */	0xF0, 0x11, 0x45, 0x01, 0x70, 0x60, 0x01, 0x01
						}
					}, Local0)
				DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
				Return (Local0)
			}
		}

 

And now all work

post-209200-1236805704_thumb.gif

post-209200-1236805931_thumb.png

post-209200-1236806213_thumb.gif

post-209200-1236806227_thumb.gif

But sound not work.

Link to comment
Share on other sites

Did u tested all 3 outs and sound dosent come on all?

If yes I have no idea sorry, as I said cant do much w/o that board under my fingers...

 

EDIT: It is working perfectly (post #213).

 

I'll take this as the answer to my request (post #213).

 

systemprofileraudio.th.jpgsystempreferencesaudioo.th.jpgsystempreferencesaudioi.th.jpg

 

Audio out (internal & headphone) working. External mic become internal mic (working), so, external mic not working. Line-In also not working. Perhaps there are Node IDs missing from the codec dump. Maybe codec verbs collected not complete. Well....I'm just speculating.

 

Thank you anyway for the guide you posted. I really appreciated it.

 

kizwan

Link to comment
Share on other sites

B/c we don't have EFI

Those are "injected" in real macs by EFI.

Anyway on latest snow kitty apple seems to "extend" the HDA capability, what I mean to say is that now HDA reads verbs from BIOS! Still the need of HDAEnabler or DSDT injection is needed... I have to research more on it...

 

Are you saying the layout-id value is hardcoded into efi for each different mac model and just read by AppleHDA?

I was assuming the layout was being autodetected at runtime somehow because I looked at all those real mac decompiled dsdt tables posted in new releases forum and I didnt see anything in the hdef section; so I was trying to find out how applehda choose the proper layout id for a given codec.

Do you know how the layout id value comes into the ioregistry if its not from the dsdt table?

Link to comment
Share on other sites

 Share

×
×
  • Create New...