ProjectOSX

Welcome Guest!

Returning User? Login here.

Want membership privileges? Register here.

14 Pages V   1 2 3 > »   
Start a new topic Add Reply
> [HOW TO] Patch AppleHDA - Knowledge Base, Guide for how to fix/use original AppleHDA
THe KiNG
post Aug 17 2009, 03:25 AM
Post #1
Hi,

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.



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)

-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)


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

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)
}
}

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)
}


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)


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

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


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


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


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


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...
18seven
post Aug 17 2009, 07:49 PM
Post #2
Awesome, I am very happy to see your guide. I have gotten pretty far on my own but could really use some sage direction. Despite the fact voodooHDA is out and my hardware (MSI wind) is particularly stubborn with audio, from what I gather I am really more interested in learning how it all works while attempting to make improvements (like a working mic). Oh and for the right brained, AI also opens .svg. Its nice to have control and speed to nav the graph.
shoarthing
post Aug 24 2009, 10:58 AM
Post #3
Thank you: fascinating stuff & really clearly expressed.
Nemes
post Aug 26 2009, 05:03 AM
Post #4
KiNG, thank you for the guide. I'm finding it an easy read, and I had no issues following it thus far.

Do you have any idea on when the rest of it will be ready? I have an Intel board with a genuine ALC889 (as opposed to the ALC885/889A) that doesn't work correctly under VoodooHDA, so I need to patch AppleHDA. After messing with the PathMaps, I'm clearly lost. The rest of your guide would be most helpful, if it's going to be done any time soon.
Slice
post Aug 26 2009, 05:50 AM
Post #5
The KiNG
We are waiting for you to continue.
You said nothing about VREF, MuteGPIO, Amp, boost, detectdelegate...
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.4), OS⌘10.9.2, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
THe KiNG
post Aug 26 2009, 04:24 PM
Post #6
QUOTE (Slice @ Aug 26 2009, 06:50 AM) *
The KiNG
We are waiting for you to continue.
You said nothing about VREF, MuteGPIO, Amp, boost, detectdelegate...

I said it will take some time, is not easy to put things in order and post correct data in a n00b way...
Plus I have my problems/real life to cover, I'm not living in a hack.
If you can do it better/faster be my guest.
mac cute
post Aug 26 2009, 07:58 PM
Post #7
QUOTE (Nemes @ Aug 26 2009, 12:33 AM) *
KiNG, thank you for the guide. I'm finding it an easy read, and I had no issues following it thus far.

Do you have any idea on when the rest of it will be ready? I have an Intel board with a genuine ALC889 (as opposed to the ALC885/889A) that doesn't work correctly under VoodooHDA, so I need to patch AppleHDA. After messing with the PathMaps, I'm clearly lost. The rest of your guide would be most helpful, if it's going to be done any time soon.

[off topic]Could you please upload your codec dump?.[/off topic]

EDIT: thanks
Nemes
post Aug 26 2009, 10:18 PM
Post #8
QUOTE (mac cute @ Aug 26 2009, 08:58 PM) *
[off topic]Could you please upload your codec dump?.[/off topic]
Sure. Attached File  Intel_ALC889.txt ( 11.01K ) Number of downloads: 371


The interesting bit is that it has an Audio Selector at d36, that's not in any documentation.

Unfortunately the board croaked this morning due to other circumstances, so I'm not sure if I'll even be able to get a replacement.

And King, I understand. Thank you for your work thus far. smile.gif

