Contribute
Register

<< Solved >> Can anyone knowledgeable help to convert my DSDT brightness hotkey patch into a standalone SSDT?

Status
Not open for further replies.
Joined
Mar 6, 2014
Messages
17
Motherboard
Clevo P650SE
CPU
i7-4720HQ
Graphics
HD 4600, GTX 970M
Mobile Phone
  1. Android
I have managed to create a DSDT patch that I can successfully use to remap my brightness function keys. The patch changes the brightness hotkeys from Fn+Scroll Lock and Fn+Pause to the correct keys which are Fn+F8 and Fn+F9. (The EC values for the new keys are Q11 and Q12)

Here is the patch that is applied to the DSDT in MaciASL:
Code:
into method label _Q11 replace_content
begin
// Brightness Down\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x0205)\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x0285)\n
end;
into method label _Q12 replace_content
begin
// Brightness Up\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x0206)\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x0286)\n
end;

Now I would like to make this patch into a SSDT so that I do not have to boot with the DSDT.aml in my APCI folder.

This is what it looks like when I search the patched DSDT.aml for the Q11 and Q12 values:
Code:
Method (_Q11, 0, NotSerialized)  // _Qxx: EC Query, xx=0x00-0xFF
{
 Notify (PS2K, 0x0205)
 Notify (PS2K, 0x0285)
}

Method (_Q12, 0, NotSerialized)  // _Qxx: EC Query, xx=0x00-0xFF
{
 Notify (PS2K, 0x0206)
 Notify (PS2K, 0x0286)
}

I am hoping that someone can educate me in how I can make this into a standalone SSDT patch?

Thanks.
 
attached is how i managed to get mine working, it should give you an idea on how to accomplish something similar for yourself

also you will probably need to have renames in your config.plist, find/replace values

