Contribute
Register

HDMI Audio

Status
Not open for further replies.
omg thank you so much you have no idea how long i have been looking for a dsdt to get hdmi audio working for my graphics card you are amazing thanks a ton!!
 
omg thank you so much you have no idea how long i have been looking for a dsdt to get hdmi audio working for my graphics card you are amazing thanks a ton!!

No problem, I'm glad it's finally working for you. Now I will explain how it was done.

First and foremost, I followed toleda's guide here: http://legacy.tonymacx86.com/viewtopic.php?t=31947

Inside toleda's file named DSDT-HDMI_Audio_Edits_v3.dsl is this code:
Code:
AMD_GE=N-DSDT_HDMI_Audio_Edit - Complete  (HD 6870)

            Device (PEGP)
            {
                Name (_ADR, 0x00010000)     /**  Verify display  address  **/
                Name (_STA, 0x0F)
                Name (_PRW, Package (0x02)
                {
                    0x09, 
                    0x05
                })
                Device (GFX0)		/**  for AMD Graphics Cards  **/
                {
                    Name (_ADR, Zero)
                    Name (_SUN, One)
                    Method (_DSM, 4, NotSerialized)
                    {
                        Store (Package (0x0C)
                            {
                                "@0,name", 
                                Buffer (0x0D)
                                {
                                    "ATY,Duckweed"
                                }, 

                                "@1,name", 
                                Buffer (0x0D)
                                {
                                    "ATY,Duckweed"
                                }, 

                                "@2,name", 
                                Buffer (0x0D)
                                {
                                    "ATY,Duckweed"
                                }, 

                                "@3,name", 
                                Buffer (0x0D)
                                {
                                    "ATY,Duckweed"
                                }, 

                                "model", 
                                Buffer (0x13)
                                {
                                    "AMD Radeon HD 6870"
                                }, 

                                "hda-gfx", 
                                Buffer (0x0A)
                                {
                                    "onboard-1"
                                }
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }
                }

                Device (HDAU)
                {
                    Name (_ADR, One)
                    Method (_DSM, 4, NotSerialized)
                    {
                        Store (Package (0x02)
                            {
                                "hda-gfx", 
                                Buffer (0x0A)
                                {
                                    "onboard-1"
                                }
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }
                }
            }

This code is for adding HDMI audio AND for adding your graphics card to the DSDT. There is also the option to add ONLY the HDMI audio edit, and continue to use GraphicsEnabler=Yes. I prefer to add in the graphics card info so I no longer need to use GE=Yes, but you are welcome to change that if you like.

Now where the code says /** Verify display address **/ is the most important part. It's best to just begin by looking at IORegistryExplorer to find the address that your graphics card is installed at.

Here you can see in your ioreg that the HD 6870 is located under RP04@1C,3:

attachment.php


So now you can search your DSDT for RP04 and make sure that the address matches the one shown in IORegistryExplorer. In this case the address is 1C,3 which = 0x001C0003 in the DSDT. You can also just simply search for the specific address too. So here is the original code from your DSDT:

Code:
Device (RP04)
            {
                Name (_ADR, 0x001C0003)
                OperationRegion (PXCS, PCI_Config, 0x40, 0xC0)
                Field (PXCS, AnyAcc, NoLock, Preserve)
                {
                            Offset (0x10), 
                    L0SE,   1, 
                            Offset (0x11), 
                            Offset (0x12), 
                        ,   13, 
                    LASX,   1, 
                            Offset (0x1A), 
                    ABPX,   1, 
                        ,   2, 
                    PDCX,   1, 
                        ,   2, 
                    PDSX,   1, 
                            Offset (0x1B), 
                            Offset (0x20), 
                            Offset (0x22), 
                    PSPX,   1, 
                            Offset (0x98), 
                        ,   30, 
                    HPEX,   1, 
                    PMEX,   1
                }
                Field (PXCS, AnyAcc, NoLock, WriteAsZeros)
                {
                            Offset (0x9C), 
                        ,   30, 
                    HPSX,   1, 
                    PMSX,   1
                }
                Device (PXSX)
                {
                    Name (_ADR, Zero)
                    Name (_PRW, Package (0x02)
                    {
                        0x09, 
                        0x04
                    })
                }
                Method (HPME, 0, Serialized)
                {
                    If (PMSX)
                    {
                        Store (0xC8, Local0)
                        While (Local0)
                        {
                            Store (One, PMSX)
                            If (PMSX)
                            {
                                Decrement (Local0)
                            }
                            Else
                            {
                                Store (Zero, Local0)
                            }
                        }
                        Notify (PXSX, 0x02)
                    }
                }
                Method (_PRT, 0, NotSerialized)
                {
                    If (PICM)
                    {
                        Return (AR07 ())
                    }
                    Return (PR07 ())
                }
            }

You can see that the Device name and address match. Here is the code with the HD 6870 added and also the HDMI audio added:

Code:
Device (RP04)
            {
                Name (_ADR, 0x001C0003)
                OperationRegion (PXCS, PCI_Config, 0x40, 0xC0)
                Field (PXCS, AnyAcc, NoLock, Preserve)
                {
                            Offset (0x10), 
                    L0SE,   1, 
                            Offset (0x11), 
                            Offset (0x12), 
                        ,   13, 
                    LASX,   1, 
                            Offset (0x1A), 
                    ABPX,   1, 
                        ,   2, 
                    PDCX,   1, 
                        ,   2, 
                    PDSX,   1, 
                            Offset (0x1B), 
                            Offset (0x20), 
                            Offset (0x22), 
                    PSPX,   1, 
                            Offset (0x98), 
                        ,   30, 
                    HPEX,   1, 
                    PMEX,   1
                }
                Field (PXCS, AnyAcc, NoLock, WriteAsZeros)
                {
                            Offset (0x9C), 
                        ,   30, 
                    HPSX,   1, 
                    PMSX,   1
                }
                Device (GFX0)
                {
                    Name (_ADR, Zero)
                    Name (_PRW, Package (0x02)
                    {
                        0x09, 
                        0x04
                    })
                    Method (_DSM, 4, NotSerialized)
                    {
                        Store (Package (0x12)
                            {
                                "AAPL,slot-name", 
                                Buffer (0x07)
                                {
                                    "Slot-1"          // This is a cosmetic fix only
                                }, 
                                "@0,name", 
                                Buffer (0x0D)
                                {
                                    "ATY,Duckweed"
                                }, 
                                "@1,name", 
                                Buffer (0x0D)
                                {
                                    "ATY,Duckweed"
                                }, 
                                "@2,name", 
                                Buffer (0x0D)
                                {
                                    "ATY,Duckweed"
                                }, 
                                "@3,name", 
                                Buffer (0x0D)
                                {
                                    "ATY,Duckweed"
                                }, 
                                "model", 
                                Buffer (0x13)
                                {
                                    "AMD Radeon HD 6870"
                                }, 
                                "ATY,Rom#", 
                                Buffer (0x10)
                                {
                                    "113-687AZDF-V50"          // This is a cosmetic fix only
                                }, 
                                "ATY,EFIVersion", 
                                Buffer (0x0A)
                                {
                                    "01.00.507"          // This is a cosmetic fix only
                                }, 
                                "hda-gfx", 
                                Buffer (0x0A)
                                {
                                    "onboard-1"
                                }
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }
                }
                Device (HDAU)
                {
                    Name (_ADR, One)
                    Method (_DSM, 4, NotSerialized)
                    {
                        Store (Package (0x02)
                            {
                                "hda-gfx", 
                                Buffer (0x0A)
                                {
                                    "onboard-1"
                                }
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }
                }
                Method (HPME, 0, Serialized)
                {
                    If (PMSX)
                    {
                        Store (0xC8, Local0)
                        While (Local0)
                        {
                            Store (One, PMSX)
                            If (PMSX)
                            {
                                Decrement (Local0)
                            }
                            Else
                            {
                                Store (Zero, Local0)
                            }
                        }
                        Notify (GFX0, 0x02)
                    }
                }
                Method (_PRT, 0, NotSerialized)
                {
                    If (PICM)
                    {
                        Return (AR07 ())
                    }
                    Return (PR07 ())
                }
            }

I added the graphics card edit and HDMI audio edit, and changed PXSX to GFX0 as is shown in toleda's code. You will notice that the cosmetic edits I added are not included in toleda's code. That's because they are not needed, it just adds that information under your System Report. Open About this Mac > More info > System report > Graphics/Displays and you'll see those values. Also you will see the slot name in PCI cards. The only code that is needed for the graphics card edit is toleda's code above.

In order for any of these fixes to work, you need to add the Method DTGP to your DSDT also.

Code:
Method (DTGP, 5, NotSerialized)
{
    If (LEqual (Arg0, Buffer (0x10)
            {
                /* 0000 */    0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44, 
                /* 0008 */    0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
            }))
    {
        If (LEqual (Arg1, One))
        {
            If (LEqual (Arg2, Zero))
            {
                Store (Buffer (One)
                    {
                        0x03
                    }, Arg4)
                Return (One)
            }
            If (LEqual (Arg2, One))
            {
                Return (One)
            }
        }
    }
    Store (Buffer (One)
        {
            0x00
        }, Arg4)
    Return (Zero)
}

I added Method DTGP at the top of your DSDT underneath the DefinitionBlock, you can open your DSDT and see it added there.

The last edit I added is for your onboard audio. Here is your HDEF code before:

Code:
Device (HDEF)
        {
            Name (_ADR, 0x001B0000)
            OperationRegion (HDAR, PCI_Config, 0x4C, 0x10)
            Field (HDAR, WordAcc, NoLock, Preserve)
            {
                DCKA,   1, 
                        Offset (0x01), 
                DCKM,   1, 
                    ,   6, 
                DCKS,   1, 
                        Offset (0x08), 
                    ,   15, 
                PMES,   1
            }
            Method (_PRW, 0, NotSerialized)
            {
                Return (GPRW (0x0D, 0x04))
            }
        }

And here is your HDEF code after:

Code:
Device (HDEF)
        {
            Name (_ADR, 0x001B0000)
            OperationRegion (HDAR, PCI_Config, 0x4C, 0x10)
            Field (HDAR, WordAcc, NoLock, Preserve)
            {
                DCKA,   1, 
                        Offset (0x01), 
                DCKM,   1, 
                    ,   6, 
                DCKS,   1, 
                        Offset (0x08), 
                    ,   15, 
                PMES,   1
            }
            Method (_PRW, 0, NotSerialized)
            {
                Return (GPRW (0x0D, 0x04))
            }
            Method (_DSM, 4, NotSerialized)
            {
                Store (Package (0x04)
                    {
                        "layout-id", 
                        /**** Is ResourceTemplate, but EndTag not at buffer end ****/ Buffer (0x04)
                        {
                            0x79, 0x03, 0x00, 0x00
                        }, 
                        "PinConfigurations", 
                        Buffer (Zero) {}
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
        }

This HDEF edit is also the work of toleda, and can be found here: http://legacy.tonymacx86.com/viewtopic.php?f=16&t=58047
AND here: http://tonymacx86.blogspot.com/2012/01/new-optimized-audio-drivers-for-onboard.html

When you use all these DSDT edits along with toleda's patched AppleHDA.kext, you should have HDMI audio working AND your onboard audio working also.

Hopefully this helps you understand more about DSDT editing, and don't forget to thank toleda for his quality work and excellent tutorials.

Dil83
 

Attachments

  • IOREG.png
    IOREG.png
    158.6 KB · Views: 719
Last edited by a moderator:
Ok, I completely started over with a native DSDT from my GA-Z68MX-UD2H-B3 with the U1C UEFI BIOS installed.

Here is what I did:

1. Search for GFX0 and replace all instances with IGPU

2. Search for PEGP and replace all instances with GFX0

3. Replace the GFX0 device located within PEG0 device with this code for the HD6870 and HDMI audio:

Code:
                Device (GFX0)
                {
                    Name (_ADR, Zero)
                    Method (_DSM, 4, NotSerialized)
                    {
                        Store (Package (0x12)
                            {
                                "AAPL,slot-name", 
                                Buffer (0x07)
                                {
                                    "Slot-1"
                                }, 
                                "@0,name", 
                                Buffer (0x0D)
                                {
                                    "ATY,Duckweed"
                                }, 
                                "@1,name", 
                                Buffer (0x0D)
                                {
                                    "ATY,Duckweed"
                                }, 
                                "@2,name", 
                                Buffer (0x0D)
                                {
                                    "ATY,Duckweed"
                                }, 
                                "@3,name", 
                                Buffer (0x0D)
                                {
                                    "ATY,Duckweed"
                                }, 
                                "model", 
                                Buffer (0x13)
                                {
                                    "AMD Radeon HD 6870"
                                }, 
                                "ATY,Rom#", 
                                Buffer (0x10)
                                {
                                    "113-687AZDF-V50"
                                }, 
                                "ATY,EFIVersion", 
                                Buffer (0x0A)
                                {
                                    "01.00.507"
                                }, 
                                "hda-gfx", 
                                Buffer (0x0A)
                                {
                                    "onboard-1"
                                }
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }
                }
                Device (HDAU)
                {
                    Name (_ADR, One)
                    Method (_DSM, 4, NotSerialized)
                    {
                        Store (Package (0x02)
                            {
                                "hda-gfx", 
                                Buffer (0x0A)
                                {
                                    "onboard-1"
                                }
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }
                }
            }

4. Add Method DTGP to DSDT as described previously

5. Add HDEF edit as described previously

6. Compile with 0 errors

Here it is,

Dil83
 

Attachments

  • GA-Z68MX-UD2H-UEFI-DSDT.aml.zip
    15 KB · Views: 90
Status
Not open for further replies.
Back
Top