Jump to content

[HOW TO] Patch AppleHDA - Knowledge Base


  • Please log in to reply
392 replies to this topic

#1
THe KiNG

THe KiNG

    InsanelyMac Legend

  • Gurus
  • 680 posts
  • Gender:Male
Moved to: http://www.projectos...p?showtopic=465

#2
munky

munky

    Agent of Evolution

  • Retired
  • 2,900 posts
  • Location:The Land of Hairy-Arsed Highlanders
nice guide man... will be trying this soon :)

#3
realityiswhere

realityiswhere

    Insanely Unreal

  • Retired
  • 345 posts
  • Gender:Male
  • Location:Outskirts of insanity
VERY nice guide.

#4
THe KiNG

THe KiNG

    InsanelyMac Legend

  • Gurus
  • 680 posts
  • Gender:Male
Thanks

Its not complete, was a fast write... I have to add on it more info and howto...
For now I'm stuck on codec verbs...searching on intel docs(I hate that, especial b/c dunno for what to look) also that missing info on terms makes this patching stuff even more hard..
Laso if u look on my converted dump there are some connections with an "*" on it, also dunno why:
CONNECTION: 5
12* 13 14 15 38
Maybe Taruga can help us to understand better.

L.E. Seems that "*" means connection in use.
Dunno for sure, maybe someone can confirm/or not this.

#5
munky

munky

    Agent of Evolution

  • Retired
  • 2,900 posts
  • Location:The Land of Hairy-Arsed Highlanders
attaching a ruby script which will convert the hex values to decimal.

usage:

chmod +x convert_hex_to_dec.rb
./convert_hex_to_dec.rb dumpfile.txt

it will output to stdout. if you want u can pipe it to a file with:

./convert_hex_to_dec.rb dumpfile.txt >newdumpfile.txt

Attached Files



#6
THe KiNG

THe KiNG

    InsanelyMac Legend

  • Gurus
  • 680 posts
  • Gender:Male

attaching a ruby script which will convert the hex values to decimal.

:hysterical:
THANKS for this man, manual convert was a PITA!
I will add it on linux dump section, to keep things organized...
Thanks again! :D

L.E. Info added on guide, also added codecgraph how to.

#7
PM!

PM!

    Dodo vé pa dir i dor !

  • Members
  • PipPipPipPipPipPipPip
  • 943 posts
  • Gender:Male
  • Location:Brussels
I get
File "/Users/paul/Desktop/codecgraph/codecgraph.py", line 496, in <module>
	main(sys.argv)
  File "/Users/paul/Desktop/codecgraph/codecgraph.py", line 492, in main
	ci = CodecInfo(f)
  File "/Users/paul/Desktop/codecgraph/codecgraph.py", line 442, in __init__
	n = Node(self, item, subitems)
  File "/Users/paul/Desktop/codecgraph/codecgraph.py", line 106, in __init__
	self.nid = int(m.group(1), 16)
AttributeError: 'NoneType' object has no attribute 'group'
when trying to generate the codec.txt.svg it says then
Generating ALC889a.txt.svg
But
bash-3.2# ls ~/Desktop/codecgraph/
.DS_Store	COPYING		README		codecgraph.py	samples
ALC889a.txt	IDEAS		codecgraph	codecs.txt
BUGS		Makefile	codecgraph.1	out

What's the matter ?

Does the .profile file goes in ~/ ? Which profile file is it ? graphviz ?

Thank's
PM!


EDIT : OK my dump was wrong. I't ok now... i can follow the guide.

#8
stickpin

stickpin

    InsanelyMac Protégé

  • Members
  • PipPip
  • 79 posts
  • Gender:Male
  • Location:Israel
My little research about AppleHDA, i don't know if this things is right or not, just my experience.

We trying to understand how to modify codec verb (ConfigData)