This post has been edited by Nemes: Aug 26 2009, 10:21 PM
Nemes
post Sep 1 2009, 11:55 AM
Post #9
For what it's worth, the replacement arrived. It's not the same mobo (this time it's an Asus Rampage II Extreme) so I won't be able to tinker with the real ALC889.

However while I'm at it, the codec that comes on the Rampage is the AD2000b, a codec King actually wrote a modified plist for. Audio out works great, but mic-in levels are way too low - I have to basically eat the Mic to get anything among a ton of background noise. If anyone has some insights to offer, I'd appreciate it. Looking at the file, I can't see anything wrong.

This post has been edited by Nemes: Sep 1 2009, 11:59 AM
THe KiNG
post Sep 2 2009, 07:32 PM
Post #10
QUOTE (Nemes @ Sep 1 2009, 12:55 PM) *
For what it's worth, the replacement arrived. It's not the same mobo (this time it's an Asus Rampage II Extreme) so I won't be able to tinker with the real ALC889.

However while I'm at it, the codec that comes on the Rampage is the AD2000b, a codec King actually wrote a modified plist for. Audio out works great, but mic-in levels are way too low - I have to basically eat the Mic to get anything among a ton of background noise. If anyone has some insights to offer, I'd appreciate it. Looking at the file, I can't see anything wrong.

You may want to try my new AD2000b.kext
It is designed with front panel support(mic as internal and headphones) 3 line out(first as speaker) digital in/out and back mic(as line in, I will explain later why 3 analog inputs dosen't work with hda)
It should work aslo for AD1988b with CodecID replacment in plist.

Enjoy!
Nemes
post Sep 3 2009, 02:42 AM
Post #11
QUOTE (THe KiNG @ Sep 2 2009, 08:32 PM) *
You may want to try my new AD2000b.kext
It is designed with front panel support(mic as internal and headphones) 3 line out(first as speaker) digital in/out and back mic(as line in, I will explain later why 3 analog inputs dosen't work with hda)
It should work aslo for AD1988b with CodecID replacment in plist.

Enjoy!
That did the trick. Thank you King, you are my hero. smile.gif
Gringo Vermelho
post Sep 3 2009, 03:25 AM
Post #12
Awesome, thanks for all your work.

Is there a way to make HDAEnabler ignore my X-Fi Titanium..or is that not how it works?

I put the IDs of my ADI2000B in the plist replacing what was there, but that didn't work, it just broke everything!

Am I correct in assuming that adding the "Device (HDEF)" to the DSDT replaces HDAEnabler?

This post has been edited by Gringo Vermelho: Sep 3 2009, 05:18 AM
ASUS P8Z77-V Pro - EVGA GTX 660 - i5-3570K - 10.9.1 retail - Chameleon 2.2 svn r22xx
Nemes
post Sep 3 2009, 05:51 AM
Post #13
QUOTE (Gringo Vermelho @ Sep 3 2009, 04:25 AM) *
Awesome, thanks for all your work.

Is there a way to make HDAEnabler ignore my X-Fi Titanium..or is that not how it works?

I put the IDs of my ADI2000B in the plist replacing what was there, but that didn't work, it just broke everything!

Am I correct in assuming that adding the "Device (HDEF)" to the DSDT replaces HDAEnabler?
My understanding is that HDAEnabler injects all HDA audio devices witht he proper tag, so no, I don't believe there's a way to keep it from doing that to your X-Fi Titanium. I'm don't have the foggiest on why that would screw up anything for you though.

As for the DSDT method, I've never been able to get it working myself.
THe KiNG
post Sep 3 2009, 03:25 PM
Post #14
QUOTE (Gringo Vermelho @ Sep 3 2009, 03:25 AM) *
Am I correct in assuming that adding the "Device (HDEF)" to the DSDT replaces HDAEnabler?

Yes
Just use my example from guide.

@Nemes Is not that hard..., if you want to learn how to do it manual google is your best friend, if you want help you can use DSDTSE.app
Gringo Vermelho
post Sep 3 2009, 11:54 PM
Post #15
Okay, done - it works.

I couldn't find the AD2000B in the DSDT so I inserted the HDEF Device among the other devices, before the SATA.

Why does it do this..twice..during bootup? I'm guessing one could possibly be the X-fi. I should try removing it.
CODE
9/3/09 20:26:58  kernel extension "com.apple.driver.AppleHDAController" cannot be found
9/3/09 20:26:58  kernel can't find extension com.apple.driver.AppleHDAController
9/3/09 20:26:58  kernel Can't determine dependencies for com.apple.driver.AppleHDAController.
9/3/09 20:26:58  kernel Couldn't alloc class "AppleHDAController"
9/3/09 20:26:58  kernel extension "com.apple.driver.AppleHDAController" cannot be found
9/3/09 20:26:58  kernel can't find extension com.apple.driver.AppleHDAController
9/3/09 20:26:58  kernel Can't determine dependencies for com.apple.driver.AppleHDAController.
9/3/09 20:26:58  kernel Couldn't alloc class "AppleHDAController"

AppleHDAController is where it's supposed to be though, in the plugins folder of AppleHDA.kext (vanilla 10.5.8)

Is it something AD2000B.kext does?

The weird thing is, it does load, look (kextstat -k):
CODE
77    2 0x2e38d000 0x7000     0x6000     com.apple.iokit.IOHDAFamily (1.7.1a2)
78    0 0x2e394000 0x10000    0xf000     com.apple.driver.AppleHDAController (1.7.1a2) <77 17>


It doesn't make a difference if AD2000B.kext is in EFI/E/E or /S/L/E.

This post has been edited by Gringo Vermelho: Sep 4 2009, 04:46 AM
ASUS P8Z77-V Pro - EVGA GTX 660 - i5-3570K - 10.9.1 retail - Chameleon 2.2 svn r22xx
THe KiNG
post Sep 4 2009, 07:11 AM
Post #16
Those AppleHDAController warnings are normal b/c the dummy.kext loads earlier in the boot process and since it cant find AppleHDAController.kext (that is loaded later) it prints that.
The only way to get rid of those is to patch/fix original applehda.kext info.plist's, but that say bye to "on the fly" patching...
After AppleHDAController will be deprecated and removed by apple we will get rid of those "natural" smile.gif
ihosc
post Sep 6 2009, 12:23 AM
Post #17
Hello King, I hope you are abel to clarify this. My sound chip is ALC 883 and codec_dump from Ubuntu says codec address is 2. My config data dump from Vista registry has entry all ended with '01' such as "0000"=hex:10,1c,47,01..... My understanding was '01' byte flip will give you codec address '0'. The sound system is working perfectly in both Ubuntu and Vista. Do you have any idea why? Anyway I should used codec address '2' as detected by Ubuntu?
Clubber_77
post Sep 7 2009, 06:31 PM
Post #18
QUOTE (ihosc @ Sep 6 2009, 04:23 AM) *
Hello King, I hope you are abel to clarify this. My sound chip is ALC 883 and codec_dump from Ubuntu says codec address is 2. My config data dump from Vista registry has entry all ended with '01' such as "0000"=hex:10,1c,47,01..... My understanding was '01' byte flip will give you codec address '0'. The sound system is working perfectly in both Ubuntu and Vista. Do you have any idea why? Anyway I should used codec address '2' as detected by Ubuntu?


1. What motherboard for you?
2. Make a Linuxdump & VoodooHDAdump.. (Attach here)
3. Try this Attached File  ALC883_for_Snow_Leopard__Clubber_77_.zip ( 1.12MB ) Number of downloads: 926

and
Attached File  HDAEnabler.kext.zip ( 24.28K ) Number of downloads: 723

or
Attached File  HDEFInject.kext.zip ( 21.1K ) Number of downloads: 613


or DSDT patch

P.S. I am sorry for my English

This post has been edited by Clubber_77: Sep 7 2009, 08:07 PM
mormegil
post Sep 7 2009, 06:39 PM
Post #19
Thanks for the guide. I've been following it for quite some time but haven't been able to post a reply. Didn't realize there's a quiz which I needed to pass in order to post! lol

Anyway, I've found the same weirdness as ihosc above. While trying out a plist by someone else to see if it works better on my alc 888, I accidentally copied ConfigData blindly and didn't notice that the codec address is different than the one I've been using. It turned out, my sound works just as well as before. I've always had the impression that codec address is a fixed value, specific to your hardware. I later looked at the official docs and I think it's a value that is assigned during hardware initialization. I might be wrong on this though.
aylamrin
post Sep 18 2009, 06:41 PM
Post #20
QUOTE (mormegil @ Sep 8 2009, 12:09 AM) *
Thanks for the guide. I've been following it for quite some time but haven't been able to post a reply. Didn't realize there's a quiz which I needed to pass in order to post! lol

Anyway, I've found the same weirdness as ihosc above. While trying out a plist by someone else to see if it works better on my alc 888, I accidentally copied ConfigData blindly and didn't notice that the codec address is different than the one I've been using. It turned out, my sound works just as well as before. I've always had the impression that codec address is a fixed value, specific to your hardware. I later looked at the official docs and I think it's a value that is assigned during hardware initialization. I might be wrong on this though.


New User, 1st post: Whoa, didn't know that I've got a quiz to take... Whatever ...

Now, to the point, I have an Intel DG33FB (ALC888) CAd 2. (had sound in Leopard using Taruga's Patcher & efi). It has:
Rear: Line out, Line in, Mic In
Front: HP, Mic In

What I've done so far:

  1. Took a codec dump.
  2. patched dsdt
  3. prepared pin config from verbit script
  4. tried to patch HDAEnabler HDAController etc. (failed.... of course)


Would somebody be kind enough to get my audio working. I'm attaching the list of all the files. (I don't need fancy System Profiler o/p at the moment, just 1 line out, 1 mic in that's all).



14 Pages V   1 2 3 > » 
Add Reply Start a new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: