Jump to content

Fn HotKey and ALS sensor driver for Asus Notebooks


EMlyDinEsH

Recommended Posts

Hi everyone. I got FN keys work fine, but I'm getting bunch of errors and warning, compiling DSDT with 4-levels keyboard brightness patch. Here they are (i will also attach screenshot):

 

 

Can anyone help me solve this problem?

Laptop model: Asus Q500A. Ivy Bridge: Core i5-3230M.

 

Aloha ! I have the same laptop as you. Did you say that your Fkeys are working fine ? Does your keyboard backlight work with Fn+F3 and Fn+F4 ? I can't get mine to work at all.

 

What version of the BIOS do you have installed. I am on v207.

 

I found no patches in your DSDT. I fixed the one compilation error, just search for "FIX:" and you'll find my mod.

 

You do not have the variable "KBLV" in your DSDT, you have "KBLD" instead. You need to either change KBLV to KBLD in the patch or KBLD in your DSDT to KBLV, your choice. The PWKB variable is also from the K/B backlight patch just like KBLV. Only PWKB is actually defined in the patch. You must have included the part of the patch with the reference but left out the definition. Your 5th error is just a problem with scope, bad placement of the code. In any event, this patch was not at all in the DSDT which you attached here. This one looks to be an original/freshly extracted DSDT. Heck, the error that I just fixed would have prevented any of those others from even getting a chance to happen.

 

Lmk if you need more help to compile. I've been hacking at this for some time and still no K/B backlight control.

DSDT.Q500a.Chuck.dsl.zip

Link to comment
Share on other sites

Aloha all !

 

First, things first. Thanks for all the hard work that has gone into this project :)

 

OK, I am really stuck trying to get my keyboard backlight working. I have an Asus Q500a which is an Ivy-Bridge laptop that should be just about the right age machine to still be supported by this kext.

 

This is a simple HD4000 laptop with no dedicated video chip and I'm running Sierra 10.12.6.

 

Here is a rundown of my FKey action with version 2.6 of the kext NOT loaded:

 

FN+F1 sleep

FN+F2 nothing (stock WiFi card was swapped out)

FN+F3 nothing (keyboard backlight unaffected)

FN+F4 nothing (keyboard backlight unaffected)

FN+F5 nothing (video backlight unaffected)

FN+F6 nothing (video backlight unaffected)

FN+F7 nothing (video backlight unaffected)

FN+F8 Display Scrambled ~ unrecoverable !

FN+F9 nothing (trackpad unaffected)

FN+F10 nothing (audio unaffected)

FN+F11 nothing (audio unaffected)

FN+F12 nothing (audio unaffected)

FN+F13 DVD eject w/animation

FN+<numlock> audio mute toggle w/animation

FN+<numpad5> audio mute toggle w/animation

FN+<down arrow> launch iTunes

 

and Here is a rundown of my FKey action with version 2.6 of the kext LOADED:

 

FN+F1 sleep

FN+F2 nothing (stock WiFi card was swapped out)

FN+F3 nothing (keyboard backlight unaffected)

FN+F4 nothing (keyboard backlight unaffected)

FN+F5 video backlight brightness- w/animation

FN+F6 video backlight brightness+ w/animation

FN+F7 video backlight toggle off/on

FN+F8 nothing

FN+F9 trackpad toggle off/on

FN+F10 audio mute toggle w/animation

FN+F11 audio- w/animation

FN+F12 audio+ w/animation

FN+F13 DVD eject w/animation

FN+<numlock> audio mute toggle w/animation

FN+<numpad5> audio mute toggle w/animation

FN+<down arrow> launch iTunes

 

I should mention that I must have my DSDT perform a WIndows 2006 (Windows Vista) init for all of this to work. If I do either a Windows 2009 (Win7) or Windows 2012 (Win8) init then video brightness FKeys will not work whether the kext is loaded or not.

 

Anyway, this is all cool except for the fact that I still have no keyboard backlight.

 

I tried the 4 level and 16 level patches a couple of different ways and patched the _Q functions for the F3/F4 keyboard backlight keys too all with no effect.

 

