Contribute
Register

Jack sense after sleep

Status
Not open for further replies.
Joined
Jan 9, 2017
Messages
27
Motherboard
MSI Z170A Tomahawk
CPU
i7 6700K
Graphics
Nvidia GTX1080
Mobile Phone
  1. Android
Hi all,

I successfully applied the rehabMan's version of EAPD yesterday, using his kext from OS-X-EAPD-Codec-Commander found here : (No Audio After Sleep/Wake - Realtek ALC AppleHDA [Fixes])

Audio now works after sleep, but the jack sense does not (i.e. if I plug headphones, they are not recognised).
I understand that I need to write an SSDT patch (info in the README), but I'am not sure on how and what to put in.
I am keen to do that, and to understand better ! I have a Realtek ALC892 in my motherboard.

I think it should look like that (based on few examples found) :

Code:
// This SSDT demonstrates a custom configuration for ALC892.
DefinitionBlock ("", "SSDT", 1, "hack", "ALC892", 0)
{
    External(_SB.PCI0.HDEF, DeviceObj)
    Name(_SB.PCI0.HDEF.RMCF, Package()
    {
        "CodecCommander", Package()
        {
            "Custom Commands", Package()
            {
                Package(){}, // signifies Array instead of Dictionary
                Package()
                {
                    // 0x21 SET_UNSOLICITED_ENABLE 0x83
                    "Command", Buffer() { 0x02, 0x17, 0x08, 0x83 },           // Don't know what values I should put here !
                    "On Init", ">y",
                    "On Sleep", ">n",
                    "On Wake", ">y",
                },

            },
        },
    })
}
// EOF

I don't know what values should I specify in 'Buffer() {}'. ?? I am looking into Ioreg but with no luck.. I'am curious to understand how it works :)
What do you think ?

Last question : This need to be compiled with MaciASL before injection, is this right ?
 
Hi,

So I've read various topics and done some research..

I've come up with an had-verb command that works :
Code:
 ./hda-verb 0x1B SET_UNSOLICITED_ENABLE 0x83

The tip was to find the "0x1B" which is the Node ID of the "Headphone playback switch". To find it I booted into a linux distro (ubuntu) and :
Code:
cat /proc/asound/card0/codec#0

you can redirect the output of this command to a file easily (i.e : cat /proc/asound/card0/codec#0 > codec_output.txt ). Simply copy this output to a usb stick or into your mackintosh partition.
Then search through it to find "Headphone playback switch", the Node ID is written on the previous line.

At this point, when the computer is put in sleep under OSX, jack detection won't work after waking up from sleep. If you execute the had-verb command with the proper node ID it will work.

So I wrote a dsl file to take care of it :
Code:
// This SSDT is a custom configuration to restore Jack sense to ALC892 after sleep
DefinitionBlock ("", "SSDT", 1, "hack", "ALC892", 0)
{
    External(_SB.PCI0.HDEF, DeviceObj)
    Name(_SB.PCI0.HDEF.RMCF, Package()
    {
        "CodecCommander", Package()
        {
            "Custom Commands", Package()
            {
                Package(){}, // signifies Array instead of Dictionary
                Package()
                {
                    // 0x1B SET_UNSOLICITED_ENABLE 0x83  --- See hda-verb
                    "Command", Buffer() { 0x1B, 0x17, 0x08, 0x83 },
                    "On Init", ">y",
                    "On Sleep", ">n",
                    "On Wake", ">y",
                },

            },
        },
    })
}
// EOF

Then under MaciASL, save the file as aml file, the copy it to EFI/CLOVER/ACPI/patched.
However, when rebooting with this file, it completely break audio :(

Any idea?

thanks !
 
Last edited:
As I was running out of ideas with SSDT patch, I tried to edit the plist file in CodecCommander.

Adding my codec did make the jack sense work after sleep, however, I lost the EAPD reset after sleep..
I suppose it can be resolved by editing options into the codec profile, but I am not sure if it is the correct approach..

If Rehabman happens to read this thread I'll happily be enlightened :)
 
did you ever get this working? I have the same issue with my laptop jack disabled after sleep.
 
Nope, still not working :(
 
Wrong "Command", you should use this:
Code:
DefinitionBlock ("", "SSDT", 2, "HPQOEM", "HDEF", 0)
{
    External (_SB_.PCI0.HDEF, DeviceObj)
    Name (_SB.PCI0.HDEF.RMCF, Package()
    {
        "CodecCommander", Package()
        {
            "Custom Commands", Package()
            {
                Package(){}, // signifies Array instead of Dictionary
                Package()
                {
                    // 0x1B SET_UNSOLICITED_ENABLE 0x83
                    "Command", Buffer() { 0x01, 0xB7, 0x08, 0x83 },
                    "On Init", ">y",
                    "On Sleep", ">n",
                    "On Wake", ">y"
                }
            }
        }
    })
}
 
Status
Not open for further replies.
Back
Top