The ConfigData looks like this:
<01471cf0 01471d00 01471e11 01471f40 01571c30 01571d40 01571e01 01571f01 01671c0f 01671d00 01671e00 01671f40 01771c0f 01771d00 01771e00 01771f40 01871c10 01871d01 01871ea0 01871f90 01971c11 01971d01 01971ea0 01971f90 01a71c20 01a71d30 01a71e81 01a71f01 01b71c50 01b71d70 01b71e21 01b71f01 01f71c30 01f71de0 01f71ec5 01f71f01 01e71c60 01e71de0 01e71e45 01e71f01>

As you can see, here is group of 4 values: 01471cf0 01471d00 01471e11 01471f40

This is what i found on every group:

01471xx = Green (Internal Speaker)
01571xx = Black (Line Out)
01671xx = ?
01771xx = ?
01871xx = Pink (External Mic In)
01971xx = ?
01a71xx = Blue (Line In)
01b71xx = Front (Headphones)
01f71xx = ?
01e71xx = ?

Another finding, again, im not sure if its right.

Group look like this:
01471cf0 01471d00 01471e11 01471f40

Value 1) Something with sound mapping <- if you change this value, you broke the sound.
Value 2) ?
Value 3) Changing Name (ex: Line out to Headphones)
Lets say if you change 01471e11 to 01471e40 you'll see that your Internal Speaker changed to Headphones, but only the name, mapping still the same.
Value 4) ?

Thats it. :)
Enjoy.

Feel free to add your researches or correct ours.

#9
STLVNUB

STLVNUB

    InsanelyMac Legend

  • Coders
  • 1,096 posts
  • Gender:Male
Gave link to Codecgraph to Taruga here post #15 back in FEB '08.
Good to see someone finally found value in it.
Never knew if Taruga did.
Speaking of Taruga
What happened to him???

Good Tutorial though.

#10
justvisiting

justvisiting

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 273 posts
Codec Graph for STAC9274D found on badaxe2 in hex and decimal and archived as a zip file and codec dump

TheKing:

Layouts dunno... I leave them as they are...someone?


look in Taruga's patched AppleHDA.kext/Contents/Resources. Here you will find a number of Layout.xml and PathMap.xml files, it might help.

Attached Files



#11
jaysonz

jaysonz

    InsanelyMac Protégé

  • Members
  • Pip
  • 25 posts
hey i was wandering how to convert the hex to dec in OSX calculator. im really confused

#12
THe KiNG

THe KiNG

    InsanelyMac Legend

  • Gurus
  • 680 posts
  • Gender:Male

look in Taruga's patched AppleHDA.kext/Contents/Resources. Here you will find a number of Layout.xml and PathMap.xml files, it might help.

What you quote was from 5. Editing AppleHDAController Info.Plist section <--- That Layouts, under the PostConstructionInitialization entry, I dont get what are you trying to say...

@jaysonz Why you still try to use calculator for converssion now once u have a script for that, also I dont get what is not clear for using calculator...if you still want to spend a lot of time... :blink:

#13
MadTux

MadTux

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 103 posts
  • Gender:Male

My little research about AppleHDA, i don't know if this things is right or not, just my experience.

Group look like this:
01471cf0 01471d00 01471e11 01471f40

Value 1) Something with sound mapping <- if you change this value, you broke the sound.
Value 2) ?
Value 3) Changing Name (ex: Line out to Headphones)
Lets say if you change 01471e11 to 01471e40 you'll see that your Internal Speaker changed to Headphones, but only the name, mapping still the same.
Value 4) ?

Thats it. :(
Enjoy.

Feel free to add your researches or correct ours.

Last one; 01471f"40" changes connection type from Combo, Internal, 1/8 Jack

#14
BlackCH

BlackCH

    InsanelyMac Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,611 posts
  • Gender:Male
  • Location:BCN
Im trying this to work on an ADI1981.... took the ADI1988b patched from taruga as a model....
no success so far...

how to generate a diagram with codecgraph?

#15
cparm

cparm

    InsanelyMac Legend

  • Retired
  • 997 posts
  • Gender:Male
very very interesting topic, thank you THe King ;)

#16
spanakorizo

spanakorizo

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 747 posts
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

#17
BlackCH

BlackCH

    InsanelyMac Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,611 posts
  • Gender:Male
  • Location:BCN