I require no patching in any of my other FKey _Q() methods for those FKeys to work.

 

Once booted, my keyboard backlight does begin as illuminated but the FKeys have no effect on the level of brightness and the backlight shuts off with sleep and will not come back on after wake. In fact, it will not come back on again unless I boot into Windows first and then boot Mac again. Yes, I did try the _WAK patch from rehabman, no help.

 

I have looked at a few other Ivy-Bridge laptop DSDTs and do notice a difference from mine. In all of the other DSDTs, In the SLKB() function I see a line of code like:

 

^^PCI0.LPCB.EC0.WRAM (0x044B, Local0)

 

But in my SLKB() function, I have nothing like this.  Here is mine:

 

Method (SLKB, 1, NotSerialized)
{
            And (Arg0, 0xFF, Local0)
            Store (Local0, KBLD)
            If (And (KBLD, 0x80))
            {
                And (Local0, 0x7F, Local0)
                If (LEqual (Local0, Zero))
                {
                    ^^PCI0.LPCB.EC0.ECXT (0xB6, 0xFF, Zero, Zero, Zero, Zero)
                }

                If (LEqual (Local0, One))
                {
                    ^^PCI0.LPCB.EC0.ECXT (0xB6, 0xAA, Zero, Zero, Zero, Zero)
                }

                If (LEqual (Local0, 0x02))
                {
                    ^^PCI0.LPCB.EC0.ECXT (0xB6, 0x55, Zero, Zero, Zero, Zero)
                }

                If (LEqual (Local0, 0x03))
                {
                    ^^PCI0.LPCB.EC0.ECXT (0xB6, Zero, Zero, Zero, Zero, Zero)
                }
            }
            Else
            {
                ^^PCI0.LPCB.EC0.ECXT (0xB6, 0xFF, Zero, Zero, Zero, Zero)
            }

            Return (One)

}

 

Also, I get these syslog messages at boot:

 

ApplePS2Keyboard: keyboard backlight is 0xea

ApplePS2Keyboard: keyboard backlight is 0x1

ApplePS2Keyboard: keyboard backlight set to 0xed

 

and now a bunch of these ...

 

default    09:14:59.969870 -1000    kernel    ApplePS2Keyboard: Keyboard backight value from DSDT is 0x0

 

Plus I get AsusNBFnKeys.kext complaining that I have no ALSS method.

 

default    09:12:07.827845 -1000    kernel    AsusNBFnKeys: Cannot find the method ALSS.

 

Which I do not as I doubt that this laptop has an ambient light sensor.

 

I have attached my original and modified DSDTs + the config files of AsusNBFnKeys.kext, ApplePS2SmartTouchPad and and ApplePS2Keyboard in case I screwed up that part.

 

I am running ApplePS2SmartTouchPad v4.68 (latest beta, I believe)

 

Any help here would be so awesome !

 

For now, gonna try to hook my SLKB() into the SKBL() from the patch ...

 

UPDATE >>>>

 

Did try some hacking in my DSDT and just made things worse, lol !

 

When I insert a dummy ALSS method to suppress the warning, my display backlight continuously resets to about 1/4 illumination.

I kick it back up to 100% and in a few seconds, it autosets back down kinda like when mom used to dim my bedroom lights in hope of having me finally go to sleep !

 

I also reset patches back to standard and so I see these warnings reprint about every 2-3 seconds ...

 

default    11:40:21.472551 -1000    kernel    ApplePS2Keyboard: Keyboard backight value from DSDT is 0x1
default    11:40:21.473993 -1000    kernel    ApplePS2Keyboard: Keyboard backight level set to 0xea
default    11:40:22.889587 -1000    kernel    ApplePS2Keyboard: Keyboard backight value from DSDT is 0xed
default    11:40:22.889650 -1000    kernel    ApplePS2Keyboard: Keyboard backight value from DSDT is 0x1
default    11:40:22.899270 -1000    kernel    ApplePS2Keyboard: Keyboard backight level set to 0xea
default    11:40:24.319724 -1000    kernel    ApplePS2Keyboard: Keyboard backight value from DSDT is 0xed
default    11:40:24.319786 -1000    kernel    ApplePS2Keyboard: Keyboard backight value from DSDT is 0x1
default    11:40:24.323492 -1000    kernel    ApplePS2Keyboard: Keyboard backight level set to 0xea
 

