Jump to content

[HOW TO] Patch AppleHDA - Knowledge Base


  • Please log in to reply
392 replies to this topic

#101
cparm

cparm

    InsanelyMac Legend

  • Retired
  • 997 posts
  • Gender:Male

cparm,

I looked through your files but couldn't determine what you added/patched in the DSDT. Can you provide more tutorial/insight?

Thanks,
SMF



Thanks, I tried to use your dsdt.aml, it worked but System Profiler crash on Graphics Section, I guess is becuase you have a different card.

How did you patch the dsl to make the HDEF enabled.

Right now I using a generated dsdt.aml with fassl patcher, also deleted the audio part from EFI strings.

With your dstd.aml my SoundCard is not detected.



first run the fassl patcher (i use the 1.0.1d version)

it will generate some files and folders, open the file dsdt_fixed.txt in the debug folder

follow the guide from THe KiNG to know what to add in this file (if you don't find the hpet device, also search for azal entry),

there is mine:

Device (AZAL)
			{
				Name (_ADR, 0x001B0000)
				Method (_PRW, 0, NotSerialized)
				{
					Return (Package (0x02)
					{
						0x0D, 
						0x05
					})
				}
			}


so my dsdt hdef device is:

Device (HDEF)
			{
				Name (_ADR, 0x001B0000)
				Method (_PRW, 0, NotSerialized)
				{
					Return (Package (0x02)
					{
						0x0D, 
						0x05
					})
				}

		Method (_DSM, 4, NotSerialized)
				{
					Store (Package (0x08)
						{
							"codec-id", 
							Buffer (0x04)
							{
								0x88, 0x08, 0xec, 0x10
							}, 

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

							"device-type", 
							Buffer (0x06)
							{
								"ALC888"
							},

							"PinConfigurations", 
							Buffer (0x20)
							{
								/* 0000 */	0x10, 0x40, 0x01, 0x01, 0x20, 0x10, 0x11, 0x01, 
								/* 0008 */	0x30, 0x60, 0x21, 0x01, 0x40, 0x30, 0x81, 0x01, 
								/* 0010 */	0x50, 0x90, 0xA1, 0x01, 0x60, 0x61, 0x4B, 0x01, 
								/* 0018 */	0xf0, 0x01, 0xCB, 0x00
							}

						}, Local0)
					Return (Local0)
				}
			}

then, in the tool folder, find the iasl command, and in the terminal just tape:

iasl -ta /path to/dsdt_fixed.txt

this will create your dsdt.aml file in the debug folder, and then just put it to your root directory

@macgirl: even with this patch i need the efi string audio part otherwise the appelhda kext don't load, same thing with the dsdt.aml generated by the the fassl patcher

@macgirl: i have the same issue with the system profiler on the graphic section, i don't know why ????, but my CG work fine with QE/CI, maybe the last version of the patcher (1.0.1e) will fix this

#102
SMF

SMF

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 188 posts
cparm,

Thanks. I'm understanding a bit more and my dsdt_fixed has the same AZAL section. Now I just need to understand what you've added to the _DSM section. Do you use the stock AppleHDA.kext or a modified one?

Thanks,
SMF

#103
macgirl

macgirl

    Stargate's Pharaoh

  • Retired
  • 7,615 posts
  • Gender:Female
  • Location:Mexico City
  • Interests:Techie gadgets

iasl -ta /path to/dsdt_fixed.txt

this will create your dsdt.aml file in the debug folder, and then just put it to your root directory

@macgirl: even with this patch i need the efi string audio part otherwise the appelhda kext don't load, same thing with the dsdt.aml generated by the the fassl patcher

@macgirl: i have the same issue with the system profiler on the graphic section, i don't know why ????, but my CG work fine with QE/CI, maybe the last version of the patcher (1.0.1e) will fix this

Hey, thanks, it worked

I did my dsdt with 1.0.1e Graphics section do not crash with it, I think I read something about it.

#104
cparm

cparm

    InsanelyMac Legend

  • Retired
  • 997 posts
  • Gender:Male

cparm,

Thanks. I'm understanding a bit more and my dsdt_fixed has the same AZAL section. Now I just need to understand what you've added to the _DSM section. Do you use the stock AppleHDA.kext or a modified one?

Thanks,
SMF


for now, i still use moded applehda, but the legacy method seems to be able to load vanilla applehda (not tested yet)

#105
roidm

roidm

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,059 posts
  • Gender:Male
  • Location:Spain
Ive changed

Notify (\_SB.PCI0.AZAL, 0x02)
...
...
...

Device (AZAL)

Notify (\_SB.PCI0.HDEF, 0x02)
...
...
...

Device (HDEF)

with this the system loads fine the stock AppleHDA.kext (ALC889a) with efi strings... Im trying to inject those values

Device (HDEF)
					{
						Name (_ADR, 0x001B0000)
						Method (_PRW, 0, NotSerialized)
						{
								Return (Package (0x02)
								{
									0x0D, 
									0x05
								})
						}

			Method (_DSM, 4, NotSerialized)	
				{				
					Store (Package (0x08)
						{
							"codec-id",
							Buffer (0x04)
							{
								0x89, 0x08, 0xec, 0x10
							},
							
							"layout-id",
							Buffer (0x04)
							{
								
								0x0c, 0x00, 0x00, 0x00
							},
							
							"device-type",
							Buffer (0x011)
							{
								"ALC889a"
							},
							
							"PinConfigurations",
							Buffer (0x20)
							{
								 /* 0000 */   0x50, 0x70, 0x21, 0x01, 0x40, 0x01, 0x13, 0x90, 
								 /* 0008 */   0x20, 0x30, 0x81, 0x01, 0x41, 0x40, 0x01, 0x01,
								 /* 0010 */   0x30, 0xe0, 0xc5, 0x01, 0x60, 0xe0, 0x45, 0x01,
								 /* 0018 */   0x0f, 0x00, 0x00, 0x40, 0x0f, 0x00, 0x00, 0x40,
								 /* 0020 */   0x10, 0x01, 0xa0, 0x90, 0x11, 0x01, 0xa0, 0x90 
							}
							
						}, Local0)
					Return (Local0)		
				}	
			}

but i get a lot of errors when i compile the dsdt

edit: my codec-id was wrong , it must be 10ec0889

#106
cparm

cparm

    InsanelyMac Legend

  • Retired
  • 997 posts
  • Gender:Male

No success here (GA EP35 DS3R with ALC889a).
I think my pin configuration values are maybe wrong:
IOregistryExplorer:

<10 44 11 01 20 14 01 01 40 4c 21 02 50 34 81 01 60 9c a1 02 f0 61 4b 01>
dsdt.dsl:
Buffer (0x18)
							{
								/* 0000 */	0x10, 0x44, 0x11, 0x01, 0x20, 0x14, 0x01, 0x01,
								/* 0008 */	0x40, 0x4C, 0x21, 0x02, 0x50, 0x34, 0x81, 0x01,
								/* 0010 */	0x60, 0x9C, 0xA1, 0x02, 0xF0, 0x61, 0x4B, 0x01
Codec id does not appear in IOregistryExplorer, but assuming System profiler informations, Codec id is:
[/code]
So it should be:
[code]"codec-id",
							Buffer (0x04)
							{
								0x14, 0x58, 0xa0, 0x02
I'm using plist method with stock HDA.kext.

@cparm: should i remove the AZAL entry onto dsdt.dsl or just add HDEF?


this value : 0x1458A002, is not your codec id,

with the ACL889a your codec id is 0x10ec0889, so this section should be:

"codec-id", 
							Buffer (0x04)
							{
								0x89, 0x08, 0xec, 0x10
							}

, you can leave the azal entry, but i think it's depend on the efi part

i mean if you the command gfxutil -f HDEF work and give a devicepath, you should edit/add a hdef entry to your dsdt

if gfxutil -f AZAL work, try first to edit the dsdt azal entry

@roisoft, try to not change anything, just add the hdef entry to your dsdt

ps 1: i think, your codec id is wrong, 0x0000293e is the device-id, your codec-id is 0x10ec0889
ps 2 : what kind of error ?

#107
cparm

cparm

    InsanelyMac Legend

  • Retired
  • 997 posts
  • Gender:Male

Hey, thanks, it worked

I did my dsdt with 1.0.1e Graphics section do not crash with it


confirmed ;)

#108
cparm

cparm

    InsanelyMac Legend

  • Retired
  • 997 posts
  • Gender:Male

Ive changed

Notify (\_SB.PCI0.AZAL, 0x02)
...
...
...

Device (AZAL)

Notify (\_SB.PCI0.HDEF, 0x02)
...
...
...

Device (HDEF)


this method work fine, but it still can't load a stock applehda

my new dsdt.aml and dsdt_fixed.txt for GA-P35-DS3L rev2

#109
THe KiNG

THe KiNG

    InsanelyMac Legend

  • Retired Developers
  • 791 posts
  • Gender:Male

this method work fine, but it still can't load a stock applehda

That is b/c we still dont know how the hell to inject the rest of missing info for hdacontroller and platformdriver :)
I'm n00b on programming, maybe someone can make a kext to inject/overwrite these info on vanilla hda plists like BuildSmart did for badaxe2...
Someone offer?

#110
kramer2k

kramer2k

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 373 posts
Just an FYI, I've almost got the P31-DS3L worked out. I only have output via front headphone audio jack though... But it's progress!

I'm getting an error in console at startup listed multiple times...

11/21/08 12:15:42 AM kernel Sound assertion "0 != result" failed in "/SourceCache/AppleHDA/AppleHDA-157.1.24/AppleHDA/AppleHDAWidget.cpp" at line 1341 goto handler

Any additional help would be appreciated...

Attached Files



#111
cparm

cparm

    InsanelyMac Legend

  • Retired
  • 997 posts
  • Gender:Male

Just an FYI, I've almost got the P31-DS3L worked out. I only have output via front headphone audio jack though... But it's progress!

I'm getting an error in console at startup listed multiple times...

11/21/08 12:15:42 AM kernel Sound assertion "0 != result" failed in "/SourceCache/AppleHDA/AppleHDA-157.1.24/AppleHDA/AppleHDAWidget.cpp" at line 1341 goto handler

Any additional help would be appreciated...


try my applehda, it's for p35-ds3l, but the pin configuration seems to be the same

#112
kramer2k

kramer2k

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 373 posts
I thought I looked at yours and saw that the pin configs were different...I'll have another look at it later tonight.

#113
cparm

cparm

    InsanelyMac Legend

  • Retired
  • 997 posts
  • Gender:Male

I thought I looked at yours and saw that the pin configs were different...I'll have another look at it later tonight.


the configdata string inside the applehdacontroller is moded, so it's not my original one,

but look at my codec dump, it's really the same ;)





#114
kramer2k

kramer2k

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 373 posts
Woot! Your kext with my pin configs works great...but no like you said, no front headphones...

but how do you enable 5.1? Do you need to have 5.1 speakers plugged in to be able to configure it?

#115
cparm

cparm

    InsanelyMac Legend

  • Retired
  • 997 posts
  • Gender:Male

Woot! Your kext with my pin configs works great...but no like you said, no front headphones...

but how do you enable 5.1? Do you need to have 5.1 speakers plugged in to be able to configure it?


this is because i have removed all front port, so only the back panel work for now, but i'm working on the grey port and the font headphone:

Blue: set to Line In - Working
Green: set to Line-out - Working
Pink: set to Mic In - Working
Black: set to IntSpeaker - Working
Orange: set to Headphone - Working
Gray: -Removed - Work in progress

S/P-DIF In: - working - not tested
S/P-DIF Out: - Working - not tested

Front: Headphones -Removed- Work in progres
Front: Mic In -Removed- Work in progress

but how do you enable 5.1? Do you need to have 5.1 speakers plugged in to be able to configure it?

for analog 5.1,

first, play a music with itunes for exemple, and swicth between Line-out, IntSpeaker and Headphone in the sound preferences,

when you choose line-out, put the jack of you speaker in the green port
when you choose heaphone, put the jack of you speaker in the orange port
when you choose intspeaker, put the jack of you speaker in the black port

if all port give you sound, this mean 5.1 will work with an aggregate device

see the Consolation Guide, to know how to set it

#116
Taruga

Taruga

    Retired

  • Retired Developers
  • 533 posts
  • Gender:Male
  • Location:Portugal

should i give some time with 1998B or it's worthless?
i don't know about progress so far, taruga wiki is down a long time



Use this file for AD1988b Ive patched some months ago for a Asus P5K-E , should work with yours also.

#117
Taruga

Taruga

    Retired

  • Retired Developers
  • 533 posts
  • Gender:Male
  • Location:Portugal

@Taruga

hi Taruga, i'm happy that you are back :(



Im not really back yet, I cant push myself too much, Im still recovering and Im on sick leave on my 3rd month now. I mostly try to watch the osx community evolution and news, watch tv and rest as must as possible.
I cant at the moment help anyone unless with things I have ready done in the past. The pills Im taking dont allow me much more, I have no strength or mental patience to do much more than rest and watch tv. My site is off ( I know), it will be back on when I get better and return to work since I have there a full backup. I think that maybe from 20 December forward that will happen. Maybe Ill think about a mirror site to avoid down times since my hosting provider really sucks and they gave me a lot of warnings and even a 'last warning'.

Today makes a week that I finally have strength on my legs and the pain is gone and I can walk. So, things are getting better physically. On the mental side, Im still suffering from some pill side effects by I think that by late December I will be fine and ready.

Ill keep in touch when possible, but please dont ask me solve any problems now since I have my own problems to solve first. I hope you understand.

#118
Taruga

Taruga

    Retired

  • Retired Developers
  • 533 posts
  • Gender:Male
  • Location:Portugal
One advice to people with curiosity in audio and PinConfigurations, there is no need to setup them up on DSDT (do it if you want to). I just changed AZAL to HDEF and I used a couple of plists for AppleHDA to send the correct verbs to the audio codec.
PinConfigurations also knows as codec verbs are used and sent when AppleHDA establishes a link to the audio codec. And that happens with AppleHDAController, I dont see a way of DSDT editing to make some miracles I did with some codecs, like 1988b, alc861, etc... Most of them use special codec verbs to do other audio codecs setups. You can get the idea with alsa source of from some xp and vista drivers that come with codecs verbs that not only set pin configs right but also enables sound on some muted systems.
PinConfigurations are a small part of all the Codec Verbs Power !!!
If the codec verbs are set right on AppleHDAController info.plist even the PinConfigurations will be filled out if its property value is empty.
As I said before, I dont think AppleHDA will be the solution for ever and for all. That is way I started coding some months ago a generic HD Audio Driver that will not need any messy plists. AppleHDA was made only with some codecs in mind and can give a lot of different problems with some chipsets and audio codecs. Maybe Ill release a more 'smart' patcher that one click does it all or maybe Ill just continue what I was working on before I got sick, the generic 'smart' audio driver to replace AppleHDA. Most sound issues will continue without a proper driver made for PC's in mind. I think most of you will agree with what Im saying. Why most recent Realtek codecs work and some others ? Because they are very similar in pin nids, mixers, adcs and dacs and AppleHDA supports some of them with some changes. AppleHDA is always changing and things gets more hard to fix. Motherboard chipset incompatibilities, audio codecs not totally supported by AppleHDA, etc....

Since Ive started my own sound driver I realized most of the problems and issues I expect (and will expect) in the present and future with AppleHDA.kext. Even the last months before I got sick, while testing on 3 different chipsets and audio codecs I got several issues to take in consideration because the driver behaved different on the three chipsets ICH7 with ALC882, ICH8 with AD1988b and ICH9 with ALC889a. This a very complex and time consuming driver and I have no estimated date for release. The driver will have lots of additional stuff and will work will real macs also.
I just hope I recover well and can continue working on it, it would be a shame to loose all the time I spend coding it until a few months back.

I dont know if any of this makes sense to any of you guys, also, Im too drugged to think right and maybe my point of view, informations and suggestions dont make much sense. My head is still a little screwed up at the moment.

I think all the info is welcome and I think Im helping with this post on something....I hope.

#119
kramer2k

kramer2k

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 373 posts
@cpram
No dice my friend...I only get output on Rear Green output. Nothing on Black or Orange. And I can set it up to be 5.1, but again Green's my only friend...

See screenshots...there, but just no output...


@Taruga - Welcome back and I can only wish you a speedy recovery!

Attached Files



#120
ac3bcn

ac3bcn

    InsanelyMac Protégé

  • Members
  • PipPip
  • 67 posts
  • Gender:Male
  • Location:ESP
Hi Everyone, I find this information at Realtek Homepage, from ALC889a Datasheet, here's the link

http://www.realtek.c...;Downloads=true

a pair of screenshots for Verbs, Pin Configuration and Nodes.

I think it could help us to determinate Pathmaps,ConfigData, etc for ALC889a.

Here it is.

Attached Files







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