Jump to content

GUIDE: How to Fix Brightness hotkeys in DSDT

fix brightness hotkeys laptop dsdt

  • Please log in to reply
96 replies to this topic

#1
soumaxetuirk

soumaxetuirk

    InsanelyMac Protégé

  • Members
  • Pip
  • 47 posts
  • Gender:Male

If you have a working Brightness Slider and you might be using Brightness slider or manual hotkeys to control brightness then this guide may help you to use your Native hotkeys of laptop.

 

(All the Credits goes to @RehabMan  :thumbsup_anim:   For OS-X-ACPI-Debug Kext and DSDT Patches.)

 

 

This step assumes that you are using RehabMan's VoodooPS2Controller

  1. Install the kext: https://github.com/R...OS-X-ACPI-Debug
  2. Open MaciASL and click on patch.(Add rehab man repo)
  3. Apply "Add DSDT Debug Methods" and "Instrument EC Queries" that are under Brightness Fix.
  4. Save the DSDT and restart
  5. Look in Syslog as you press the key corresponding to brightness to determine which _QXX methods handle the keys
  6. Then patch DSDT:
into method label _Q1D replace_content
begin
// Brightness Down\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0205)\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0285)\n
end;
into method label _Q1C replace_content
begin
// Brightness Up\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0206)\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0286)\n
end;

Change the variable _Q1D/_Q1C as per the log. 

7. Try compiling and check if it generates errors
8. If it does, then change the PS2M to PS2X according to the one found in your DSDT
9. Save and place the compiled DSDT.
10. Now you should see that you have your corresponding keys to change your brightness smile_osx.png

 

 

:) FOR  more detail and Queries,Check Out original Post of @RehabMan Here;

http://www.insanelym...18#entry1997112

Get Latest Version of  OS-X-ACPI-Debug kext here:

https://bitbucket.or...debug/downloads



#2
Allan

Allan

    V.I.P. Member

  • Supervisors
  • 11,526 posts
  • Gender:Male

Yeah! This works for me perfectly.

 

The only change was:

  1. PS2M to PS2K - according to my value found in my DSDT.
  2. The _Q1D/_Q1C to _Q11/_Q12
  3. And i remove the old version of VoodooPS2Controller and install VoodooPS2Controller 1.8.14 version.
  4. Remove AppleACPIPS2Nub too.

 

Repair the disk permissions and rebuild the cache, and tadaaa! My native brightness keys works now like a charm.

 

Thank you very much @RehabMan and @soumaxetuirk  ;)

PS: I will translate this for Portuguese forum! Is awesome  :D



#3
RehabMan

RehabMan

    InsanelyMacaholic

  • Developers
  • 3,179 posts
  • Gender:Male
  • Location:Bellingham, WA
  • Interests:skiing, software, classic cars

This step assumes that you are using RehabMan's [/size]VoodooPS2Controller


  • Install the kext: https://github.com/R...OS-X-ACPI-Debug
  • Open MaciASL and click on patch.(Add rehab man repo)
  • Apply "Add DSDT Debug Methods" and "Instrument EC Queries" that are under Brightness Fix.
  • Save the DSDT and restart
  • Look in Syslog as you press the key corresponding to brightness to determine which _QXX methods handle the keys
  • Then patch DSDT:

into method label _Q1D replace_content
begin
// Brightness Down\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0205)\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0285)\n
end;
into method label _Q1C replace_content
begin
// Brightness Up\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0206)\n
Notify(\_SB.PCI0.LPCB.PS2M, 0x0286)\n
end;
Change the variable _Q[/size]1D[/size]/_Q[/size]1C[/size] as per the log. [/size]

7. Try compiling and check if it generates errors[/size]
8. If it does, then change the [/size]PS2M to PS2X[/size] according to the one found in your DSDT[/size]
9. Save and place the compiled DSDT.[/size]
10. Now you should see that you have your corresponding keys to change your brightness [/size]smile_osx.png


Hmmmm... this guide seems very similar to one I've already written.

#4
Allan