and of course ...

 

default    11:41:27.624715 -1000    kernel    AsusNBFnKeys: Cannot find the method ALSS.
default    11:41:30.625484 -1000    kernel    AsusNBFnKeys: Cannot find the method ALSS.
default    11:41:33.626543 -1000    kernel    AsusNBFnKeys: Cannot find the method ALSS.
default    11:41:36.627543 -1000    kernel    AsusNBFnKeys: Cannot find the method ALSS.
 

HELP !!!

 

Asus_Q500a.zip

Link to comment
Share on other sites

Does your keyboard backlight work with Fn+F3 and Fn+F4 ? I can't get mine to work at all.

No, everything works, using this kext, except keyboard backlight control.

What version of the BIOS do you have installed. I am on v207.

BIOS ver.208.

 

I found no patches in your DSDT. I fixed the one compilation error, just search for "FIX:" and you'll find my mod.

No patches because i couldn't save DSDT after editing (see errors). 

 

You do not have the variable "KBLV" in your DSDT, you have "KBLD" instead. You need to either change KBLV to KBLD in the patch or KBLD in your DSDT to KBLV, your choice. The PWKB variable is also from the K/B backlight patch just like KBLV. Only PWKB is actually defined in the patch. You must have included the part of the patch with the reference but left out the definition. Your 5th error is just a problem with scope, bad placement of the code. In any event, this patch was not at all in the DSDT which you attached here. This one looks to be an original/freshly extracted DSDT. Heck, the error that I just fixed would have prevented any of those others from even getting a chance to happen.

 

Lmk if you need more help to compile. I've been hacking at this for some time and still no K/B backlight control.

Thanks! I changed KBLV to KBLD in patch, but there is still no result  :unsure:. I removed PWKB, cause i couldn't save DSDT with it. I don't understand what i can do with it, i am new to this.

Link to comment
Share on other sites

No, everything works, using this kext, except keyboard backlight control.

BIOS ver.208.

 

No patches because i couldn't save DSDT after editing (see errors). 

 

Thanks! I changed KBLV to KBLD in patch, but there is still no result  :unsure:. I removed PWKB, cause i couldn't save DSDT with it. I don't understand what i can do with it, i am new to this.

 

Hmmm, where do u get v208 ? I can't find anything beyond v207 out there.

 

I said that your DSDT was original but not quite. Yours does have a PNLF (video backlight mod) so there was some success in modding there.

 

What are u using to edit DSDTs ? I just use TextEdit. That lets u save anything. Then I compile from the command line with iasl <DSDT .dsl file name>.

 

U need PWKB and BOFF with the K/B backlight patch or u will get undefined variable compile errors.

 

Feel free to grab my DSDT above. It's heavily commented source. Just use FileMerge (XCode) to add what makes sense.

 

U might just find that there are not much in the way of changes from v207-v208.

 

Tell me where to find it and I will move to that version. In the mean time, I'll continue to look for it.

 

U might just be able to compile and use mine but watch for Wifi card.

 

The backlight patches won't work at all though. Our backlight read/set functions are different than all other Asus DSDT code that I have seen.

 

We need a guru from this site who really understands Asus keyboard backlight to show us how to modify this patch.

 

Good luck, lmk.

Link to comment
Share on other sites

Hmmm, where do u get v208 ? I can't find anything beyond v207 out there.

This version was preinstalled on my laptop.

 

What are u using to edit DSDTs ?

I use MaciASL.

 

However, I believe that our Q500a shipped with the ARB195, combined AR9285+BT so should be good there.

nope, mine shipped with Intel WiFi card, i changed it to Broadcom BCM94352 (AzureWave AW-CE123H).

 

