Fixing Realtek Audio on Legacy Hackintosh: Sierra and High Sierra Guide

Step-by-step guide to get Realtek ALC662, ALC887, and ALC892 audio working on macOS Sierra 10.12.6 and High Sierra 10.13.6. Includes AppleALC setup, DSDT patches, sleep/wake fixes, and debugging.

System Information window displaying audio hardware details and layout-id value

Audio on a legacy Hackintosh often fails silently — no output device listed, kernel panics on kext load, or a single pop followed by silence. The most common culprits on older boards are the Realtek ALC662 (found on many H61/B75 boards), ALC887 (H81/B85/Z87), and ALC892 (Z77/Z87/X79). Each requires a specific combination of AppleALC layout-id, Lilu, and sometimes a DSDT patch or boot-arg. This guide covers the exact steps for macOS Sierra 10.12.6 and High Sierra 10.13.6, including the pitfalls of mismatched codec revisions.

Identifying Your Codec and Revision

Before patching, confirm the exact audio codec. Boot into macOS, open Terminal, and run:

ioreg -r -n HDEF -w0 | grep layout-id
ioreg -r -n HDEF -w0 | grep codec-id

If the HDEF device is missing entirely, your DSDT or SSDT may lack the audio device node — see the Fixing ACPI Panics on X79/X99 Hackintosh for macOS High Sierra guide for adding HDEF to the ACPI tables. For the codec-id, a value of 0x08870883 indicates ALC887, while 0x06620662 is ALC662 and 0x08920892 is ALC892. Note the revision: ALC887-VD (0x887) vs ALC887-VD2 (0x887) often need different layout-ids.

AppleALC + Lilu: The Preferred Method

AppleALC 1.2.x (last stable for Sierra) and 1.3.x (for High Sierra) support these codecs natively, but the correct layout-id must match your codec revision and motherboard wiring. Use the following table as a starting point:

Codec Common Layout-ID (Decimal) Ports Notes
ALC662 5, 7, 12, 13 Line-out, mic, front panel Try 5 first; 7 for 5.1; 13 for some laptops
ALC887 1, 2, 3, 5, 7, 11, 13 3-jack (green/blue/pink) Layout 1 works on most desktop boards; 3 for ASUS H81
ALC892 1, 2, 3, 5, 7, 12, 13, 99 5.1 analog + SPDIF Layout 1 or 7 for standard 3-jack; 99 for X79 boards

Set the layout-id in your bootloader config (Clover or OpenCore) under Devices > Audio > Layout ID (decimal). With Clover, you can also inject via boot-args: alcid=1 (replace 1 with your layout). After setting, reboot and test with System Preferences > Sound > Output. If no output appears, try the next layout from the table.

When AppleALC Fails: DSDT Patches and Legacy Kexts

Some boards — particularly H61 with ALC662 and some Z77 with ALC892 revision B — do not respond to AppleALC alone. Symptoms: audio device shows in System Information but no sound, or the system hangs on wake from sleep. In those cases, you need a DSDT patch to rename the HDEF device and correct the pin configuration. The patch adds a HDEF device under the PCI0 bus with a custom layout-id and PinConfigurations buffer. For ALC662, the buffer often contains:

01 00 00 00 40 00 00 00 01 00 00 00 10 01 00 00 01 00 00 00 90 01 00 00 01 00 00 00 20 01 00 00

This is board-specific — extract your codec dump from Linux (using alsa-info.sh) to get the correct pin defaults. Then compile the DSDT with iasl and place it in /EFI/CLOVER/ACPI/patched/.

For Sierra specifically, the legacy AppleHDA.kext from 10.11 El Capitan can be backported if AppleALC fails entirely. Copy the patched AppleHDA.kext from an El Capitan installation (with the same codec layout) into /System/Library/Extensions/ on Sierra, then run kextcache -i /. This is fragile — a macOS update will overwrite it — and is only recommended as a last resort.

Testing and Debugging Audio on Legacy Systems

After applying any patch, verify the audio codec is recognized by macOS:

  • System Information > Hardware > Audio: Look for “Intel High Definition Audio” with a device ID matching your codec. If missing, the HDEF device is not present in ACPI.
  • Console log: Filter for AppleALC or AppleHDA. A successful load shows “AppleALC: Patched 1 of X supported codecs” or similar. Errors like “AppleALC: No layout found” mean the layout-id is wrong or unsupported.
  • Kernel panic on kext load: Usually indicates a mismatch between the codec revision and the AppleALC resource. Check the codec-id in IOReg again — a revision like ALC887-VD2 may require a different layout than ALC887-VD. Update AppleALC to the latest version that supports your macOS.

System Information window displaying audio hardware details and layout-id value

Sleep/Wake Audio Dropout

A common issue on legacy boards with ALC887 and ALC892: audio works after boot but stops after the system wakes from sleep. This is caused by the codec losing its configuration during the S3 resume. The fix involves adding a _DSM method to the HDEF device in your DSDT that re-initializes the codec on wake. The simplest approach is to use the FixHDA patch in Clover (under ACPI > Fixes > FixHDA_8000). If that does not help, add the following SSDT patch (source in /EFI/CLOVER/ACPI/patched/SSDT-HDAU.aml):

External (_SB.PCI0.HDEF, DeviceObj)
Scope (_SB.PCI0.HDEF)
{
    Method (_DSM, 4, NotSerialized)
    {
        If (LEqual (Arg2, Zero))
        {
            Return (Buffer (One)
            {
                0x03
            })
        }
        Return (Package ()
        {
            "layout-id",
            Buffer ()
            {
                0x01, 0x00, 0x00, 0x00
            },
            "PinConfigurations",
            Buffer ()
            {
                /* your pin config data */
            }
        })
    }
}

Replace the layout-id and PinConfigurations with your board’s values. This forces macOS to re-apply the audio configuration on every wake.

Ethernet and Audio Interaction

On some X79 and Z77 boards, the Realtek RTL8111 Ethernet controller shares an interrupt line with the HDEF audio device. If audio crackles or drops out under network load, you may need to adjust the interrupt routing in ACPI. The Fixing Realtek RTL8111 Ethernet on Hackintosh High Sierra: Chip Revisions, Kexts, and ACPI Patches guide covers the necessary _PRT edits. After fixing the Ethernet interrupts, audio stability often improves without any additional audio patching.

Final Verification

Once audio works, test both analog output (headphones, speakers) and input (mic). For ALC892 with optical SPDIF, check that the TOSLINK port outputs a signal — some boards require a separate hda-gfx property in the GPU device for HDMI audio to coexist. If your build uses a discrete GPU, disable its audio controller in BIOS if not needed, or patch it with WhateverGreen. Save your working layout-id and pin config in a text file — after any macOS update or bootloader change, you'll need to re-apply those exact values. For ALC892 with SPDIF, also note the hda-gfx property if required. Test output with a known audio file and input with a mic recording before calling it done.