. CHAPTER 2: CORRECTION APPLEHDA.KEXT
For the AppleHDA Work correctly for our codec we make some modifications in the same plists.
So what are these changes?
If you look at it (click the right mouse button / Show Package Contents), you will find in the Content folder of the main Info.plist (not touching it) and a folder plugins. There are plugins that we have to fix, but not all just Info.plist from this one:
1-AppleHDAHardwareConfigDriver.kext
2-platform.xml and layout12.xml or Layout1.xml (in Folder Resources)
3-BinPatch
1-AppleHDAHardwareConfigDriver.kext
To edit this kext need to get configdata / CodecVerbs.
You can fix them in two ways, either manually or automatically using the script called Signal64 Verbit that performs the entire process automatically
requiring a few adjustments you can download it here:
verbit.zip
Unzip it in the same folder codecgraph used previously. then Run this command in Terminal:
Mã:
cd /Users/your_user_name/Desktop/codecgraph
and then:
Mã:
./Verbit codec_dump.txt> verbs.txt
. NOTE: You must delete the line codec_dump.txt: AFG Function Id: 0x1 (unsol 0)
Having done this codecgraph open the folder and you will see two files and another one called verbs.txtverbitdebug.txt.
verbit.texto is in our interest. For in him we find our configdata / CodecVerbs original and corrected tops underneath.
verbs.txt:
Mã:
--------------------------------------------------------------------------------------------------------
ATAPI Unknown SPDIF Out at Int ATAPI 170x110x9943014001171c4001171d0001171e4301171f90
1/8 Green LineOut at ExtRear 200x140x0101401001471c1001471d4001471e0101471f01
1/8 Black LineOut at ExtRear 210x150x0101101201571c7001571d1001571e0101571f01
1/8 Orange LineOut at ExtRear 220x160x0101601101671c8001671d6001671e0101671f01
1/8 Grey LineOut at ExtRear 230x170x0101201401771c9001771d2001771e0101771f01
Mic at ExtRear 240x182736750401871c5001871d9001871ea101871f01
Mic at ExtFront 250x194414576001971c6001971d9001971ea101971f01
1/8 Blue LineIn at ExtRear 260x1a0x0181305f01a71ca001a71d3001a71e8101a71f01
HP Out at ExtFront270x1b3573660801b71c2001b71d4001b71e2101b71f01
Optical WhiteLineOut at Ext N/A 290x1d0x4005e60101d71cb001d71de001d71e0501d71f40
Optical Orange SPDIF Out at ExtRear 300x1e0x0145613001e71c3001e71d6001e71e4501e71f01
verbitdebug.txt:
Mã:
Checkingif2 already exists in:4178956 a 13no duplicate found
Checkingif1 already exists in:4178956 a 23
duplicate found -Isthis the first time we've seen this association?
no - replacing association with: b
Checking if 3 already exists in: 4 1 7 8 9 5 6 a 2 b
no duplicate found
New 71c Associations
Before After
--------------------------------------------------
01171c40 01171c40 01171d01 01171e43 01171f99
01471c10 01471c10 01471d40 01471e01 01471f01
01571c12 01571c70 01571d10 01571e01 01571f01
01671c11 01671c80 01671d60 01671e01 01671f01
01771c14 01771c90 01771d20 01771e01 01771f01
01871c50 01871c50 01871d98 01871ea1 01871f01
01971c60 01971c60 01971d9c 01971ea1 01971f02
01a71c5f 01a71ca0 01a71d30 01a71e81 01a71f01
01b71c20 01b71c20 01b71d4c 01b71e21 01b71f02
01d71c01 01d71cb0 01d71de6 01d71e05 01d71f40
01e71c30 01e71c30 01e71d61 01e71e45 01e71f01
Reset 71d Misc to 0
New 71d Associations
Before After
--------------------------------------------------
01171d01 01171c40 01171d00 01171e43 01171f99
01471d40 01471c10 01471d40 01471e01 01471f01
01571d10 01571c70 01571d10 01571e01 01571f01
01671d60 01671c80 01671d60 01671e01 01671f01
01771d20 01771c90 01771d20 01771e01 01771f01
01871d98 01871c50 01871d90 01871ea1 01871f01
01971d9c 01971c60 01971d90 01971ea1 01971f02
01a71d30 01a71ca0 01a71d30 01a71e81 01a71f01
01b71d4c 01b71c20 01b71d40 01b71e21 01b71f02
01d71de6 01d71cb0 01d71de0 01d71e05 01d71f40
01e71d61 01e71c30 01e71d60 01e71e45 01e71f01
Correct 71f 02 FP to 01
New 71f Associations
Before After
--------------------------------------------------
01171d01 01171c40 01171d00 01171e43 01171f90
01471d40 01471c10 01471d40 01471e01 01471f01
01571d10 01571c70 01571d10 01571e01 01571f01
01671d60 01671c80 01671d60 01671e01 01671f01
01771d20 01771c90 01771d20 01771e01 01771f01
01871d98 01871c50 01871d90 01871ea1 01871f01
01971d9c 01971c60 01971d90 01971ea1 01971f01
01a71d30 01a71ca0 01a71d30 01a71e81 01a71f01
01b71d4c 01b71c20 01b71d40 01b71e21 01b71f01
01d71de6 01d71cb0 01d71de0 01d71e05 01d71f40
01e71d61 01e71c30 01e71d60 01e71e45 01e71f01
The codec used in the above example as you can see is a ALC887-VD was necessary to change only one of the external microphones.
To understand how these changes are made we need to go deeper.
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:
ts about NodeID(NID) 0x14 in hex, 20 in decimal:
The default verbs for it: 21471c10 21471d44 21471e01 21471f01
01471c10:
01471c10 = CAd (Codec Adress)
01471c10 = NID (NodeID)
01471c10 = Verb Commands like 71"c" then "d", "e" ,"f"
01471c10 = 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.
Mã:
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
. 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.
Mã:
LineOut 0
Speaker 1
HP Out 2
CD 3
SPDIF Out 4
Digital Other Out 5
Modem Line Side 6
Modem Handset Side 7
LineIn 8
AUX 9
MicIn A
Telephony B
SPDIF In C
Digital Other In D
Reserved E
Other F