I made a graph from the codec dump

but I get this errors while doing it:

bash-3.2# ./codecgraph /Users/dlow/Desktop/codecgraph/ADI1981.txt
Codec: Analog Devices AD1981
Node 0x05: Amp-In vals count is wrong: values found: 2. expected: 1
Node 0x08: Amp-In vals count is wrong: values found: 0. expected: 1
Node 0x09: Amp-In vals count is wrong: values found: 2. expected: 1
Node 0x18: Amp-In vals count is wrong: values found: 2. expected: 1
Generating ADI1981.txt.svg


Although the graphic seems to be ok...

#18
MinGyoon

MinGyoon

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 3 posts
Dear,

First, thank very much this helpful guide to understand AppleHDA structure.
This is what I was looking for during a month to understand...

BTW, when I tryed to build Graphviz from MacPort, I failed...(becuase I'm newbie of Mac)
However, I found the binary package of this 'Graphviz' for Leopard from here http://www.pixelglow...phviz/download/. It is version 2.18(March 2008).

I do not test yet, but I hope it will be helpful for others.

Thanks,

#19
slim2001

slim2001

    InsanelyMac Protégé

  • Members
  • PipPip
  • 50 posts
  • Gender:Male

I get

File "/Users/paul/Desktop/codecgraph/codecgraph.py", line 496, in <module>
	main(sys.argv)
  File "/Users/paul/Desktop/codecgraph/codecgraph.py", line 492, in main
	ci = CodecInfo(f)
  File "/Users/paul/Desktop/codecgraph/codecgraph.py", line 442, in __init__
	n = Node(self, item, subitems)
  File "/Users/paul/Desktop/codecgraph/codecgraph.py", line 106, in __init__
	self.nid = int(m.group(1), 16)
AttributeError: 'NoneType' object has no attribute 'group'
when trying to generate the codec.txt.svg it says then
Generating ALC889a.txt.svg
But
bash-3.2# ls ~/Desktop/codecgraph/
.DS_Store	COPYING		README		codecgraph.py	samples
ALC889a.txt	IDEAS		codecgraph	codecs.txt
BUGS		Makefile	codecgraph.1	out

What's the matter ?

Does the .profile file goes in ~/ ? Which profile file is it ? graphviz ?

Thank's
PM!


EDIT : OK my dump was wrong. I't ok now... i can follow the guide.





You say your dump was wrong, how was it wrong? I am getting the same error, i converted the dump to dec but i can't convert it to svg format. if my dump is in hex format then it converts to svg without any problems

#20
Snooker216

Snooker216

    InsanelyMac Protégé

  • Members
  • Pip
  • 25 posts

- after install is done and u got this last mesg: ---> Cleaning graphviz type in terminal(press enter after each line):
cd
then type:
nano .profile
copy/paste this line in terminal: export PATH=/opt/local/bin:/opt/local/sbin:$PATH
Then press ctrl+x
type y
then enter
Jobe is done, close and open terminal again for the next step:
- Download CodecGraph *Tip look first on already uploaded codec graphs, on the main site, if you codec is already there(specific hw also!) then u are lucky and u don't need to make a new one, just skip the making part and just convert hex to dec for easy undestanding and plist modd.
- unzip it to desktop and rename the folder to codecgraph(also rename your codec dump to just 1 name if it have more, like alcxxx.txt), put your codec dump in the same folder
- now in terminal cd to your codecgraph folder example:
cd /Users/theking/Desktop/codecgraph
- then type:
./codecgraph /Users/theking/Desktop/codecgraph/M50SV.txt *replace "theking" & "M50SV.txt" with your user and codec name file


That's what I get:
bash-3.2# ./codecgraph /Users/snooker/Desktop/codecgraph/dumpfile.txt 
error: dot executable not found (did you install graphviz?)
bash-3.2#
I definately did install graphwiz. Procedure ended as expected with ---> Cleaning graphviz.
I presume it depends on the location of the .profile file.
Is it correct that is has to be in my home directory? because a simple cd command is directing me to there.





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