Contribute
Register

[Fix] ACPI Brightness Keys using Smart Touchpad Driver

Status
Not open for further replies.
Joined
Oct 22, 2013
Messages
197
Motherboard
hm77
CPU
4790k
Graphics
hd4000
Many laptops use calls to DSDT EC query methods to control brightness. On my system, for example, the brightness keys are Fn+LeftArrow (brightness down), and Fn+RightArrow (brightness up). When you press the brightness down key-combo it calls EC method _Q11, and calls _Q12 for brightness up.

The problem is that OS X has no idea what do with the results these methods produce when they are called. A DSDT patch is needed to fix the ACPI controlled brightness keys on a hackintosh.

To make brightness keys function as expected when using EMlyDinEsH's Smart Touchpad driver (v4.3+), you first need some information: which methods get called when the brightness buttons are pressed, and where EMlyDinEsH's driver is connecting to your machine.

Finding out where the driver is connecting is the simplest part. Launch IORegistryExplorer and search for keyboard. You should see something like this:
Code:
|
--[B]KBC0[/B]
    |
    --ps2controller
            |
            --ApplePS2KeyboardDevice
                    |
                    --ApplePS2Keyboard
As you can see, ApplePS2Keyboard attaches to ApplePS2KeyboardDevice, which attaches to ps2controller, all of which attach to, on my machine, KBC0, the device name we are looking for. Another common place for a keyboard to attach is PS2K.

With that out of the way, we now need to figure out which EC methods get called when you press your brightness key combos. For this we need to use RehabMan's ACPIDebug kext, found here:

https://github.com/RehabMan/OS-X-ACPI-Debug

Install the kext, and apply the following DSDT patches:

Debug:
https://github.com/RehabMan/OS-X-ACPI-Debug/blob/master/debug.txt

Instrument Qxx:
https://github.com/RehabMan/OS-X-ACPI-Debug/blob/master/instrument_Qxx.txt

and reboot.

Now, open Console, and when you press your brightness key combos, the methods they call should be displayed in the system log.

In my case, the methods were _Q11 for brightness down, and _Q12 for brightness up.

Now that we have the three required pieces of information, which for me are:

KBC0, the device to which the keyboard attaches,
_Q11, the method called when the brightnes down button is pressed, and
_Q12, the method called when the brightnes up button is pressed,

we can now patch our DSDT at those methods to notify EMlyDinEsH's driver on key press.

First remove the ACPIDebug kext, and also remove the two debug patches you applied earlier using this patch:

https://github.com/RehabMan/OS-X-ACPI-Debug/blob/master/remove.txt


Next, apply this patch:

Code:
#Edit methods _Q11 and _Q12 to interface with KBC0
into method label [B]_Q11[/B] replace_content
begin
// Brightness Down\n
Notify ([B]KBC0[/B], 0x20)\n
end;

into method label [B]_Q12[/B] replace_content
begin
// Brightness Up\n
Notify ([B]KBC0[/B], 0x10)\n
end
Replacing KBC0 in the lines

Code:
Notify ([B]KBC0[/B], 0x10)
with the name of your device, and replacing _Q11 & _Q12 in the lines

Code:
into method label [B]_Q11[/B] replace_content
into method label [B]_Q12[/B] replace_content
with the name of your methods for brightness up, and for brightness down respectively.

Reboot, and your brightness keys should now be functional. Do note that by default the Smart Touchpad driver has FinerFNBrightnessControl enabled in its configuration plist. This breaks the brightness scale into 64 steps, instead of the normal 16 that OSX uses. To configure the keyboard driver, reference this thread: http://forum.osxlatitude.com/index....-enhanced-keyboard-for-smart-touchpad-driver/

Much thanks goes to EMlyDinEsH for taking the time to implement what was necessary to make this work on his side, and to RehabMan for his ACPIDebug kext.
 
Thank a lot:clap:, I'm looking for this for a long time since i notice SmartTouchpad.
I almost give up SmartTouchpad cuz ACPI brightness Key wouldn't work.

And using 16 level brightness/Volume needs to turn off FinerFNBrightnessControl/FinerFnVolumeControl, I wasn't notice that in the first time read it.

And did you know the correct notify value of MediaPlayPause/MediaPrevious/MediaNext or Mission_Control ?
 
O,Thanks! I already know that, but that's for Voodoo-PS2-Controller, SmartTouchpad aren't compatible.
When I using Voodoo-PS2-Controller, it couldn't get multi-touch supported or I don't know how. So I was trying to turn to SmartTouchpad, which gets multi-touch supported. Until saw this, I never did cuz SmartTouchpad notify different value then Voodoo-PS2-Controller.
 
O,Thanks! I already know that, but that's for Voodoo-PS2-Controller, SmartTouchpad aren't compatible.

You should read it carefully. It actually has instructions for both.
 
it's working, Fn+LeftArrow (brightness down), and Fn+RightArrow (brightness up).
but still occur, when i press FN button only, it make brightness up only.
how to turn off/disable FN button only behaviour???
 
Problem report:

how to disable
1. RightShift+Up/Down Arrow = Mute/UnMute
2. RightShift+Right/Left Arrow = Mute/UnMute
3. FN keys (only) = BrightnessUP (icon popup)

how to enable:
FN+UpArrow = AudioVolume UP
FN+DownArrow = AudioVolume DOWN

litte bit off topic beside above problem,
any advice//suggestion amongs my setup would be appreciated
eg.
- DSDT patch
- kexts
- is my USB port ok?
- clover configuration
- anything for fast boot

Thanks in advance.....
 
Problem report:

how to disable
1. RightShift+Up/Down Arrow = Mute/UnMute
2. RightShift+Right/Left Arrow = Mute/UnMute

You need to analyze key logs in the kernel log to determine what PS2 codes these keys are generating.

3. FN keys (only) = BrightnessUP (icon popup)

What do you mean by "FN keys (only)"?

how to enable:
FN+UpArrow = AudioVolume UP
FN+DownArrow = AudioVolume DOWN

Again, are these your standard volume controls? (in Windows?).
If not, you would need to determine what codes they generate (if they generate anything).
You should really consider why you're not using the standard PS2 codes for volume though.

litte bit off topic beside above problem,
any advice//suggestion amongs my setup would be appreciated
eg.
- DSDT patch
- kexts
- is my USB port ok?
- clover configuration
- anything for fast boot

Thanks in advance.....

Your responsibility to test your laptop to identify any problems.
 
Status
Not open for further replies.
Back
Top