My Account of Intel HDA & OS X


I'll try and keep it short and simple. There are 3 main components to get a basic understanding of what you need to know to get your audio working.

  • Pins/Verbs
  • DSDT Patching
  • LegacyHDA Kext

Pins/Verbs
The Pin Complex represents the handles to the audio processor. The OS needs to know how to access these Pin Complexes. It does so through an address. Each Pin Complex has it's own unique hex address.

You should use linux to get a dump of your audio codec. Using this you can create a list of hex verbs. Here is a good guide to get you started creating your verb list : link

DSDT Patching
In most cases your Intel HDA chip is not a standard Mac OS X audio chip that they use. Your BIOS defines the Intel HDA chip usually as (AZAL). This is short for Azalia. Azalia was the codename Intel used when they were creating the Intel HDA specifications in early 2001/2002.

Apple Intel HDA audio hardware is usually defined as (HDEF). So right there you have an issue with the Mac OS not even being aware of the presence of the Intel HDA chip.

The simple solution is to generate a DSDT file from your BIOS and then patch the file. There are many resources on insanelymac.com regarding patching your DSDT. You're basically modifying the name from AZAL to HDEF and identifying the device-id, codec-id and PinConfiguration. You use Chameleon + PC EFI to load the patched DSDT file at boot time overriding the BIOS.

Once you've patched it you can confirm the hardware is detected by the OS by opening IORegistry Explorer (Comes with Xcode Dev Tools).

Search for "HDEF" the device node should show up. Look for the Pin Defaults. You must confirm they match your hardware correctly as these are the low level addresses the OS needs to be aware of. Pin Defaults are usually the last two hex digits from your verb list.

LegacyHDA Kext
Once the OS is aware of the chip and has a list of all it's Pin Complexes your next step is to map the path that each Pin complex must take to get the audio to or from the physical jack.

You should note that the Pin complex does not represent the jacks. The Pin Complex is the handle to a stream in/out on the audio processor. How this stream gets to/from the jack is determined by what is between the two. i.e. an Audio Mixer.

There are 3 things that help constitute a pathmap.
  • Pin Complex
  • Audio Mixer
  • Input/Output
You'll find this Pathmap defined in the info.plist of the LegacyHDA.kext. It will specify addresses as NodeID's.

For input it would be listed in this order :
  • Input/Output
  • Audio Mixer
  • Pin Complex
For output it would be listed in this order :
  • Pin Complex
  • Audio Mixer
  • Input/Output

To find out what the Input/Output and Audio Mixer values are you need to refer back to your codec dump.

Here is a typical listing for one stream :
Node 0x14 [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0
Amp-In vals: [0x00 0x00]
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
Amp-Out vals: [0x00 0x00]
Pincap 0x083e: IN OUT HP Detect Trigger
Pin Default 0x01014010: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Green
DefAssociation = 0x1, Sequence = 0x0
Pin-ctls: 0x40: OUT
Unsolicited: tag=00, enabled=0
Connection: 5
0x0c* 0x0d 0x0e 0x0f 0x26


You need to note the green highlighted NodeID as this is Audio Mixer value in hex. If you look at it's entry in the codec dump you'll find it also has a Connection listed and that will be the Output NodeID. Sometimes there are two values for the input or output NodeID.

To determine which is the relevant one you should generate a codecgraph in Linux. This generates a SVG file which is just a big diagram showing the connections graphically with NodeID's. I strongly recommend you make one.

Once you have a full list of all the streams Pin Complexes, Audio Mixer & Input/Output Node ID's you can then modify your pathmap in the LegacyHDA kext's info.plist.

For more info do a bit of googling on insanelymac.com and read the Intel HDA Specifications document.

Comments

  1. Hi Slither2008, very helpful guide and nicely written. Thanks for all your help. -vincechan06

    ReplyDelete

Post a Comment

Popular posts from this blog

Lenovo Y500 - Ubuntu 12.04 LTS Installation Guide

Balco 3D Printer Z Brace Mod

Teensy LCD Display for MSI Afterburner 3.0