Feel free to grab my DSDT above. It's heavily commented source. Just use FileMerge (XCode) to add what makes sense.

 

Good luck, lmk.

Thank you very much!
Link to comment
Share on other sites

v208 came installed but is not offered as an upgrade via Asus support, interesting.

 

Maciasl, that's what I figured. Yea, that app never let's me save anything either. It is handy to apply patches so I used to use Maciasl for that but then I'd copy all the text out of the editor, paste it into TextEdit and save it that way. Then compile. Finally got sick of that and just took to applying patches manually. I like to comment all changes anyway which autopatching will not do.

 

But the keyboard backlight still won't work :(

 

Hey, you are loading both the ElanSmartTouchPad AND this AsusFNKeys kext, right ?

Link to comment
Share on other sites

Hey, you are loading both the ElanSmartTouchPad AND this AsusFNKeys kext, right ?

No, I am loading only ElanSmartTouchPad kext, it already contains fn keys patch. I use it's built-in FN Keys patch, cause with it i don't need to hold "FN" button to raise volume or brightness, f1-f12 works as function keys.

I also tried AsusFNKeys kext, but it couldn't get work keyboard backlight control, so i removed it.

 

Link to comment
Share on other sites

OK, I was starting to wonder whether you had the this FKeys kext loaded. Well that's a diiference. I get NO audio FKeys and NO video brightness FKeys w/o the FKeys kext loaded ! I even added your more complicated video patch and no difference. I did notice a few "X" methods within your video patch. You might have some hotpatching through clover going on. Do you mind zipping up and attaching your Clover folder ? You don't have anything else in the way of mods going on in your main DSDT.

 

I'm using the latest beta of the ElanSmartTouchPad.kext and it's not mapping any FKeys for me other than maybe FN+F1 for sleep and FN+F13 for eject.

 

I'm gonna continue hacking on this K/B backlight thing ...

Link to comment
Share on other sites

Aloha again !

 

OK, great news, especially for you ZChuck ;)

 

I cracked the K/B backlight problem on our Asus Q500a laptops !!!

 

As it turns out, this particular kext doesn't do much for us so I had to go back to the drawing board and recode the DSDT just a little bit.

But it wasn't really so terribly bad as it could have been, I'm sure.

 

I know that you said you don't need the AsusNBFnKeys.kext to make your audio and brightness keys work but I think you may still need it to make the K/B backlight keys function. The reason is because the ATKD device must be initialized before the K/B backlight code is available to the system.  If the ATKD device is not initialized, the K/B backlight code definitely won't execute.

 

Loading the AsusNBFnKeys.kext achieves ATKD initialization.  Maybe you have found another way ?

 

Because the K/B backlight patches are useless for us, be sure to disable K/B backlight support by setting:

 

ApplePS2SmartTouchPad->IOKitPersonalities->SmartPad->Preferences->Keyboard->EnableAsusBacklightSupport=NO

 

Otherwise ApplePS2SmartTouchPad will call out those 2 K/B backlight patch functions: SKBL() & GKBL() like 50x a minute.

Especially GKBL(), which continuously polls in a loop. You gotta shut those down.

 

If you do end up loading AsusNBFnKeys.kext also, be sure to disable the ALS functionality in The AsusNBFnKeys.kext as well by setting:

 

AsusNBFnKeys.kext->IOKitPersonalities->AsusNBFnKeys->Preferences->ConfigForALS->EnableAtBoot=NO

 

or you system log will be littered by continuous: "AsusNBFnKeys: Cannot find the method ALSS." messages.

 

I have enclosed copies of your original DSDT from the CLOVER zip you enclosed + my K/B backlight modified version in both compiled and source w/comments formats as well as the versions of the author's kexts that I am using with those config options set. To see the mods just search for "FIX(bisk):".

 

The proper illumination level is even saved and reset from sleep to wake as I found the K/B backlight on wake callout function. It's KBLW, lol ! That function decompiled for us with nothing but space between the curly braces.

 

Lmk how it works out for ya. It's working great for me.

 

That's about it. I'm out ...

 

 

ZChuckMorris.zip

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...