Code:
<dict>
                <key>Comment</key>
                <string>_Q0B(0,N) to ZQ0B(0,N) Fn+F2 Airplane</string>
                <key>Count</key>
                <integer>0</integer>
                <key>Enabled</key>
                <true/>
                <key>Find</key>
                <data>
                X1EwQgA=
                </data>
                <key>Limit</key>
                <integer>0</integer>
                <key>Mask</key>
                <data>
                </data>
                <key>OemTableId</key>
                <data>
                </data>
                <key>Replace</key>
                <data>
                WlEwQgA=
                </data>
                <key>ReplaceMask</key>
                <data>
                </data>
                <key>Skip</key>
                <integer>0</integer>
                <key>TableLength</key>
                <integer>0</integer>
                <key>TableSignature</key>
                <data>
                RFNEVA==
                </data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>_Q0E(0,N) to ZQ0E(0,N) F5 Brightness Down</string>
                <key>Count</key>
                <integer>0</integer>
                <key>Enabled</key>
                <true/>
                <key>Find</key>
                <data>
                X1EwRQA=
                </data>
                <key>Limit</key>
                <integer>0</integer>
                <key>Mask</key>
                <data>
                </data>
                <key>OemTableId</key>
                <data>
                </data>
                <key>Replace</key>
                <data>
                WlEwRQA=
                </data>
                <key>ReplaceMask</key>
                <data>
                </data>
                <key>Skip</key>
                <integer>0</integer>
                <key>TableLength</key>
                <integer>0</integer>
                <key>TableSignature</key>
                <data>
                RFNEVA==
                </data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>_Q0F(0,N) to ZQ0F(0,N) F6 Brightness Up</string>
                <key>Count</key>
                <integer>0</integer>
                <key>Enabled</key>
                <true/>
                <key>Find</key>
                <data>
                X1EwRgA=
                </data>
                <key>Limit</key>
                <integer>0</integer>
                <key>Mask</key>
                <data>
                </data>
                <key>OemTableId</key>
                <data>
                </data>
                <key>Replace</key>
                <data>
                WlEwRgA=
                </data>
                <key>ReplaceMask</key>
                <data>
                </data>
                <key>Skip</key>
                <integer>0</integer>
                <key>TableLength</key>
                <integer>0</integer>
                <key>TableSignature</key>
                <data>
                RFNEVA==
                </data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>_Q11(0,N) to ZQ11(0,N) F8 Mirror</string>
                <key>Count</key>
                <integer>0</integer>
                <key>Enabled</key>
                <true/>
                <key>Find</key>
                <data>
                X1ExMQA=
                </data>
                <key>Limit</key>
                <integer>0</integer>
                <key>Mask</key>
                <data>
                </data>
                <key>OemTableId</key>
                <data>
                </data>
                <key>Replace</key>
                <data>
                WlExMQA=
                </data>
                <key>ReplaceMask</key>
                <data>
                </data>
                <key>Skip</key>
                <integer>0</integer>
                <key>TableLength</key>
                <integer>0</integer>
                <key>TableSignature</key>
                <data>
                RFNEVA==
                </data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>_Q13(0,N) to ZQ13(0,N) F10 Sound Off</string>
                <key>Count</key>
                <integer>0</integer>
                <key>Enabled</key>
                <true/>
                <key>Find</key>
                <data>
                X1ExMwA=
                </data>
                <key>Limit</key>
                <integer>0</integer>
                <key>Mask</key>
                <data>
                </data>
                <key>OemTableId</key>
                <data>
                </data>
                <key>Replace</key>
                <data>
                WlExMwA=
                </data>
                <key>ReplaceMask</key>
                <data>
                </data>
                <key>Skip</key>
                <integer>0</integer>
                <key>TableLength</key>
                <integer>0</integer>
                <key>TableSignature</key>
                <data>
                RFNEVA==
                </data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>_Q14(0,N) to ZQ14(0,N) F11 Sound Down</string>
                <key>Count</key>
                <integer>0</integer>
                <key>Enabled</key>
                <true/>
                <key>Find</key>
                <data>
                X1ExNAA=
                </data>
                <key>Limit</key>
                <integer>0</integer>
                <key>Mask</key>
                <data>
                </data>
                <key>OemTableId</key>
                <data>
                </data>
                <key>Replace</key>
                <data>
                WlExNAA=
                </data>
                <key>ReplaceMask</key>
                <data>
                </data>
                <key>Skip</key>
                <integer>0</integer>
                <key>TableLength</key>
                <integer>0</integer>
                <key>TableSignature</key>
                <data>
                RFNEVA==
                </data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>_Q15(0,N) to ZQ15(0,N) F12 Sound Up</string>
                <key>Count</key>
                <integer>0</integer>
                <key>Enabled</key>
                <true/>
                <key>Find</key>
                <data>
                X1ExNQA=
                </data>
                <key>Limit</key>
                <integer>0</integer>
                <key>Mask</key>
                <data>
                </data>
                <key>OemTableId</key>
                <data>
                </data>
                <key>Replace</key>
                <data>
                WlExNQA=
                </data>
                <key>ReplaceMask</key>
                <data>
                </data>
                <key>Skip</key>
                <integer>0</integer>
                <key>TableLength</key>
                <integer>0</integer>
                <key>TableSignature</key>
                <data>
                RFNEVA==
                </data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>_Q6C to ZQ6C Fn+Arrow Left Media Previous</string>
                <key>Count</key>
                <integer>0</integer>
                <key>Enabled</key>
                <true/>
                <key>Find</key>
                <data>
                X1E2QwA=
                </data>
                <key>Limit</key>
                <integer>0</integer>
                <key>Mask</key>
                <data>
                </data>
                <key>OemTableId</key>
                <data>
                </data>
                <key>Replace</key>
                <data>
                WFE2QwA=
                </data>
                <key>ReplaceMask</key>
                <data>
                </data>
                <key>Skip</key>
                <integer>0</integer>
                <key>TableLength</key>
                <integer>0</integer>
                <key>TableSignature</key>
                <data>
                RFNEVA==
                </data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>_Q6D to ZQ6D Fn+Arrow Right Media Next</string>
                <key>Count</key>
                <integer>0</integer>
                <key>Enabled</key>
                <true/>
                <key>Find</key>
                <data>
                X1E2RAA=
                </data>
                <key>Limit</key>
                <integer>0</integer>
                <key>Mask</key>
                <data>
                </data>
                <key>OemTableId</key>
                <data>
                </data>
                <key>Replace</key>
                <data>
                WFE2RAA=
                </data>
                <key>ReplaceMask</key>
                <data>
                </data>
                <key>Skip</key>
                <integer>0</integer>
                <key>TableLength</key>
                <integer>0</integer>
                <key>TableSignature</key>
                <data>
                RFNEVA==
                </data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>_Q6F to ZQ6F Fn+Arrow Down Media Play/Pause</string>
                <key>Count</key>
                <integer>0</integer>
                <key>Enabled</key>
                <true/>
                <key>Find</key>
                <data>
                X1E2RgA=
                </data>
                <key>Limit</key>
                <integer>0</integer>
                <key>Mask</key>
                <data>
                </data>
                <key>OemTableId</key>
                <data>
                </data>
                <key>Replace</key>
                <data>
                WFE2RgA=
                </data>
                <key>ReplaceMask</key>
                <data>
                </data>
                <key>Skip</key>
                <integer>0</integer>
                <key>TableLength</key>
                <integer>0</integer>
                <key>TableSignature</key>
                <data>
                RFNEVA==
                </data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>_Q6E to ZQ6E Fn+Arrow Up Media Stop</string>
                <key>Count</key>
                <integer>0</integer>
                <key>Enabled</key>
                <true/>
                <key>Find</key>
                <data>
                X1E2RQA=
                </data>
                <key>Limit</key>
                <integer>0</integer>
                <key>Mask</key>
                <data>
                </data>
                <key>OemTableId</key>
                <data>
                </data>
                <key>Replace</key>
                <data>
                WlE2RQA=
                </data>
                <key>ReplaceMask</key>
                <data>
                </data>
                <key>Skip</key>
                <integer>0</integer>
                <key>TableLength</key>
                <integer>0</integer>
                <key>TableSignature</key>
                <data>
                RFNEVA==
                </data>
