Contribute
Register

[Guide] Intel IGPU HDMI/DP audio (all Sandy Bridge -> Kaby Lake [and likely later])

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,716
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Overview

This guide will explain how to implement HDMI audio for laptops equipped with HDMI ports connected to the Intel integrated GPU. Some of the content also applies to laptops equipped with a DP connector. Laptops with external DP ports require a subset of the patches presented here.

In order to implement HDMI/DP, the following requirements must be met:

- native Audio with AppleHDA (for more information, read the FAQ... implementing onboard audio is outside the scope of this guide)

- appropriate framebuffer (kext) patches to change the connector-type to match the physical connector. In this guide, we use WhateverGreen.kext to effect these patches.

- Haswell/Broadwell: renaming B0D3 to HDAU (device at 0x00030000)

- injecting property "hda-gfx" = "onboard-1" on HDAU, IGPU, HDEF objects.

- Haswell/Broadwell: injecting layout-id on HDAU to match layout-id on HDEF

- Haswell: installing FakePCIID.kext and FakePCIID_Intel_HDMI_Audio.kext

Note: Typically, for PC laptops, the ACPI identifier for the Intel graphics device is GFX0 (some Lenovo products use VID). Since this identifier is typically changed to IGPU to enable IGPU power management, this guide will refer to it as IGPU. Keep that in mind if you haven't yet implemented IGPU PM.

Note: In case you're wondering, Skylake (and Kaby Lake, and Coffee Lake) are similar to HD3000/HD4000 in that the HDMI/DP codec is on HDEF (typically HDAS in PC DSDT, renamed to HDEF for OS X) instead on a separate device HDAU.


Note on Clover and the Clover laptop guide

If you followed the guide here: https://www.tonymacx86.com/threads/guide-booting-the-os-x-installer-on-laptops-with-clover.148093/...

Your config.plist will already contain the renames required.

In addition, you will find many useful, but commented out patches/injections in config.plist/Devices/Properties/PciRoot(0)/Pci(0x02,0).

For example, this is from config_HD615_620_630_640_650.plist:
KabyLake IGPU Properties.png

The rest of this guide will assume you're using the guide plists or have copied the required injections from it to your own config.plist.


Frame buffer patching

The data associated with ig-platform-id (or snb-platform-id with Sandy Bridge), has, for each connector, bits that represent the type of the connector (and other connector related data). Since most Apple products use DP, most connectors by default are DP. In order to get HDMI audio to work, you must patch the kext so the connector data matches the physical connector. If your connector is DP, nothing needs to be done, but if your port is HDMI, you will likely need to patch the connector so it becomes an HDMI connector instead of DP connector.

DP connectors are identified in ioreg by connector-type <00 04 00 00>
HDMI connectors are identified in ioreg by connector-type = <00 08 00 00>

As mentioned above, the plists linked by my guide, you will find patches (for WhateverGreen) for each connector in various ig-platform-id data.

http://www.tonymacx86.com/el-capitan-laptop-support/148093-guide-booting-os-x-installer-laptops-clover.html