Allan

    V.I.P. Member

  • Supervisors
  • 11,526 posts
  • Gender:Male

Here in our Forum?

 

@soumaxetuirk, If this is true, it would be good to put the source of this topic.



#5
soumaxetuirk

soumaxetuirk

    InsanelyMac Protégé

  • Members
  • Pip
  • 47 posts
  • Gender:Male

i am kind of sure its not in this forum.Truly No,because i  searched and asked for years tried many different methods to fix my brightness hotkeys....

atlast when i got some solution from i thought to  write it here..

 

i got from a tutorial 

http://www.tonymacx8...0tx-clover.html



#6
Allan

Allan

    V.I.P. Member

  • Supervisors
  • 11,526 posts
  • Gender:Male

i am kind of sure its not in this forum.Truly No,because i  searched and asked for years tried many different methods to fix my brightness hotkeys....

atlast when i got some solution from i thought to  write it here..

 

i got from a tutorial 

http://www.tonymacx8...0tx-clover.html

 

Ok.

 

Thank you for your explanation. Thus, fine by me.



#7
RehabMan

RehabMan

    InsanelyMacaholic

  • Developers
  • 3,179 posts
  • Gender:Male
  • Location:Bellingham, WA
  • Interests:skiing, software, classic cars

Here in our Forum?
 
@soumaxetuirk, If this is true, it would be good to put the source of this topic.


Not on this forum. I find it too much work to maintain my guides in multiple places.

But when someone uses another's work, it is customary and respectful to quote the source, even if it is on a different forum. Instead, post #1 reads as if this is the author's own work. I first came up with the EC instrumentation/patching technique when trying to fix the brightness keys on my Lenovo u430.

Later, I helped gygabyte666 do the same on his Envy (a laptop I had previously). The conversation starts here: http://www.insanelym...18#entry1997112

Note that the details of the technique differ depending on the PS2 driver you're using and what you find out via instrumentation. For example, there are not always two separate methods for each key (in the case of the u430 they are separate, yet the HP Envy shares one method for more than one key). And you'll need to send different codes and ACPIKeyboard.kext if you're using a PS2 driver other than mine. There is more details at my ACPIKeyboard.kext README at github.

#8
Allan

Allan

    V.I.P. Member

  • Supervisors
  • 11,526 posts
  • Gender:Male

Hmm, ok.

 

So, let's wait for @soumaxetuirk to put others sources in #1 post.



#9
Gringo Vermelho

Gringo Vermelho

    The Jan Bird fix

  • Supervisors
  • 6,224 posts
  • Gender:Male
  • Location:Brazil

The only change was:

  1. PS2M to PS2K - according to my value found in my DSDT.

 

Heh. My Thinkpad T61 has PS2K and PS2M - separate code for mouse (well, trackpad) and keyboard.



#10
soumaxetuirk

soumaxetuirk

    InsanelyMac Protégé

  • Members
  • Pip
  • 47 posts
  • Gender:Male

Thank you Sir for Letting me know..i already updated the post....



#11
Allan

Allan

    V.I.P. Member

  • Supervisors
  • 11,526 posts
  • Gender:Male

Nice! Thanks @soumaxetuirk  ;)



#12
Sun River

Sun River

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
  • Gender:Male
  • Location:Russia
  • Interests:Hackintosh

Thanks.
Work on hp with 
_Q17/_Q18



#13
mnfesq

mnfesq

    Emenef, Esquire

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,182 posts
  • Gender:Male
  • Location:Southern California

