RehabMan
Moderator
- Joined
- May 2, 2012
- Messages
- 183,775
- Motherboard
- Intel DH67BL
- CPU
- i7-2600K
- Graphics
- HD 3000
- Mac
-
- Mobile Phone
-
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:

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-capita...de-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:

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 [email protected] 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 [email protected] we need to enable two of the properties:
framebuffer-con2-enable=1
framebuffer-con2-type=<00 08 00 00>
In Xcode:
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:
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:
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 [email protected] is <00 04 00 00>. After patching, it will change to <00 08 00 00>.
Before patching:

After patching:

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

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-capita...de-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:

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 [email protected] 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 [email protected] we need to enable two of the properties:
framebuffer-con2-enable=1
framebuffer-con2-type=<00 08 00 00>
In Xcode:
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:
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:
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 [email protected] is <00 04 00 00>. After patching, it will change to <00 08 00 00>.
Before patching:

After patching:

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