The patches in each are disabled by default (by #). The patch properties can be enabled by eliminating the leading # character.

The patch you need to use depends on which port the HDMI connector is plugged into. Each port has its own AppleIntelFramebuffer node under IGPU. For example, this image shows each framebuffer node under IGPU on my Lenovo u430:

IGPU framebuffers.png

If there were an HDMI device plugged into one of these framebuffers, you would see AppleDisplay under the respective framebuffer, much as you see AppleBacklightDisplay under the framebuffer associated with the LVDS port (laptop internal display).

The the case of my Lenovo u430, the HDMI port is associated with AppleIntelFramebuffer@2. Each framebuffer (@0, @1, @2, @3) corresponds to a set of connector data inside the ig-platform-id data, which resides in the framebuffer kext binary. So, for example, to patch the connector-type as HDMI for framebuffer@2 we need to enable two of the properties:

framebuffer-con2-enable=1
framebuffer-con2-type=<00 08 00 00>

In Xcode:
@2 patched HDMI.png


For some laptops, you may find the need to change the "pipe" value in the framebuffer connector. This is especially true if your laptop reboots when you plug the HDMI device into the HDMI port (I suppose it could also happen with a DP or mDP connector).

It is not fully understood what the meaning of the pipe value is, but various other connectors use '12' instead of '09' (in the unmodified kext) and it has been found that changing pipe to '12' can fix the reboot problem. If we were to need this for @2 (as in example above), we would add/enable an additional WhateverGreen patching property:

framebuffer-con2-pipe=<12 00 00 00>

In Xcode:
@2 pipe=12.png


Since it may be impossible to determine which connector is used by your HDMI port if the laptop is rebooting, you may need to enable the pipe=12 on all connectors initially.

Such as:
framebuffer-con1-enable=1
framebuffer-con1-pipe=<12 00 00 00>
framebuffer-con2-enable=1
framebuffer-con2-pipe=<12 00 00 00>
framebuffer-con3-enable=1
framebuffer-con3-pipe=<12 00 00 00>

In Xcode:
all pipe 12.png


Once you determine the actual port used by your HDMI (or DP) you can go back and disable the unneeded patches, leaving only the one that is actually associated with your port.

Back to the u430 example, before patching for HDMI-audio, the connector-type for AppleIntelFramebuffer@2 is <00 04 00 00>. After patching, it will change to <00 08 00 00>.

Before patching:
0204 connector-type-DP.png

After patching:
0204 connector-type-HDMI.png


Renaming B0D3 to HDAU

Sandy Bridge (HD3000) and Ivy Bridge (HD4000) use a single audio device (HDEF) with multiple codecs (also Skylake and later). Both onboard audio and HDMI audio live on the same HDEF device. As a result, there is no second device, so no need to rename it to HDAU.

Haswell and Broadwell use a separate device for the HDMI audio codec. Typically it is named B0D3 (it can be defined in either DSDT or an OEM SSDT). You will see the B0D3 node under PCI0 in ioreg. For OS X, it must be renamed to HDAU. The address of the device is always 0x00030000.

The laptop guide plists already have a B0D3->HDAU rename in config.plist/ACPI/DSDT/Paches.


Injecting property hda-gfx (and layout-id)

For Sandy Bridge and Ivy Bridge (HD3000/HD4000), "hda-gfx"="onboard-1" must be injected on IGPU and HDEF.

For Haswell and Broadwell, "hda-gfx"="onboard-1" must be injected on IGPU and HDAU. It is not necessary to inject "hda-gfx" on HDEF, although it doesn't seem to cause a problem.

You can inject "hda-gfx" by enabling the property in the appropriate config.plist/Devices/Properties section:
IGPU is at PciRoot(0)/Pci(0x02,0)
HDEF is at PciRoot(0)/Pci(0x1b,0) on up to and including Broadwell
HDEF is at PciRoot(0)/Pci(0x1f,3) on Skylake and later
HDAU, specific to Haswell/Broadwell is at PciRoot(0)/Pci(0x03,0)

In this shot, you can see "hda-gfx" enabled for a Broadwell system:
hda-gfx haswell:broadwell.png


Note also that layout-id is enabled for the HDAU, PciRoot(0)/Pci(0x03,0). The layout-id injected there must match the layout-id injected on HDEF (not shown, but at PciRoot(0)/Pci(0x1b,0).

For a Haswell system, this is what a completed Devices/Properties might look like for @2 HDMI pipe=12:
(note: stripped of most commented entries)

full hdmi haswell.png


Installing FakePCIID.kext FakePCIID_Intel_HDMI_Audio

The AppleHDAController kext implements a whitelist for certain HDAU devices. Some PCs use devices that are not directly supported. But FakePCIID_Intel_HDMI_Audio can spoof the PCI IDs in order to satisfy AppleHDAController's whitelist check.

Install both FakePCIID.kext and FakePCIID_Intel_HDMI_Audio.kext: https://github.com/RehabMan/OS-X-Fake-PCI-ID

Read the README to find pre-built kext binaries.

There is no harm in installing FakePCIID_Intel_HDMI_Audio even in the case you have a supported HDAU device. The kext will not attach to a device that is natively supported.


Checking your work

You can tell if everything is implemented completely within IORegistryExplorer.

Initial IORegistryExplorer setup:
- Download from here (it is attached to the post): http://www.tonymacx86.com/audio/58368-guide-how-make-copy-ioreg.html
- Preferences->Find, check "Property Keys"

Checking for "hda-gfx"="onboard-1"
- in the search box, type "hda-gfx".
- you should find it on HDEF/IGPU (Sandy/Ivy/Skylake), and on HDAU/IGPU (Haswell/Broadwell).
- looking at at the property value, you should see "onboard-1"

Checking for HDAU (Haswell/Broadwell only):
- you should find HDAU (not B0D3) under PCI0

Checking layout-id:
- in the search box, type "layout-id"
- you should find it on HDAU (if applicable) and HDEF
- if you examine the value in each HDAU and HDEF, HDAU should have the same value

Checking the framebuffer:
- check the framebuffer under IGPU that corresponds to your HDMI/DP connector
- it should match the physical connector (DP: <00 04 00 00>, HDMI: <00 08 00 00>)

Check under HDAU for FakePCIID loading:
- if you have an unsupported HDAU, you will notice FakePCIID has attached to the HDAU device

If only one of the requirements is not met, it will not work.


Problem Reporting

Read FAQ, "Problem Reporting". Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
Use the gen_debug.sh tool mentioned in the FAQ, that way it is less likely you'll omit something.
 
Last edited:
Joined
Aug 12, 2015
Messages
134
Motherboard
Clevo N850HK
CPU
Intel core i7 7700HQ 2.8GHz
Graphics
Nvidia GForce GTX 1050TI - Intel HD630 1920x1080
I can't get the hdmi audio to work. I have followed the guide and done the dsdt patches and installed the kexts but I can't figure out where I am going wrong. Can you help me?

Code:
[FONT=Menlo]kextstat|grep -y acpiplat[/FONT][FONT=Menlo]   13    2 0xffffff7f82bbc000 0x66000    0x66000    com.apple.driver.AppleACPIPlatform (4.0) 3BE4E926-E063-3BBD-BE05-F6F97358C7A4 <12 11 7 6 5 4 3 1>[/FONT]
[FONT=Menlo]Stes-MacBook-Pro:~ stenel$ kextstat|grep -y appleintelcpu[/FONT]
[FONT=Menlo]Stes-MacBook-Pro:~ stenel$ kextstat|grep -y applelpc[/FONT]
[FONT=Menlo]Stes-MacBook-Pro:~ stenel$ kextstat|grep -y applehda[/FONT]
[FONT=Menlo]   85    1 0xffffff7f828ad000 0x1c000    0x1c000    com.apple.driver.AppleHDAController (272.18.1) 2E00D0C5-50F2-30C6-9A22-A85242433B8A <84 83 72 12 7 6 5 4 3 1>[/FONT]
[FONT=Menlo]  108    0 0xffffff7f82a26000 0xab000    0xab000    com.apple.driver.AppleHDA (272.18.1) 48CC0220-B853-37A0-865B-F531D757C66E <107 90 85 84 83 72 6 5 4 3 1>[/FONT]
[FONT=Menlo]Stes-MacBook-Pro:~ stenel$ sudo touch /System/Library/Extensions && sudo kextcache -u /[/FONT]
[FONT=Menlo]Password:[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext VoodooPS2Trackpad.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext VoodooPS2Mouse.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext VoodooPS2Keyboard.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext VoodooPS2Controller.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext RealtekRTL8111.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67030 0xFFFFFFFFFFFEFA2A for kext AirPortBrcm4360.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext IntelBacklight.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext GenericUSBXHCI.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakeSMC.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakePCIID_Intel_HDMI_Audio.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakePCIID_Intel_HD_Graphics.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakePCIID.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext CodecCommander.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67030 0xFFFFFFFFFFFEFA2A for kext AppleHDAHardwareConfigDriver.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67061 0xFFFFFFFFFFFEFA0B for kext AppleHDA.kext[/FONT]
[FONT=Menlo]kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext ACPIBatteryManager.kext[/FONT]
[FONT=Menlo]kxld[com.apple.driver.IOBluetoothHIDDriver]: The following symbols are unresolved for this kext:[/FONT]
[FONT=Menlo]kxld[com.apple.driver.IOBluetoothHIDDriver]: 	IOWorkQueue::withCapacity(OSObject*, unsigned int, IOWorkQueueOperationMode, bool, char*)[/FONT]
[FONT=Menlo]Link failed (error code 5).[/FONT]
[FONT=Menlo]Prelink failed for com.apple.driver.IOBluetoothHIDDriver; omitting from prelinked kernel.[/FONT]
[FONT=Menlo]Can't use IOBluetoothHIDDriver.kext - not linked.[/FONT]
[FONT=Menlo]Prelink failed for com.apple.driver.AppleHSBluetoothDriver; omitting from prelinked kernel.[/FONT]
[FONT=Menlo]Can't use IOBluetoothHIDDriver.kext - not linked.[/FONT]
[FONT=Menlo]Prelink failed for com.apple.driver.AppleBluetoothHIDMouse; omitting from prelinked kernel.[/FONT]
[FONT=Menlo]Can't use IOBluetoothHIDDriver.kext - not linked.[/FONT]
[FONT=Menlo]Prelink failed for com.apple.driver.AppleBluetoothHIDKeyboard; omitting from prelinked kernel.[/FONT]
[FONT=Menlo]Can't use IOBluetoothHIDDriver.kext - not linked.[/FONT]
[FONT=Menlo]Prelink failed for com.apple.driver.AppleBluetoothMultitouch; omitting from prelinked kernel.[/FONT]
View attachment MacBook Pro.zip View attachment CLOVER.zip
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,716
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
I can't get the hdmi audio to work. I have followed the guide and done the dsdt patches and installed the kexts but I can't figure out where I am going wrong. Can you help me?
Read post #1, "Checking your work".

You have two problems. Let's see if you can identify them.
 
Joined
Sep 7, 2011
Messages
22
Motherboard
HP EliteBook 8570P - Clover
CPU
i7-3630QM/QM77 Express
Graphics
HD4000, 1600x900
Hi RehabMan,

i have tried to adapt this guide to my EliteBook 8570p with AMD7570M to get the audio over displayport working.

In my case the HDAU device is not B0D3 but B0D4 and doesn't reside on adr 30000 but 40000. I adapted the patches in the clover config accordingly.

Beside that i think i have inject everything you pointed out into igpu (which was pegp/gfx0 for my amd card but i renamed it to be able to being as close as possible to your hotpatch guide), hdau and hdef. HDEF is working properly. DisplayPort Video signal is working proplery too. I am using layout-id 18 (because hdef is IDT 7605 codec).

My HDAU device has vendorid 0x1002 and device id 0xaa90. Thats typical AMD stuff i think. I tried to get AppleHDAController to load by adapting your FakePCIID_Intel_HDMI_Audio.kext so it injects RM,vendor-id 0x8086 and RM,device-id 0x0a0c (same device-id you used for intel hdmi ...).

In the attachments you find multiple ioregs.

The one with suffix nohdau is the plain ioreg without fakepciid or anything else. You simply see the 0x1002aa90 device without any driver loaded for it. Device is called pci1002,aa90@0,1 instead of HDAU.

The one with suffix nohdau_fakepciid is the ioreg with fakepciid. You can see that FakePCIID is attached and the ids are injected - yet the device is still called pci1002,aa90@0,1 instead of HDAU and no AppleHDAController in sight.

The one with suffix hdau_dp_pluggedin. Was a test by using HDMIAudio.kext 1.1 (which floats around here in the forum somewhere). It successfully loads AppleHDAController as you can see and also the device is now correctly called HDAU. CodecCommander also recognizes it but ignores it because HDMI stuff is disabled in it (correctly i guess...). With this i also see the DisplayPort output in the Systeminformation->Audio. But still when i plug in the monitor there is no audio output for the display port visible. Also that kext seems to hardcode layout - id 1 somehow (so my injected layout id 18 doesn't appear).

Sadly there is no source code for HDMIAudio.kext and i have no clue what it does (and i prefer to not have unknown kexts running ...).

Any advice what i did wrong or what i could try to make the AppleHDAController load and use my layout-id 18 are more then appriciated.

Thx for your time reading this.

Memphiz

PS: i am the same guy who did the pull request on github for the EliteBook 8570p hotpatch support ...
 

Attachments

Last edited:

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,716
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Hi RehabMan,

i have tried to adapt this guide to my EliteBook 8570p with AMD7570M to get the audio over displayport working.
This guide covers only Intel GPU (please note thread title).
 
Joined
Sep 7, 2011
Messages
22
Motherboard
HP EliteBook 8570P - Clover
CPU
i7-3630QM/QM77 Express
Graphics
HD4000, 1600x900
This guide covers only Intel GPU (please note thread title).
I apologize for that one. I somehow wrongly thought that this can't be that different from a ioreg POV. Would a moderator be so kind to split my post out into its own thread?

Beside that one of the questions (while unrelated to that very intel only topic) is still valid. What did i do wrong with the FakePCIID stuff that AppleHDAController doesn't grab my hdau device?
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,716
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
I apologize for that one. I somehow wrongly thought that this can't be that different from a ioreg POV. Would a moderator be so kind to split my post out into its own thread?
Open a separate thread.

You should probably read some of the desktop topics as they relate to HDMI audio on AMD/Radeon.

Beside that one of the questions (while unrelated to that very intel only topic) is still valid. What did i do wrong with the FakePCIID stuff that AppleHDAController doesn't grab my hdau device?
According to your ioreg, there is no Intel HDAU device (@3).
This should not come as a surprise given you have no Intel IGPU.
 
Joined
Mar 10, 2012
Messages
195
Motherboard
Dell XPS 8930
CPU
i5 8400
Graphics
UHD630+RX580
Mac
MacBook Pro
Mobile Phone
iOS
HDMI does not work for some unknown reason. I could not see HDMI output option when connected to TV.......please take a look, thx!
 

Attachments

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,716
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
HDMI does not work for some unknown reason. I could not see HDMI output option when connected to TV.......please take a look, thx!
The setup looks ok to me. Try a different device. What do you see in SysPrefs->Sound, Output?

Lack of SortedOrder with patched SSDTs in ACPI/patched is a potential problem.
 
Joined
Mar 10, 2012
Messages
195
Motherboard
Dell XPS 8930
CPU
i5 8400
Graphics
UHD630+RX580
Mac
MacBook Pro
Mobile Phone
iOS
The setup looks ok to me. Try a different device. What do you see in SysPrefs->Sound, Output?

Lack of SortedOrder with patched SSDTs in ACPI/patched is a potential problem.
Thx for replying. I tried many TVs before. None of them worked. The system preference just shows internal output only. But system information does show HDMI connection. I've change the SSDT name order from 0 to 3 but still no luck.....so frustrating. Do you think it could be relate to AppleHDA patch?
 

Attachments

Top