Both my brightness down key (F2) and my brightness up key (F3) are _Q13.  Here's the DSDT code for it.  Any recommendations for patching?

                    Method (_Q13, 0, NotSerialized)
                    {
                        If (LEqual (HKNO, 0x07))
                        {
                            Store (0x07, P80H)
                            Notify (^^^GFX0.DD02, 0x87)
                            Notify (^^^PEG0.PEGP.DD02, 0x87)
                        }

                        If (LEqual (HKNO, 0x08))
                        {
                            Store (0x08, P80H)
                            Notify (^^^GFX0.DD02, 0x86)
                            Notify (^^^PEG0.PEGP.DD02, 0x86)
                        }

                        If (LAnd (LGreaterEqual (HKNO, 0x13), LLessEqual (HKNO, 0x1E)))
                        {
                            If (LNotEqual (HKNO, 0x13))
                            {
                                ^^^^WMID.WGWE (0x04, Zero)
                            }
                            Else
                            {
                                If (LEqual (HKNO, 0x13))
                                {
                                    If (BTLS)
                                    {
                                        GLSD ()
                                        Store (Zero, WLRF)
                                        Store (Zero, WARF)
                                        GLRS ()
                                        Store (Zero, WLON)
                                        GLSD ()
                                        Store (One, BTOF)
                                        GLRS ()
                                        Store (Zero, BTON)
                                        GLSD ()
                                        Store (Zero, WWRF)
                                        Store (Zero, WAON)
                                        Store (One, WWOF)
                                        Store (Zero, BTLS)
                                        GLRS ()
                                    }
                                    Else
                                    {
                                        If (WLST)
                                        {
                                            GLSD ()
                                            Store (One, WARF)
                                            Store (One, WLRF)
                                            Store (Zero, WLED)
                                            GLRS ()
                                            Store (One, WLON)
                                        }
                                        Else
                                        {
                                            GLSD ()
                                            Store (Zero, WLRF)
                                            Store (Zero, WARF)
                                            Store (One, WLED)
                                            GLRS ()
                                            Store (Zero, WLON)
                                        }

                                        If (BLTH)
                                        {
                                            GLSD ()
                                            Store (Zero, BTOF)
                                            GLRS ()
                                            Store (One, BTON)
                                        }
                                        Else
                                        {
                                            GLSD ()
                                            Store (One, BTOF)
                                            GLRS ()
                                            Store (Zero, BTON)
                                        }

                                        If (WWAN)
                                        {
                                            If (LEqual (BTAP, One))
                                            {
                                                GLSD ()
                                                Store (Zero, WWOF)
                                                Store (One, WAON)
                                                Store (One, WWRF)
                                                GLRS ()
                                            }
                                        }
                                        Else
                                        {
                                            GLSD ()
                                            Store (One, WWOF)
                                            Store (Zero, WWRF)
                                            GLRS ()
                                            Store (Zero, WAON)
                                        }

                                        Store (One, BTLS)
                                    }
                                }
                            }
                        }

                        If (LEqual (HKNO, 0x04))
                        {
                            Notify (GFX0, 0x80)
                        }
                    }


#14
RehabMan

RehabMan

    InsanelyMacaholic

  • Developers
  • 3,179 posts
  • Gender:Male
  • Location:Bellingham, WA
  • Interests:skiing, software, classic cars

