As I promised(with some delay) here I will write the new guide.
It will take some time so be patient until is done.
Intro
There is already a better solution for sound here: VoodooHDA
This guide is for those who want to use AppleHDA and/or try to learn how it works.
Credits: To be filled.
Chapter I: Collecting codec info/dumps/etc.
There are several way to get codec info, my advice use them all.
From Linux:
Boot any live linux distro(try to use latest avail, and also if possible use latest ALSA drivers)
Once you are in GUI start terminal and run this command:
cat /proc/asound/card0/codec#1 > ~/Desktop/codec_dump.txt
or
Use this script from zhell
QUOTE
cd ~/Desktop && mkdir CodecDump && for c in /proc/asound/card*/codec#*; do f="${c/\/*card/card}"; cat "$c" > CodecDump/${f//\//-}.txt; done && zip -r CodecDump.zip CodecDump
This will yield a file CodecDump.zip containing the codec dumps from all your sound cards.
This will yield a file CodecDump.zip containing the codec dumps from all your sound cards.
Save it in a safe place, mail it etc.
On OS X we must use the dump to get a graphical interface, convert it to decimal(I will explain later why), get the codec verbs from it and fix them for OS X.
a. Creating Codec Graph:
- Download and install GRAPHVIZ for Mac OS X
- Download CodecGraph, unpack it to descktop, copy on it the linux codec_dump.txt then start terminal and type:
QUOTE
cd ~/Desktop/codecgraph
- then type:
./codecgraph codec_dump.txt *replace "codec_dump.txt" with your codec name file(if you gave it a specific name)
- then type:
./codecgraph codec_dump.txt *replace "codec_dump.txt" with your codec name file(if you gave it a specific name)
-Now you should have in the codecgraph folder a file codec_dump.txt.svg
If u like to see it open it with Safari or Firefox
b. Converting CodecGraph and CodecDump from hex to decimal:
- Download convert_hex_to_dec.rb.zip Thanks to Munky who made it.
- Unpack it in the same folder used earlier(codecgraph)
- Type in terminal:
QUOTE
cd ~/Desktop/codecgraph
chmod +x ./convert_hex_to_dec.rb
./convert_hex_to_dec.rb codec_dump.txt.svg > ~/Desktop/codecgraph/codec_dump_dec.txt.svg *replace "codec_dump.txt" with your user and codec name file(if you gave it a specific name)
./convert_hex_to_dec.rb codec_dump.txt > ~/Desktop/codecgraph/codec_dump_dec.txt *replace "codec_dump.txt" with your user and codec name file(if you gave it a specific name)
chmod +x ./convert_hex_to_dec.rb
./convert_hex_to_dec.rb codec_dump.txt.svg > ~/Desktop/codecgraph/codec_dump_dec.txt.svg *replace "codec_dump.txt" with your user and codec name file(if you gave it a specific name)
./convert_hex_to_dec.rb codec_dump.txt > ~/Desktop/codecgraph/codec_dump_dec.txt *replace "codec_dump.txt" with your user and codec name file(if you gave it a specific name)
From Vista/Windows7:
Open RegistryEditor and search for PinConfig
Dump all keys if there are more, in particular should be one bigger that contain all PinConfigOverRides(aka codec verbs)
Open the dumped key with a text editor, it should look like this:
CODE
"0000"=hex:f0,1c,17,01
"0001"=hex:11,1d,17,01
"0002"=hex:11,1e,17,01
"0003"=hex:41,1f,17,01
"0004"=hex:40,1c,27,01
"0005"=hex:09,1d,27,01
"0006"=hex:a3,1e,27,01
"0007"=hex:99,1f,27,01
"0008"=hex:10,1c,47,01
"0009"=hex:01,1d,47,01
"0010"=hex:13,1e,47,01
"0011"=hex:99,1f,47,01
"0012"=hex:1f,1c,57,01
"0013"=hex:10,1d,57,01
"0014"=hex:21,1e,57,01
"0015"=hex:02,1f,57,01
"0016"=hex:f0,1c,67,01
"0017"=hex:11,1d,67,01
"0018"=hex:11,1e,67,01
"0019"=hex:41,1f,67,01
"0020"=hex:f0,1c,77,01
"0021"=hex:11,1d,77,01
"0022"=hex:11,1e,77,01
"0023"=hex:41,1f,77,01
"0024"=hex:30,1c,87,01
"0025"=hex:9c,1d,87,01
"0026"=hex:a1,1e,87,01
"0027"=hex:02,1f,87,01
"0028"=hex:f0,1c,97,01
"0029"=hex:11,1d,97,01
"0030"=hex:11,1e,97,01
"0031"=hex:41,1f,97,01
"0032"=hex:3f,1c,a7,01
"0033"=hex:34,1d,a7,01
"0034"=hex:81,1e,a7,01
"0035"=hex:02,1f,a7,01
"0036"=hex:f0,1c,b7,01
"0037"=hex:11,1d,b7,01
"0038"=hex:11,1e,b7,01
"0039"=hex:41,1f,b7,01
"0040"=hex:f0,1c,c7,01
"0041"=hex:11,1d,c7,01
"0042"=hex:11,1e,c7,01
"0043"=hex:41,1f,c7,01
"0044"=hex:2d,1c,d7,01
"0045"=hex:85,1d,d7,01
"0046"=hex:16,1e,d7,01
"0047"=hex:40,1f,d7,01
"0048"=hex:20,1c,e7,01
"0049"=hex:11,1d,e7,01
"0050"=hex:45,1e,e7,01
"0051"=hex:02,1f,e7,01
"0052"=hex:f0,1c,f7,01
"0053"=hex:11,1d,f7,01
"0054"=hex:11,1e,f7,01
"0055"=hex:41,1f,f7,01
"NumVerbs"=hex:38,00,00,00
"0001"=hex:11,1d,17,01
"0002"=hex:11,1e,17,01
"0003"=hex:41,1f,17,01
"0004"=hex:40,1c,27,01
"0005"=hex:09,1d,27,01
"0006"=hex:a3,1e,27,01
"0007"=hex:99,1f,27,01
"0008"=hex:10,1c,47,01
"0009"=hex:01,1d,47,01
"0010"=hex:13,1e,47,01
"0011"=hex:99,1f,47,01
"0012"=hex:1f,1c,57,01
"0013"=hex:10,1d,57,01
"0014"=hex:21,1e,57,01
"0015"=hex:02,1f,57,01
"0016"=hex:f0,1c,67,01
"0017"=hex:11,1d,67,01
"0018"=hex:11,1e,67,01
"0019"=hex:41,1f,67,01
"0020"=hex:f0,1c,77,01
"0021"=hex:11,1d,77,01
"0022"=hex:11,1e,77,01
"0023"=hex:41,1f,77,01
"0024"=hex:30,1c,87,01
"0025"=hex:9c,1d,87,01
"0026"=hex:a1,1e,87,01
"0027"=hex:02,1f,87,01
"0028"=hex:f0,1c,97,01
"0029"=hex:11,1d,97,01
"0030"=hex:11,1e,97,01
"0031"=hex:41,1f,97,01
"0032"=hex:3f,1c,a7,01
"0033"=hex:34,1d,a7,01
"0034"=hex:81,1e,a7,01
"0035"=hex:02,1f,a7,01
"0036"=hex:f0,1c,b7,01
"0037"=hex:11,1d,b7,01
"0038"=hex:11,1e,b7,01
"0039"=hex:41,1f,b7,01
"0040"=hex:f0,1c,c7,01
"0041"=hex:11,1d,c7,01
"0042"=hex:11,1e,c7,01
"0043"=hex:41,1f,c7,01
"0044"=hex:2d,1c,d7,01
"0045"=hex:85,1d,d7,01
"0046"=hex:16,1e,d7,01
"0047"=hex:40,1f,d7,01
"0048"=hex:20,1c,e7,01
"0049"=hex:11,1d,e7,01
"0050"=hex:45,1e,e7,01
"0051"=hex:02,1f,e7,01
"0052"=hex:f0,1c,f7,01
"0053"=hex:11,1d,f7,01
"0054"=hex:11,1e,f7,01
"0055"=hex:41,1f,f7,01
"NumVerbs"=hex:38,00,00,00
Copy all and then go to DiaboliK's Vista HDA Verb Converter paste data in window and convert them, copy the result and save it in a text document for later usage.
After convert they should look like this:
QUOTE
<01171CF0 01171D11 01171E11 01171F41 01271C40 01271D09 01271EA3 01271F99 01471C10 01471D01 01471E13 01471F99 01571C1F 01571D10 01571E21 01571F02 01671CF0 01671D11 01671E11 01671F41 01771CF0 01771D11 01771E11 01771F41 01871C30 01871D9C 01871EA1 01871F02 01971CF0 01971D11 01971E11 01971F41 01A71C3F 01A71D34 01A71E81 01A71F02 01B71CF0 01B71D11 01B71E11 01B71F41 01C71CF0 01C71D11 01C71E11 01C71F41 01D71C2D 01D71D85 01D71E16 01D71F40 01E71C20 01E71D11 01E71E45 01E71F02 01F71CF0 01F71D11 01F71E11 01F71F41>
Using VoodooHDA dump tool:
QUOTE
To get your codec dump use the shipped voodoohdahelper tool with -dump flag (./voodoohdahelper -dump)
Save the dump for later usage.
After all this you should have:
- codec_dump.txt in hex
- codec_dump_dec.txt in decimal
- codec_dump.txt.svg in hex
- codec_dump_dec.txt.svg in decimal
- Vista converted PinConfigOverRides
- VoodooHDA codec dump
Save them all in a safe place.
Chapter II: Enabling audio
By default OS X can't see your audio device b/c on PC's is under different name on DSDT: AZAL or some other name instead HDEF, or is not present at all.
Since I don't like so called "efi strings"(device-properties injection) i will show only two way:
- Simple way is to use an Enabler like HDAEnabler.kext
- Complicate way(my preferred) is to fix and/or add it on DSDT:
On most cases audio device is on DSDT on _ADR 0x001B0000, find Name (_ADR, 0x001B0000) and replace the Device name from AZAL(or whatever name has) to HDEF, if the device is not present it must be added.
Then comes the injection required for audio:
This is an general audio injection and should work for all codecs:
CODE
Device (HDEF)
{
Name (_ADR, 0x001B0000)
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x04)
{
"layout-id",
Buffer (0x04)
{
0x0C, 0x00, 0x00, 0x00
},
"PinConfigurations",
Buffer (Zero) {}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}
{
Name (_ADR, 0x001B0000)
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x04)
{
"layout-id",
Buffer (0x04)
{
0x0C, 0x00, 0x00, 0x00
},
"PinConfigurations",
Buffer (Zero) {}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}
It will be a nice addition to DSDT patcher made by fassl
Also make sure DTGP Method is present in your DSDT, if not add it after/before first Method you find in DSDT.
It should look like this:
CODE
Method (DTGP, 5, NotSerialized)
{
If (LEqual (Arg0, Buffer (0x10)
{
/* 0000 */ 0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44,
/* 0008 */ 0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
}))
{
If (LEqual (Arg1, One))
{
If (LEqual (Arg2, Zero))
{
Store (Buffer (One)
{
0x03
}, Arg4)
Return (One)
}
If (LEqual (Arg2, One))
{
Return (One)
}
}
}
Store (Buffer (One)
{
0x00
}, Arg4)
Return (Zero)
}
{
If (LEqual (Arg0, Buffer (0x10)
{
/* 0000 */ 0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44,
/* 0008 */ 0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
}))
{
If (LEqual (Arg1, One))
{
If (LEqual (Arg2, Zero))
{
Store (Buffer (One)
{
0x03
}, Arg4)
Return (One)
}
If (LEqual (Arg2, One))
{
Return (One)
}
}
}
Store (Buffer (One)
{
0x00
}, Arg4)
Return (Zero)
}
Chapter III: Fixing AppleHDA.kext
There are two way to do it, editing original plists or patching it "on the fly" using a dummy.kext.
I will explain the second method b/c it apply on first one too.
So what we have to fix on this kext?
If you look on it(right click show package contents) you will find under Content folder the main Info.plist(don't touch it) and a Plugins folder. There are the plugins that we have to fix, but not all just the Info.plist from this one:
a. AppleHDAController.kext
B. AppleHDAHardwareConfigDriver.kext (present only on Snow/10.5.7+)
c. AppleHDAPlatformDriver.kext
I will treat each one separate, and on the end I will show you how to join them in one single dummy.kext
Chapter III-a: Fixing AppleHDAController.kext Info.plist
Lets take a look on AppleHDAController Info.plist(make a copy from original kext on your work directory)

Under IOKitPersonalities/BuiltInHDA/HDAConfigDefault is our area of interest.
You will notice a lot of Item's, you will need just one for your codec so make some room and delete the rest.
As you can see in the picture this is what we have to do/fix:
- CodecID from decimal codec_dump_dec.txt copy/paste Vendor Id value.
- ConfigData here we will add fixed codec verbs, see dedicated section on how to make/fix them.
- FuncGroup must be 1
- LayoutID must be 12 a short notice on this one do not change it to other value unless you are change it also in HDAEnabler.kext or DSDT injection, by default is set to 12 in HDAEnabler.kext or my generic DSDT injection, best way to leave it like that and do "cosmetic" stuff after you get the sound working...
ConfigData/CodecVerbs how to:
You can fix them in two way, manual or automatic thanks to Signal64 who put all our findings in one script for easy use called VerbIt
Unpack it in the same codecgraph folder you used earlier then start terminal and type:
QUOTE
cd /Users/theking/Desktop/codecgraph
./verbit codec_dump.txt > verbs.txt *replace "theking" & "codec_dump.txt" with your user and codec name file(if you gave it a specific name)
./verbit codec_dump.txt > verbs.txt *replace "theking" & "codec_dump.txt" with your user and codec name file(if you gave it a specific name)
After is done it will output two files verbs.txt and verbitdebug.txt
Verbs.txt:
CODE
Verbs from Linux Codec Dump File: codec_dump.txt
Codec: Realtek ALC889A Address: 2 DevID: 283904133 (0x10ec0885)
Jack Color Description Node PinDefault Original Verbs
--------------------------------------------------------------------------------------------------------
1/8 Green Line Out at Ext Rear 20 0x14 0x01014410 21471c10 21471d44 21471e01 21471f01
1/8 Black Line Out at Ext Rear 21 0x15 0x01011412 21571c12 21571d14 21571e01 21571f01
1/8 Orange Line Out at Ext Rear 22 0x16 0x01016411 21671c11 21671d64 21671e01 21671f01
1/8 Grey Line Out at Ext Rear 23 0x17 0x01012414 21771c14 21771d24 21771e01 21771f01
1/8 Pink Mic at Ext Rear 24 0x18 0x01a19c40 21871c40 21871d9c 21871ea1 21871f01
1/8 Pink Mic at Ext Front 25 0x19 0x02a19c50 21971c50 21971d9c 21971ea1 21971f02
1/8 Blue Line In at Ext Rear 26 0x1a 0x0181344f 21a71c4f 21a71d34 21a71e81 21a71f01
1/8 Green HP Out at Ext Front 27 0x1b 0x02214c20 21b71c20 21b71d4c 21b71e21 21b71f02
ATAPI Unknown CD at Int ATAPI 28 0x1c 0x593301f0 21c71cf0 21c71d01 21c71e33 21c71f59
Optical White Line Out at Ext N/A 29 0x1d 0x4005e601 21d71c01 21d71de6 21d71e05 21d71f40
Comb Orange SPDIF Out at Ext Rear 30 0x1e 0x014b6130 21e71c30 21e71d61 21e71e4b 21e71f01
Comb Yellow SPDIF In at Ext Rear 31 0x1f 0x01cb7160 21f71c60 21f71d71 21f71ecb 21f71f01
--------------------------------------------------------------------------------------------------------
Jack Color Description Node PinDefault Modified Verbs
--------------------------------------------------------------------------------------------------------
1/8 Green Line Out at Ext Rear 20 0x14 0x01014410 21471c10 21471d40 21471e01 21471f01
1/8 Black Line Out at Ext Rear 21 0x15 0x01011412 21571c70 21571d10 21571e01 21571f01
1/8 Orange Line Out at Ext Rear 22 0x16 0x01016411 21671c80 21671d60 21671e01 21671f01
1/8 Grey Line Out at Ext Rear 23 0x17 0x01012414 21771c90 21771d20 21771e01 21771f01
1/8 Pink Mic at Ext Rear 24 0x18 0x01a19c40 21871c40 21871d90 21871ea1 21871f01
1/8 Pink Mic at Ext Front 25 0x19 0x02a19c50 21971c50 21971d90 21971ea1 21971f01
1/8 Blue Line In at Ext Rear 26 0x1a 0x0181344f 21a71ca0 21a71d30 21a71e81 21a71f01
1/8 Green HP Out at Ext Front 27 0x1b 0x02214c20 21b71c20 21b71d40 21b71e21 21b71f01
Optical White Line Out at Ext N/A 29 0x1d 0x4005e601 21d71cb0 21d71de0 21d71e05 21d71f40
Comb Orange SPDIF Out at Ext Rear 30 0x1e 0x014b6130 21e71c30 21e71d60 21e71e4b 21e71f01
Comb Yellow SPDIF In at Ext Rear 31 0x1f 0x01cb7160 21f71c60 21f71d70 21f71ecb 21f71f01
--------------------------------------------------------------------------------------------------------
Verbitdebug.txt:
CODE
Blacklist:
411111f0 400000f0 CD at Int ATAPI
Removed Nodes: 0x1c
Checking 71c Associations
Current Associations
21471c10 = 1
21571c12 = 1
21671c11 = 1
21771c14 = 1
21871c40 = 4
21971c50 = 5
21a71c4f = 4
21b71c20 = 2
21d71c01 = 1 note: Changed 0 to 1
21e71c30 = 3
21f71c60 = 6
Used associations = 1 1 1 1 4 5 4 2 1 3 6
Unused associations = 7 8 9 a b c d e
Correcting duplicate associations
Checking if 1 already exists in: 1 1 1 4 5 4 2 1 3 6
duplicate found - Is this the first time we've seen this association?
yes - ignoring
Checking if 1 already exists in: 1 1 1 4 5 4 2 1 3 6
duplicate found - Is this the first time we've seen this association?
no - replacing association with: 7
Checking if 1 already exists in: 1 7 1 4 5 4 2 1 3 6
duplicate found - Is this the first time we've seen this association?
no - replacing association with: 8
Checking if 1 already exists in: 1 7 8 4 5 4 2 1 3 6
duplicate found - Is this the first time we've seen this association?
no - replacing association with: 9
Checking if 4 already exists in: 1 7 8 9 5 4 2 1 3 6
duplicate found - Is this the first time we've seen this association?
yes - ignoring
Checking if 5 already exists in: 1 7 8 9 4 4 2 1 3 6
no duplicate found
Checking if 4 already exists in: 1 7 8 9 4 5 2 1 3 6
duplicate found - Is this the first time we've seen this association?
no - replacing association with: a
Checking if 2 already exists in: 1 7 8 9 4 5 a 1 3 6
no duplicate found
Checking if 1 already exists in: 1 7 8 9 4 5 a 2 3 6
duplicate found - Is this the first time we've seen this association?
no - replacing association with: b
Checking if 3 already exists in: 1 7 8 9 4 5 a 2 b 6
no duplicate found
Checking if 6 already exists in: 1 7 8 9 4 5 a 2 b 3
no duplicate found
New 71c Associations
Before After
--------------------------------------------------
21471c10 21471c10 21471d44 21471e01 21471f01
21571c12 21571c70 21571d14 21571e01 21571f01
21671c11 21671c80 21671d64 21671e01 21671f01
21771c14 21771c90 21771d24 21771e01 21771f01
21871c40 21871c40 21871d9c 21871ea1 21871f01
21971c50 21971c50 21971d9c 21971ea1 21971f02
21a71c4f 21a71ca0 21a71d34 21a71e81 21a71f01
21b71c20 21b71c20 21b71d4c 21b71e21 21b71f02
21d71c01 21d71cb0 21d71de6 21d71e05 21d71f40
21e71c30 21e71c30 21e71d61 21e71e4b 21e71f01
21f71c60 21f71c60 21f71d71 21f71ecb 21f71f01
Reset 71d Misc to 0
New 71d Associations
Before After
--------------------------------------------------
21471d44 21471c10 21471d40 21471e01 21471f01
21571d14 21571c70 21571d10 21571e01 21571f01
21671d64 21671c80 21671d60 21671e01 21671f01
21771d24 21771c90 21771d20 21771e01 21771f01
21871d9c 21871c40 21871d90 21871ea1 21871f01
21971d9c 21971c50 21971d90 21971ea1 21971f02
21a71d34 21a71ca0 21a71d30 21a71e81 21a71f01
21b71d4c 21b71c20 21b71d40 21b71e21 21b71f02
21d71de6 21d71cb0 21d71de0 21d71e05 21d71f40
21e71d61 21e71c30 21e71d60 21e71e4b 21e71f01
21f71d71 21f71c60 21f71d70 21f71ecb 21f71f01
Correct 71f 02 FP to 01
New 71f Associations
Before After
--------------------------------------------------
21471d44 21471c10 21471d40 21471e01 21471f01
21571d14 21571c70 21571d10 21571e01 21571f01
21671d64 21671c80 21671d60 21671e01 21671f01
21771d24 21771c90 21771d20 21771e01 21771f01
21871d9c 21871c40 21871d90 21871ea1 21871f01
21971d9c 21971c50 21971d90 21971ea1 21971f01
21a71d34 21a71ca0 21a71d30 21a71e81 21a71f01
21b71d4c 21b71c20 21b71d40 21b71e21 21b71f01
21d71de6 21d71cb0 21d71de0 21d71e05 21d71f40
21e71d61 21e71c30 21e71d60 21e71e4b 21e71f01
21f71d71 21f71c60 21f71d70 21f71ecb 21f71f01
The codec I used in example, gigafail ALC889A(rebranded ALC885) was a easy one to fix, it just needs some minor adjustments(like setting one of the mics as internal and so on) and is ready to go, so to completely understand how it goes you need to go deeper, next is manual patching/explanation.
So what is a codec verb?
For each input/output there is a sequence of 4 verbs.
Lets take an example from codec used before:
QUOTE
Jack Color Description Node PinDefault Original Verbs
--------------------------------------------------------------------------------------------------------
1/8 Green Line Out at Ext Rear 20 0x14 0x01014410 21471c10 21471d44 21471e01 21471f01
--------------------------------------------------------------------------------------------------------
1/8 Green Line Out at Ext Rear 20 0x14 0x01014410 21471c10 21471d44 21471e01 21471f01
Its about NodeID(NID) 0x14 in hex, 20 in decimal:
The default verbs for it: 21471c10 21471d44 21471e01 21471f01
21471c10:
2471c10 = CAd (Codec Adress)
21471c10 = NID (NodeID)
21471c10 = Verb Commands like 71"c" then "d", "e" ,"f"
21471c10 = Verb Data
And the same for the rest.
I think Cad, NID and Verb Commands are pretty simple to figure out: first 2 you get them from linux dump, and commands are standard 71c, 71d, 71e, 71f.
Lets see about verb data:
- 71cXY X=Default Association Y=Sequence
Default Association and Sequence are used together by software to group Pin Complexes (and therefore jacks) together into functional blocks to support multichannel operation. Software may assume that all jacks with the same association number are intended to be grouped together, for instance to provide six channel analog output. The Default Association can also be used by software to prioritize resource allocation in constrained situations. Lower Default Association values would be higher in priority for resources such as processing nodes or Input and Output Converters. Note that this is the default association only, and software can override this value if required, in particular if the user provides additional information about the particular system configuration. A value of 0000b is reserved and should not be used. Software may interpret this value to indicate that the Pin Configuration data has not been properly initialized. A value of 1111b is a special value indicating that the Association has the lowest priority. Multiple different Pin Complexes may share this value, and each is intended to be exposed as independent devices.
Sequence indicates the order of the jacks in the association group. The lowest numbered jack in the association group should be assigned the lowest numbered channels in the stream, etc. The numbers need not be sequential within the group, only the order matters. Sequence numbers within a set of Default Associations must be unique.
*My notes for this, if you look on the vanilla codec verb(no matter what codec) you will see that Sequence is always 0.
Why that, and why for us on our codec verbs is different? Simple b/c Apple dosen't have multichannel analog out! so you must change it to 0.
*About Default Association, Keep the default one, in order, and on those that are the same replace them with new one that dosen't exist already in the dump... the values you can use are: 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d and f.(see what does verbit if you still don't understand)
- 71dXY X=Color Y=Misc
Color indicates the color of the physical jack for use by software.
CODE
Unknown 0
Black 1
Grey 2
Blue 3
Green 4
Red 5
Orange 6
Yellow 7
Purple 8
Pink 9
Reserved A-D
White E
Other F
Black 1
Grey 2
Blue 3
Green 4
Red 5
Orange 6
Yellow 7
Purple 8
Pink 9
Reserved A-D
White E
Other F
Misc is a bit field used to indicate other information about the jack. Currently, only bit 0 is defined. If bit 0 is set, it indicates that the jack has no presence detect capability, so even if a Pin Complex indicates that the codec hardware supports the presence detect functionality on the jack, the external circuitry is not capable of supporting the functionality.
Reserved 3
Reserved 2
Reserved 1
Jack Detect Override 0
*Use 0 for Jack Detect - External Device(e.g. Headphones Mic etc)
Use 1 for Jack Detect Disabled - Internal Device(e.g. Internal speakers, Internal mic)
71eXY X=Default Device Y=Connection Type
Default Device] indicates the intended use of the jack or device. This can indicate either the label on the jack or the device that is hardwired to the port, as with integrated speakers and the like.
CODE
Line Out 0
Speaker 1
HP Out 2
CD 3
SPDIF Out 4
Digital Other Out 5
Modem Line Side 6
Modem Handset Side 7
Line In 8
AUX 9
Mic In A
Telephony B
SPDIF In C
Digital Other In D
Reserved E
Other F
Speaker 1
HP Out 2
CD 3
SPDIF Out 4
Digital Other Out 5
Modem Line Side 6
Modem Handset Side 7
Line In 8
AUX 9
Mic In A
Telephony B
SPDIF In C
Digital Other In D
Reserved E
Other F
Connection Type indicates the type of physical connection, such as a 1/8-inch stereo jack or an optical digital connector, etc. Software can use this information to provide helpful user interface descriptions to the user or to modify reported codec capabilities based on the capabilities of the physical transport external to the codec.
CODE
Unknown 0
1/8" stereo/mono 1
1/4" stereo/mono 2
ATAPI internal 3
RCA 4
Optical 5
Other Digital 6
Other Analog 7
Multichannel Analog (DIN) 8
XLR/Professional 9
RJ-11 (Modem) A
Combination B
Other F
1/8" stereo/mono 1
1/4" stereo/mono 2
ATAPI internal 3
RCA 4
Optical 5
Other Digital 6
Other Analog 7
Multichannel Analog (DIN) 8
XLR/Professional 9
RJ-11 (Modem) A
Combination B
Other F
71fXY X=Port Connectivity Y=Location
Port Connectivity indicates the external connectivity of the Pin Complex. Software can use this value to know what Pin Complexes are connected to jacks, internal devices, or not connected at all.
00b - The Port Complex is connected to a jack (1/8", ATAPI, etc.).
01b - No physical connection for Port.
10b - A fixed function device (integrated speaker, integrated mic, etc.) is attached.
11b - Both a jack and an internal device are attached. The Information provided in all other fields refers to the integrated device. The PD pin will reflect the status of the jack; the user will need to be queried to figure out what it is.
Location indicates the physical location of the jack or device to which the pin complex is connected. This allows software to indicate, for instance, that the device is the “Front Panel Headphone Jack” as opposed to rear panel connections.
*Details:
Convert the 2 digit hex number to binary.
Pad the front with zero's to make it 8 dgits.
Example:
CODE
0x02 = binary 10 = 00000010 8 digit binary
Reading the bits from left to right:
Port Connectivity bits 7:6
-----------------------------------------------------------
00 - Port is connected to a Jack
01 - No External Port -or- No physical connection for Port
10 - Fixed Function/Built In Device (integrated speaker, mic, etc)
11 - Jack and Internal device are attached
Location Part 1 - bits 5:4
-----------------------------------------------------------
00 - External on primary chassis
01 - Internal
10 - Separate chassis
11 - Other
Location Part 2 - bits 3:0
-----------------------------------------------------------
The meaning depends on Location Part 1
00 0000 N/A
00 0001 Rear
00 0010 Front
00 0011 Left
00 0100 Right
00 0101 Top
00 0110 Bottom
00 0111 Special (Rear panel)
00 1000 Special (Drive bay)
01 0000 N/A
01 0111 Special (Riser)
01 1000 HDMI
01 1001 ATAPI
10 0000 N/A
10 0001 Rear
10 0010 Front
10 0011 Left
10 0100 Right
10 0101 Top
10 0110 Bottom
11 0000 N/A
11 0110 ?
11 0111 Inside Mobile Lid (example: mic)
11 1000 Outside Mobile Lid
Bits
Hex 76 54 3210
-------------------
71cf01 = 00 00 0001 - Port has a jack - It is External - Rear Location
71cf02 = 00 00 0010 - Port has a jack - It is External - Front Panel Location
71cf59 = 01 01 1001 - No External Port - ATAPI
71cf18 = 00 01 1000 - Port has a jack - External - HDMI
71cf90 = 10 01 0000 - Built In Device - Internal - N/A
| | ||||
| | |--------- Location part 2
| |------------ Location part 1
|--------------- Port Connectivity
Reading the bits from left to right:
Port Connectivity bits 7:6
-----------------------------------------------------------
00 - Port is connected to a Jack
01 - No External Port -or- No physical connection for Port
10 - Fixed Function/Built In Device (integrated speaker, mic, etc)
11 - Jack and Internal device are attached
Location Part 1 - bits 5:4
-----------------------------------------------------------
00 - External on primary chassis
01 - Internal
10 - Separate chassis
11 - Other
Location Part 2 - bits 3:0
-----------------------------------------------------------
The meaning depends on Location Part 1
00 0000 N/A
00 0001 Rear
00 0010 Front
00 0011 Left
00 0100 Right
00 0101 Top
00 0110 Bottom
00 0111 Special (Rear panel)
00 1000 Special (Drive bay)
01 0000 N/A
01 0111 Special (Riser)
01 1000 HDMI
01 1001 ATAPI
10 0000 N/A
10 0001 Rear
10 0010 Front
10 0011 Left
10 0100 Right
10 0101 Top
10 0110 Bottom
11 0000 N/A
11 0110 ?
11 0111 Inside Mobile Lid (example: mic)
11 1000 Outside Mobile Lid
Bits
Hex 76 54 3210
-------------------
71cf01 = 00 00 0001 - Port has a jack - It is External - Rear Location
71cf02 = 00 00 0010 - Port has a jack - It is External - Front Panel Location
71cf59 = 01 01 1001 - No External Port - ATAPI
71cf18 = 00 01 1000 - Port has a jack - External - HDMI
71cf90 = 10 01 0000 - Built In Device - Internal - N/A
| | ||||
| | |--------- Location part 2
| |------------ Location part 1
|--------------- Port Connectivity
Thanks again to Signal64 for his VerbCheatSheet
*All info came from High Definition Audio Specification Read it for more details!
Conclusions:
The script does a great job, still is not perfect b/c it dosen't know what are your options...maybe a GUI app will add that in the future.
So what can be those options?
- you may want to setup mic as internal to get ambient noise reduction for it.
- some codecs like my AD2000b has only line outs same trick can apply and you can set first output as speaker and get as an option software dsp for it.
- for front panel support you may need to transform back mic in line in as I did for AD2000b.
And so on...
Chapter III-b: Fixing AppleHDAHardwareConfigDriver.kext Info.plist
This is a new plugin for applehda, IMO it will replace hdacontroller(on each new build it takes some of the functions from it)
Patching it is the same as for hdacontroller(just copy/paste HDAConfigDefault from it)

The interesting part(that I'm still investigate) is that PostConstructionInitialization entry, it might be good for some unsupported codecs or to add some extrainitialization stuff, will see...
Chapter III-c: Fixing AppleHDAPlatformDriver.kext Info.plist
This is the hard part to fix, so we need to set some rules to follow:
To be continued...
