[Giude] How to Enable HDMI Audio on AMD GPUs


Cyberdevs

Supervisor
Staff member
Joined
Aug 29, 2018
Messages
53
Motherboard
GA-Z170X-Gaming 5
CPU
Intel Core i7 6700K
Graphics
AMD Radeon Pro 580
OS X/macOS
10.15 (Beta)
Bootloader
Clover (UEFI)
Mobile Phone
iOS
There are several ways to activate the HDMI Audio on AMD GPUs.

The easiest way is to use to use Lilu+Whatevergreen.kext which will activate the HDMI Audio along with the framebuffer+connector corrections on most AMD GPUs.
All you have to do is to add those kext to your clove folder and remove other AMD/ATI related settings in your config.plist.

So for this method:
  1. Download the latest version of Lilu and WhateverGreen from our Download section.
  2. Mount the EFI partition on your macOS driver or the drive that you use for booting clover from.
  3. Add those kext to /EFI/Clover/kexts/Other
  4. Remove all AMD(ATI) other boot flags like InjectATI or the Framebuffer injections under the Graphic Section in your config.plist
  5. Save the config.plist and reboot

The second way to activate the HDMI Audio is to use SSDT or DSDT:

Note:
This method only works if you already use a patched DSDT or of you are going to use SSDT files in your clover folder, if not use the first method.​
If you add this chunk of code to your DSDT it will activate the HDMi Audio:
These code needs to be added under the \_SB_.PCI0.PEG0 in your DSDT
Code:
Device (HDAU)
                {
                    Name (_ADR, One)  // _ADR: Address
                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        Store (Package (0x02)
                            {
                                "hda-gfx",
                                Buffer (0x0A)
                                {
                                    "onboard-1"
                                }
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }
                }
For SSDT you can use this code:
Code:
Device (HDAU)
        {
            Name (_ADR, One)  // _ADR: Address
            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If (LEqual (Arg2, Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                       
                    })
                }
                Return (Package (0x04)
                {
                    "layout-id",
                    Buffer (0x04)
                    {
                         0x01, 0x00, 0x00, 0x00                     
                    },
                    "hda-gfx",
                    Buffer (0x0A)
                    {
                        "onboard-1"
                    }
                })
Please note that the device ID that's using is 1 and therefore I'm using:
Code:
"layout-id",
                    Buffer (0x04)
                    {
                         0x01, 0x00, 0x00, 0x00                     
                    },
If you are using any other layout-id you need to change that in this code.
Remember for using the layout-id you need to convert that layout it to a hex value for example layout-id 1 = 0x01 and layout-id 4 = 0x04 and layout-id 13 = 0x0d and so on and so fort.
you can use any decimal to hex editor to convert your layout id.

Here is the complete SSDT that I'm using for my Asus Strix ROG RX 580:
Code:
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20161210-64(RM)
* Copyright (c) 2000 - 2016 Intel Corporation
*
* Disassembling to non-symbolic legacy ASL operators
*
* Disassembly of iASLjxtXfv.aml, Mon Sep 24 15:46:58 2018
*
* Original Table Header:
*     Signature        "SSDT"
*     Length           0x0000029E (670)
*     Revision         0x02
*     Checksum         0x4C
*     OEM ID           "APPLE "
*     OEM Table ID     "SSDTAMDG"
*     OEM Revision     0x00001000 (4096)
*     Compiler ID      "INTL"
*     Compiler Version 0x20161210 (538317328)
*/
DefinitionBlock ("", "SSDT", 2, "APPLE ", "SSDTAMDG", 0x00001000)
{
    External (_SB_.PCI0, DeviceObj)    // (from opcode)
    External (_SB_.PCI0.PEG0, DeviceObj)    // (from opcode)
    External (_SB_.PCI0.PEG0.GFX0, DeviceObj)    // (from opcode)
    External (GFX0, DeviceObj)    // Warning: Unknown object

    Scope (\_SB.PCI0.PEG0)
    {
        Scope (GFX0)
        {
            OperationRegion (PCIB, PCI_Config, Zero, 0x0100)
            Field (PCIB, AnyAcc, NoLock, Preserve)
            {
                Offset (0x10),
                BAR0,   32,
                BAR1,   32,
                BAR2,   64,
                BAR4,   32,
                BAR5,   32
            }

            Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                If (LEqual (BAR5, Zero))
                {
                    Store (BAR2, Local0)
                }
                Else
                {
                    Store (BAR5, Local0)
                }

                OperationRegion (GREG, SystemMemory, And (Local0, 0xFFFFFFFFFFFFFFF0), 0x8000)
                Field (GREG, AnyAcc, NoLock, Preserve)
                {
                    Offset (0x6800),
                    GENA,   32,
                    GCTL,   32,
                    LTBC,   32,
                    Offset (0x6810),
                    PSBL,   32,
                    SSBL,   32,
                    PTCH,   32,
                    PSBH,   32,
                    SSBH,   32,
                    Offset (0x6848),
                    FCTL,   32,
                    Offset (0x6EF8),
                    MUMD,   32
                }

                Store (Zero, FCTL)
                Store (Zero, PSBH)
                Store (Zero, SSBH)
                Store (Zero, LTBC)
                Store (One, GENA)
                Store (Zero, MUMD)
            }

            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If (LEqual (Arg2, Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                       
                    })
                }

                Return (Package (0x14)
                {
                    "AAPL,slot-name",
                    Buffer (0x07)
                    {
                        "Slot-1"
                    },

                    "@0,AAPL,boot-display",
                    Buffer (One)
                    {
                         0x00                                       
                    },

                    "@0,name",
                    Buffer (0x0C)
                    {
                        "ATY,Orinoco"
                    },

                    "@1,name",
                    Buffer (0x0C)
                    {
                        "ATY,Orinoco"
                    },

                    "@2,name",
                    Buffer (0x0C)
                    {
                        "ATY,Orinoco"
                    },

                    "@3,name",
                    Buffer (0x0C)
                    {
                        "ATY,Orinoco"
                    },

                    "ATY,VendorID",
                    Buffer (0x02)
                    {
                         0x02, 0x10                                 
                    },

                    "ATY,DeviceID",
                    Buffer (0x02)
                    {
                         0xD7, 0x67                                 
                    },

                    "model",
                    Buffer (0x12)
                    {
                        "AMD Radeon RX 580"
                    },

                    "hda-gfx",
                    Buffer (0x0A)
                    {
                        "onboard-1"
                    }
                })
            }
        }

        Device (HDAU)
        {
            Name (_ADR, One)  // _ADR: Address
            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If (LEqual (Arg2, Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                       
                    })
                }

                Return (Package (0x04)
                {
                    "layout-id",
                    Buffer (0x04)
                    {
                         0x01, 0x00, 0x00, 0x00                     
                    },

                    "hda-gfx",
                    Buffer (0x0A)
                    {
                        "onboard-1"
                    }
                })
            }
        }
    }
}
 
Last edited:
  • Like
Reactions: arsradu