Both my brightness down key (F2) and my brightness up key (F3) are _Q13.  Here's the DSDT code for it.  Any recommendations for patching?

                    Method (_Q13, 0, NotSerialized)
                    {
                        If (LEqual (HKNO, 0x07))
                        {
                            Store (0x07, P80H)
                            Notify (^^^GFX0.DD02, 0x87)
                            Notify (^^^PEG0.PEGP.DD02, 0x87)
                        }

                        If (LEqual (HKNO, 0x08))
                        {
                            Store (0x08, P80H)
                            Notify (^^^GFX0.DD02, 0x86)
                            Notify (^^^PEG0.PEGP.DD02, 0x86)
                        }

                        If (LAnd (LGreaterEqual (HKNO, 0x13), LLessEqual (HKNO, 0x1E)))
                        {
                            If (LNotEqual (HKNO, 0x13))
                            {
                                ^^^^WMID.WGWE (0x04, Zero)
                            }
                            Else
                            {
                                If (LEqual (HKNO, 0x13))
                                {
                                    If (BTLS)
                                    {
                                        GLSD ()
                                        Store (Zero, WLRF)
                                        Store (Zero, WARF)
                                        GLRS ()
                                        Store (Zero, WLON)
                                        GLSD ()
                                        Store (One, BTOF)
                                        GLRS ()
                                        Store (Zero, BTON)
                                        GLSD ()
                                        Store (Zero, WWRF)
                                        Store (Zero, WAON)
                                        Store (One, WWOF)
                                        Store (Zero, BTLS)
                                        GLRS ()
                                    }
                                    Else
                                    {
                                        If (WLST)
                                        {
                                            GLSD ()
                                            Store (One, WARF)
                                            Store (One, WLRF)
                                            Store (Zero, WLED)
                                            GLRS ()
                                            Store (One, WLON)
                                        }
                                        Else
                                        {
                                            GLSD ()
                                            Store (Zero, WLRF)
                                            Store (Zero, WARF)
                                            Store (One, WLED)
                                            GLRS ()
                                            Store (Zero, WLON)
                                        }

                                        If (BLTH)
                                        {
                                            GLSD ()
                                            Store (Zero, BTOF)
                                            GLRS ()
                                            Store (One, BTON)
                                        }
                                        Else
                                        {
                                            GLSD ()
                                            Store (One, BTOF)
                                            GLRS ()
                                            Store (Zero, BTON)
                                        }

                                        If (WWAN)
                                        {
                                            If (LEqual (BTAP, One))
                                            {
                                                GLSD ()
                                                Store (Zero, WWOF)
                                                Store (One, WAON)
                                                Store (One, WWRF)
                                                GLRS ()
                                            }
                                        }
                                        Else
                                        {
                                            GLSD ()
                                            Store (One, WWOF)
                                            Store (Zero, WWRF)
                                            GLRS ()
                                            Store (Zero, WAON)
                                        }

                                        Store (One, BTLS)
                                    }
                                }
                            }
                        }

                        If (LEqual (HKNO, 0x04))
                        {
                            Notify (GFX0, 0x80)
                        }
                    }


Use ACPIDebug to find out the value of HKNO (Hot Key Number) for each key, then write code to check it and send the appropriate code.

For example, this is the patch for HP Envy 15 J-series (maybe K series too):
into method label _Q13 parent_label H_EC replace_content
begin
Store(HKNO, Local0)\n
If (LEqual(Local0,7))\n
{\n
// Brightness Down\n
    Notify(\_SB.PCI0.LPCB.PS2K, 0x0205)\n
    Notify(\_SB.PCI0.LPCB.PS2K, 0x0285)\n
}\n
If (LEqual(Local0,8))\n
{\n
// Brightness Up\n
    Notify(\_SB.PCI0.LPCB.PS2K, 0x0206)\n
    Notify(\_SB.PCI0.LPCB.PS2K, 0x0286)\n
}\n
If (LEqual(Local0,4))\n
{\n
// Mirror toggle\n
    Notify(\_SB.PCI0.LPCB.PS2K, 0x026e)\n
    Notify(\_SB.PCI0.LPCB.PS2K, 0x02ee)\n
}\n
end;
Seems likely to be the same.

#15
mnfesq

mnfesq

    Emenef, Esquire

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,182 posts
  • Gender:Male
  • Location:Southern California

Thanks, RehabMan, that worked.  With HP Envy laptops, it seems that the _Qxx value is only one variable controlling keyboard functions and that the HKNO value must also be established.  The patch you posted above that worked for gygabyte666 also worked for me.



#16
bajito93

bajito93

    InsanelyMac Protégé

  • Members
  • PipPip
  • 73 posts
I can't find the correct hotkey for my lenovo, the hotkeys are F11 and F12, but when I open the console.app I see anything in the system.log when I press the hotkeys.
 
How can I do it? Thanks.


#17
Allan

Allan

    V.I.P. Member

  • Supervisors
  • 11,526 posts
  • Gender:Male

 

I can't find the correct hotkey for my lenovo, the hotkeys are F11 and F12, but when I open the console.app I see anything in the system.log when I press the hotkeys.
 
How can I do it? Thanks.

 

 

Have you installed ACPIDebug.kext?



#18
nmindz

