Contribute
Register

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

Read post #1.
You will notice (at a minimum) that you have not injected "hda-gfx" on HDAU.

Plus if you look carefully at your ioreg, you will see you have AppleHDADisabler installed. No expectation of HDMI audio working through AppleHDA if you have disabled it via a disabler kext.


OK, Im home now and I've tried a few things. I have hda-gfx on HDEF and IGPU but not on HDAU.
Screen Shot 2018-08-23 at 11.00.49 PM.png
Screen Shot 2018-08-23 at 11.00.49 PM.png
Screen Shot 2018-08-23 at 11.01.25 PM.png

I can't seem to get maciASL to apply the patch for BOD to HDAU which is suppose to also add the hda-gfx attribute. The Apply button is greyed out.

Screen Shot 2018-08-23 at 10.59.50 PM.png

Might there be a clash between the BOD to HDAU enabled from clover and the one on the DSDT I'm trying to enable.

Screen Shot 2018-08-23 at 11.00.15 PM.png

Ive also taken out the disabler for AppleHDA. What else am I missing.
Screen Shot 2018-08-23 at 11.18.07 PM.png
 

Attachments

  • Screen Shot 2018-08-23 at 11.01.11 PM.png
    Screen Shot 2018-08-23 at 11.01.11 PM.png
    297.4 KB · Views: 147
  • Olatunji’s iMac (1).ioreg
    20 MB · Views: 124
  • config.plist
    16.9 KB · Views: 199
Hi, Im having problems getting HDMi working. I have the correct layout-ids, frame buffers are set to 00080000 on both ApleIntelFrambuffers. hda-gfx injection of "onboard-1" is done on HDAU, HDEF and IGPU and patched clover with cloverHDMI patches still display freezes and system shuts down as soon as I plug HDMI cable in. Ive attached ioReg and my config.plist file maybe you can find what Im doing wrong and put me on the right path to solving it.
 

Attachments

  • Archive.zip
    7.4 MB · Views: 121
  • config.plist
    24.8 KB · Views: 214
  • Olatunji’s iMac.ioreg
    20 MB · Views: 126
OK, Im home now and I've tried a few things. I have hda-gfx on HDEF and IGPU but not on HDAU.
View attachment 347702 View attachment 347702 View attachment 347704
I can't seem to get maciASL to apply the patch for BOD to HDAU which is suppose to also add the hda-gfx attribute. The Apply button is greyed out.

View attachment 347705
Might there be a clash between the BOD to HDAU enabled from clover and the one on the DSDT I'm trying to enable.

View attachment 347706
Ive also taken out the disabler for AppleHDA. What else am I missing.
View attachment 347710

As per post #1, "hda-gfx" required on IGPU and HDAU for Haswell hardware.

Hi, Im having problems getting HDMi working. I have the correct layout-ids, frame buffers are set to 00080000 on both ApleIntelFrambuffers. hda-gfx injection of "onboard-1" is done on HDAU, HDEF and IGPU and patched clover with cloverHDMI patches still display freezes and system shuts down as soon as I plug HDMI cable in. Ive attached ioReg and my config.plist file maybe you can find what Im doing wrong and put me on the right path to solving it.

See post #1 regarding "(12)" patch variants.
 
As per post #1, "hda-gfx" required on IGPU and HDAU for Haswell hardware.



See post #1 regarding "(12)" patch variants.

Hi @RehabMan thank you for replying,

"As per post #1, "hda-gfx" required on IGPU and HDAU for Haswell hardware."
- This is done already.

I have enabled ALL the patches in the KextToPatch section related to HDMI audio just to be sure, If I am correct, the patch should change the bits from DP to HDMI and I have both set to the HDMI for my ig-platform-id of 0x0a260006 so that both AppleIntelFramebuffer@1 and AppleIntelFramebuffer@2 are set to <00 08 00 00> yet it is still going into a KP/reboot as soon as I plug an HDMI cable in. Please see ioReg files and my current working config.plist
 

Attachments

  • Archive.zip
    7.4 MB · Views: 119
  • config.plist
    24.8 KB · Views: 218
  • Olatunji’s iMac.ioreg
    20 MB · Views: 110
Hi @RehabMan thank you for replying,

"As per post #1, "hda-gfx" required on IGPU and HDAU for Haswell hardware."
- This is done already.

I have enabled ALL the patches in the KextToPatch section related to HDMI audio just to be sure, If I am correct, the patch should change the bits from DP to HDMI and I have both set to the HDMI for my ig-platform-id of 0x0a260006 so that both AppleIntelFramebuffer@1 and AppleIntelFramebuffer@2 are set to <00 08 00 00> yet it is still going into a KP/reboot as soon as I plug an HDMI cable in. Please see ioReg files and my current working config.plist

You cannot expect the "(12)" variant patches to apply if you have non-"(12)" variant patches prior.
Use only the patches you actually intend to use such that you don't have such conflicts.
 
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:
View attachment 356600

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:

View attachment 183178

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:
View attachment 356601

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:
View attachment 356602

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:
View attachment 356603

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:
View attachment 183180

After patching:
View attachment 183177


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:
View attachment 356604

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


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.

Note: Updated post #1 to use WhateverGreen style patching via config.plist/Devices/Properties instead of Clover KextsToPatch.
 
is it normal that layout-id under HDEF and HDAU changing value to 7 when enabling appleALC but revert to the injected value when appleALC is disabled?
 
is it normal that layout-id under HDEF and HDAU changing value to 7 when enabling appleALC but revert to the injected value when appleALC is disabled?

Yes.
 
So when patching framebuffer do I put layout-id=7 or the injected value?
Thanks Rehabman

Framebuffer patching has nothing to do with layout-id.
You always inject the layout-id you want AppleALC to use, except for the case you inject alc-layout-id and layout-id instead.
 
Back
Top