the above is for opencore but if you use clover, then itt is just a case of adding the correct find and replace values that are needed for your setup
 

Attachments

  • SSDT-FN-KEYS.aml
    489 bytes · Views: 58
attached is how i managed to get mine working, it should give you an idea on how to accomplish something similar for yourself

also you will probably need to have renames in your config.plist, find/replace values

the above is for opencore but if you use clover, then itt is just a case of adding the correct find and replace values that are needed for your setup


Thanks for the super-fast reply! I really appreciate you sending me the config and SSDT, it should help!

Unfortunately I get the impression this will not be as easy as I had hoped! My current level of knowledge is not at a point where I really understand what is happening here. (To reach this stage I have been relying a lot on tutorials) I opened the config in ProperTree and I can see how you have the renames for each of the Fn keys. But the first thing that confuses me are the bits where you have the find and replace values. How do I know what my own values should be?

In regards to the code you have in the SSDT, that seems to be very similar to what I posted earlier from my patched DSDT - but I assume it will be more complicated than just copying what I have and replacing the lines in your SSDT!

Maybe there is some kind of noob-friendly guide that can help me to develop a better understanding?
 
I attached my original DSDT.aml and patched DSDT.aml underneath.

The patched DSDT just includes Rehabman's OS Check Fix and the patch for the brightness hotkeys.
 

Attachments

  • DSDT.aml
    71.8 KB · Views: 40
  • DSDT-Patched.aml
    72.2 KB · Views: 41
Thanks for the super-fast reply! I really appreciate you sending me the config and SSDT, it should help!

Unfortunately I get the impression this will not be as easy as I had hoped! My current level of knowledge is not at a point where I really understand what is happening here. (To reach this stage I have been relying a lot on tutorials) I opened the config in ProperTree and I can see how you have the renames for each of the Fn keys. But the first thing that confuses me are the bits where you have the find and replace values. How do I know what my own values should be?

In regards to the code you have in the SSDT, that seems to be very similar to what I posted earlier from my patched DSDT - but I assume it will be more complicated than just copying what I have and replacing the lines in your SSDT!

Maybe there is some kind of noob-friendly guide that can help me to develop a better understanding?
the find and replace is obtained with the echo command in terminal, there is some info here that helped me out:

i was able to use the echo command to tell me the value of _Q0B which would be my "Find" and then echo command for the value of ZQ0B for my "replace"
 
@V3-571G

So, what are you running? OC or Clover? Just making sure of the format you'd need the patches to be in.

So you provided your native and patched DSDT, right? Then I could diff them, put the proper diffs in your SSDT and patch out the old stuff from ACPI with renaming.

Just under so much god damn stress right now, I'm sorry... I will try to help you soon.
 
Last edited:
have also seen this:

which may be easier as it is just a kext, have not tested it myself though

Wow, thank you! I installed the kext and it worked just like that, no patches needed... It's funny because I was going to post here anyway this morning and report my progress. (I had managed to add the patches to my config.plist by using the echo command as shown in the guide you linked...) But I guess I don't need any of that stuff now, hehe.

Now I've got that fixed my Hackintosh is starting to look a lot more complete. Just a few minor things to fix.

One issue is that I seem to lost the audio I had with AppleALC after upgrading to Big Sur. My config is the same as it was when I was on Catalina, I haven't altered anything in regards to audio. But now when I press the volume hotkeys it just comes up with a circle symbol with a diagonal line through it. The volume slider in the new Control Center is also non-functional. I will try to look around and find a solution to this issue.

@V3-571G

So, what are you running? OC or Clover? Just making sure of the format you'd need the patches to be in.

So you provided your native and patched DSDT, right? Then I could diff them, put the proper diffs in your SSDT and patch out the old stuff from ACPI with renaming.

Just under so much god damn stress right now, I'm sorry... I will try to help you soon.

Oh, I should have mentioned that I was using OpenCore. Thankfully I managed to solve the problem (see above) so no need to worry. Nevertheless I really appreciate your offer of help. I know I wouldn't have been able to do it on my own if it wasn't for the kext linked above that made things considerably easier for me. So thanks.
 
I have some time while waiting on my train rn, so I quickly did the SSDT. Attached the outcome, this will override your EC queries corresponding to the function keys, the one you already patched in the DSDT. I've named it ECQP for EC Query Patch.

To make this work, you will need the following search-replace patches, I hope you know how to create the entries in your bootloader (OC or Clover).

Comment: Rename _Q11 to XQ11 for SSDT-ECQP
Search: 5F513131
Replace: 58513131

Comment: Rename _Q12 to XQ12 for SSDT-ECQP
Search: 5F513132
Replace: 58513132

And don't forget to remove your loaded DSDT, this might screw things up.
 

Attachments

  • SSDT-ECQP.aml
    150 bytes · Views: 46
BTW, I'd still recommend you to check out the patch, if it works, you can get rid of a kext - something else that needs system resources. Just an idea tho.
 
Status
Not open for further replies.
Back
Top