nmindz

    InsanelyMac Protégé

  • Members
  • Pip
  • 8 posts

Thanks to RehabMan, Toleda and a tons of people whose names I can't remember (I've been reading a lot of InsanelyMac and others for the past few months.) I've got myself running a decent a usable daily driver hackintosh on my Dell Inspiron 14z 5423 (Ultrabookish version, i7 3rd gen model.).

 

1) Syspref > Displays has a working brightness slider.

 

2) However the Fn+F5 (Brightness Increase) and Fn+F4 (Brightness Decrease) shows odd behavior. Each boot, they will work once. If I Press Fn+F5 it will MAX (no stepping.) my LCD brightness. Further Fn+F5 or Fn+F4 keystrokes do nothing.

If I rather press Fn+F4 it will decrease my brightness to ZERO w/o any stepping either (plain dark, impossible to see anything at all.) which often causes me to boot the system from power off button. After the key combo has been first pressed, Fn+F5 won't work either.

 

When I tried to patch my DSDT with "Instrument EC Queries" I realized I've got no "_Q##" methods at all. I then checked the next patch below it and the "Instrument GPE Queries" had something in store (matches and patches.) so I applied it. Installed ACPIDebug.kext to S/L/E and booted. Now, every time I do the key combo it gives me the output of "GPE _L17". But as others have mentioned above, it seems that _L17 is a shared method because both Fn+F5 and Fn+F4 will call the same method.

 

Nevertheless, I identified another 2 buttons (!!) which will invoke the same method (_L17), those are the "W"-like button (sometimes referred to as "Wave") and the Dell-custom button to set your own hotkeys in Windows, which are located in the upper-right area of the top cover (Silver buttons. The "gears" button has no output in Console.app.). (See attached "silver-button.jpg" image.)

 

Anyone has any idea of what I should do/look for next? If anyone thinks this deserves a new thread (if it feels like any sort of 'hijacking'.) please just PM me and I'll copy/paste this into a new thread and delete this message. Reason I thought of leaving this attached to this thread is just for further reference of fellow 14Z 5423 owners which might have a hard time finding this stuff later.  :)

 

Attached are a photo of the whole keyboard "layout", the custom Dell keys which share the _L17 method and my original (extracted from Linux.) DSDT.aml (DSDT_notfixed.aml) and the one I'm currently booting with ("DSDT_current.aml"). Also a kextstat output with any custom .kexts I'm loading other than Apple's default/AppleHDA patched. If any more info is to be provided, let me know.

 

Thanks a lot to anyone willing to help me and look into this.

Attached Files



#19
RehabMan

RehabMan

    InsanelyMacaholic

  • Developers
  • 3,179 posts
  • Gender:Male
  • Location:Bellingham, WA
  • Interests:skiing, software, classic cars

Thanks to RehabMan, Toleda and a tons of people whose names I can't remember (I've been reading a lot of InsanelyMac and others for the past few months.) I've got myself running a decent a usable daily driver hackintosh on my Dell Inspiron 14z 5423 (Ultrabookish version, i7 3rd gen model.).
 
1) Syspref > Displays has a working brightness slider.
 
2) However the Fn+F5 (Brightness Increase) and Fn+F4 (Brightness Decrease) shows odd behavior. Each boot, they will work once. If I Press Fn+F5 it will MAX (no stepping.) my LCD brightness. Further Fn+F5 or Fn+F4 keystrokes do nothing.
If I rather press Fn+F4 it will decrease my brightness to ZERO w/o any stepping either (plain dark, impossible to see anything at all.) which often causes me to boot the system from power off button. After the key combo has been first pressed, Fn+F5 won't work either.


Are your keys handled via ACPI or PS2?

#20
nmindz

nmindz

    InsanelyMac Protégé

  • Members
  • Pip
  • 8 posts

Are your keys handled via ACPI or PS2?

 

I'm using your VoodooPS2Controller.kext.







Also tagged with one or more of these keywords: fix, brightness, hotkeys, laptop, dsdt

  Topic Stats Last Post Info

2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users

© 2017 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy