Jump to content

GUIDE: How to Fix Brightness hotkeys in DSDT / SSDT-hotpatch


soumaxetuirk
 Share

110 posts in this topic

Recommended Posts

What is in your native DSDT header? The header is the line with 'DefinitionBlock' at the beginning.

 

If by "native" you mean the non-patched one, which I dumped from Linux, here it is:

/*
 * Intel ACPI Component Architecture
 * AML Disassembler version 20100331
 *
 * Disassembly of iASL9aFYGv.aml, Mon Aug 24 00:49:48 2015
 *
 *
 * Original Table Header:
 *     Signature        "DSDT"
 *     Length           0x0000AB28 (43816)
 *     Revision         0x02
 *     Checksum         0xB0
 *     OEM ID           "DELL"
 *     OEM Table ID     "WN09"
 *     OEM Revision     0x00000022 (34)
 *     Compiler ID      "INTL"
 *     Compiler Version 0x20051117 (537202967)
 */
DefinitionBlock ("iASL9aFYGv.aml", "DSDT", 2, "DELL", "WN09", 0x00000022)
{
    ...
}

If you want to take a look at the whole thing, it is attached.

 

Thanks!

DSDT_original.aml.zip

Link to comment
Share on other sites

If by "native" you mean the non-patched one, which I dumped from Linux, here it is:

DefinitionBlock ("iASL9aFYGv.aml", "DSDT", 2, "DELL", "WN09", 0x00000022)

 

Apply this patch:

# select DELL/WN09 profile in VoodooPS2Keyboard Info.plist
into method label _DSM parent_label PS2K remove_entry;
into device label PS2K insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
    If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
    Return (Package()\n
    {\n
        "RM,oem-id", "DELL",\n
        "RM,oem-table-id", "WN09",\n
    })\n
}\n
end;
  • Like 2
Link to comment
Share on other sites

Apply this patch:

# select DELL/WN09 profile in VoodooPS2Keyboard Info.plist
into method label _DSM parent_label PS2K remove_entry;
into device label PS2K insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
    If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
    Return (Package()\n
    {\n
        "RM,oem-id", "DELL",\n
        "RM,oem-table-id", "WN09",\n
    })\n
}\n
end;

 

I had no clue you could select a VoodooPS2 profile through the DSDT nor how to do it.

 

The FN keys were completely solved (including wifi toggle and brightness), but some stuff got mixed in and are kinda messy.

Well for some reason ever since I've been using OS X in this laptop, the "windows key" (which should be "Command") is actually ALT while ALT itself is Command.

 

After the DSDT patch three keys were swapped. Quotes became backslash, close braces became quotes and backslash became close braces.

The ALT/Command swap is still the same as usual.

 

Anyway, thank you so much for your work on the PS2 driver and for your help sorting this out. :)

I think I could remap the keys myself through Info.plist inside the VoodooPS2, am I correct? If so, is there any good source about doing it?

 

 

Thanks!!!

Link to comment
Share on other sites

The FN keys were completely solved (including wifi toggle and brightness), but some stuff got mixed in and are kinda messy.

Well for some reason ever since I've been using OS X in this laptop, the "windows key" (which should be "Command") is actually ALT while ALT itself is Command.

By design. Matches the physical layout of Mac keyboards.

 

After the DSDT patch three keys were swapped. Quotes became backslash, close braces became quotes and backslash became close braces.

The ALT/Command swap is still the same as usual.

 

Anyway, thank you so much for your work on the PS2 driver and for your help sorting this out. :)

I think I could remap the keys myself through Info.plist inside the VoodooPS2, am I correct? If so, is there any good source about doing it?

The Dell/WN09 (profile in Info.plist) is done by TimeWalker.

 

You can change it via Info.plist. It sounds like you have an issue with SysPrefs->Keyboard->Input Sources.

  • Like 1
Link to comment
Share on other sites

By design. Matches the physical layout of Mac keyboards.

 

 

The Dell/WN09 (profile in Info.plist) is done by TimeWalker.

 

You can change it via Info.plist. It sounds like you have an issue with SysPrefs->Keyboard->Input Sources.

 

AFAIK it's not a system keyboard layout issue (as there is only two keyboard layouts which hold the "Ç" key without having to combine ' + C, which are Brazilian ABNT and Brazilian ABNT2). Both have this key swapping issue. I'd rather believe it's due to to the "exotic" layout Dell has put up in this keyboard.

 

Looking at their picture in Sysprefs > Keyboard > Input Sources, I can clearly see that my backslash, close quotes and forward slash keys are the only that fall outside the key layouts (they are within the blank key icons.). The funny thing is that forward slash works fine. Therefore it does makes sense that it has got messed up. I'll have a go trying to remap those.

 

Thanks again. Keep up the excellent work man! :)

Link to comment
Share on other sites

AFAIK it's not a system keyboard layout issue (as there is only two keyboard layouts which hold the "Ç" key without having to combine ' + C, which are Brazilian ABNT and Brazilian ABNT2). Both have this key swapping issue. I'd rather believe it's due to to the "exotic" layout Dell has put up in this keyboard.

 

Looking at their picture in Sysprefs > Keyboard > Input Sources, I can clearly see that my backslash, close quotes and forward slash keys are the only that fall outside the key layouts (they are within the blank key icons.). The funny thing is that forward slash works fine. Therefore it does makes sense that it has got messed up. I'll have a go trying to remap those.

 

Thanks again. Keep up the excellent work man! :)

You can implement custom keylayout with Ukelele.

Link to comment
Share on other sites

You can implement custom keylayout with Ukelele.

 

I tried Ukelele after you mentioned it but it didn't "fit my needs". I was able to easily remap two of the swapped keys, but the quotes one was a no-go (it was not being recognized in the keyboard layout.).

 

Then I went into VoodooPS2Keyboard.kext's Info.plist and checked TimeWalker's implementation of the WN09 profile. Turns out he had remapped those three keys there inside, probably to match the XPS/Vostro layout he described in the comment key. Mine didn't need such remap, so I removed it:

	...
	<key>Custom PS2 Map</key>
	<array>
		<string>56=2b</string>
		<string>29=56</string>
		<string>2b=29</string>
		<string>e01e=e037</string>
		<string>e037=e01e</string>
	</array>
</dict>

Removing the "56=2b", "29=56" and "2b=29" lines, saving to the .kext and rebuilding kextcache completely solved all issues.

Can't believe I've got all my keyboard functions working perfect. Now I'm just missing effective power management and battery status (after OS X 10.11 Beta 2, VoodooBattery.kext no longer works.) for a fully functional hackintosh. Didn't test HDMI audio/video but if I remember back then when I had Mavericks, it worked fine.

 

Thanks for your priceless help, RehabMan... and also to all the others who've contributed to the projects I'm currently using. :D

Link to comment
Share on other sites

I tried Ukelele after you mentioned it but it didn't "fit my needs". I was able to easily remap two of the swapped keys, but the quotes one was a no-go (it was not being recognized in the keyboard layout.).

 

Then I went into VoodooPS2Keyboard.kext's Info.plist and checked TimeWalker's implementation of the WN09 profile. Turns out he had remapped those three keys there inside, probably to match the XPS/Vostro layout he described in the comment key. Mine didn't need such remap, so I removed it:

	...
	<key>Custom PS2 Map</key>
	<array>
		<string>56=2b</string>
		<string>29=56</string>
		<string>2b=29</string>
		<string>e01e=e037</string>
		<string>e037=e01e</string>
	</array>
</dict>
Removing the "56=2b", "29=56" and "2b=29" lines, saving to the .kext and rebuilding kextcache completely solved all issues.

Can't believe I've got all my keyboard functions working perfect. Now I'm just missing effective power management and battery status (after OS X 10.11 Beta 2, VoodooBattery.kext no longer works.) for a fully functional hackintosh. Didn't test HDMI audio/video but if I remember back then when I had Mavericks, it worked fine.

 

Thanks for your priceless help, RehabMan... and also to all the others who've contributed to the projects I'm currently using. :D

 

I'm not sure why TimeWalker did it, but I'll leave it as-is, and add another profile ... DELL/WN09a:

--- a/VoodooPS2Keyboard/VoodooPS2Keyboard-Info.plist
+++ b/VoodooPS2Keyboard/VoodooPS2Keyboard-Info.plist
@@ -361,6 +361,28 @@
                                                        <string>e006</string>
                                                </array>
                                        </dict>
+                                       <key>WN09a</key>
+                                       <dict>
+                                               <key>Custom ADB Map</key>
+                                               <array>
+                                                       <string>e01b=70</string>
+                                                       <string>e06e=83</string>
+                                               </array>
+                                               <key>Custom PS2 Map</key>
+                                               <array>
+                                                       <string>e01e=e037</string>
+                                                       <string>e037=e01e</string>
+                                               </array>
+                                               <key>Breakless PS2</key>
+                                               <array>
+                                                       <string>e01b</string>
+                                                       <string>e008</string>
+                                                       <string>e01e</string>
+                                                       <string>e005</string>
+                                                       <string>e06e</string>
+                                                       <string>e006</string>
+                                               </array>
+                                       </dict>
                                        <key>SNB-CPT</key>
                                        <dict>
                                                <key>Note-Comment</key>
Patch to select it would be:

# select DELL/WN09 profile in VoodooPS2Keyboard Info.plist
into method label _DSM parent_label PS2K remove_entry;
into device label PS2K insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
    If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
    Return (Package()\n
    {\n
        "RM,oem-id", "DELL",\n
        "RM,oem-table-id", "WN09a",\n
    })\n
}\n
end;
Link to comment
Share on other sites

  • 2 weeks later...

I got a problem... Q11 and Q12 handles brightness (quite easy to figure that out). So I used suggested patch (Dell method?)  > > >

     Method (_Q11, 0, NotSerialized)  // _Qxx: EC Query
            {
                Notify (PS2K, 0x0205)
                Notify (PS2K, 0x0285)
            }

            Method (_Q12, 0, NotSerialized)  // _Qxx: EC Query
            {
                Notify (PS2K, 0x0206)
                Notify (PS2K, 0x0286)
            }
 

That's fine and it does the thing ... but (unfortunately) only for a while (I tested it by sending a lot of repetitive alternating up/down commands) and then the KB and TP freezed (with or without a mouse attached).

ACPIDebug: "EC _Q11 enter"
ACPIDebug: "EC _Q11 exit"

ACPIDebug: "EC _Q12 enter"
ACPIDebug: "EC _Q12 exit"

....... and on like that
 

A funny thing, when it goes to sleep after that (just for testing), it can actually wake from the TP (which normally does not happen). 

Then after that the USB ports freeze and stops working as well :-( (can only do a reset).

 

Does this sound familiar to someone?

The DSDT is far from being completely optimised, so therein lies the problem maybe?

I did not add a _DSM method in PS2K device  for HPQOEM, but then I do not know if that would solve the problem

because the model of the machine is not listed there anyway ....

 

I attach my DSDT and IOREG: 

 

 

 

Link to comment
Share on other sites

  • 1 month later...

Can't find the Brightness Keys Code[/size]

no PS2[/size]

no ACPI[/size]

no GPE[/size]

 

i install ACPIDebuger kext Patch using Add DSDT Debug Methods, Instrument EC Queries and Instrument GPE event[/size]

 

No code generated when pressing the brightness keys

Is your DSDT correctly patched to simulate a version of Windows when running "Darwin"?

Link to comment
Share on other sites

  • 1 month later...

hi guys i dont know what generated code in system info,, i was install ACPIDebuger.kext and Add DSDT Debug Methods, Instrument EC Queries,,

 

only this i found in sys.log

 

Dec 12 23:33:35 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _QB6 enter"

Dec 12 23:33:35 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _QB6 exit"
Dec 12 23:33:35 Robbys-MacBook-Pro com.apple.xpc.launchd[1] (com.apple.quicklook[353]): Endpoint has been activated through legacy launch(3) APIs. Please switch to XPC or bootstrap_check_in(): com.apple.quicklook
Dec 12 23:33:36 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _Q8D enter"
Dec 12 23:33:36 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _Q8D exit"
Dec 12 23:33:38 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _Q8E enter"
Dec 12 23:33:38 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _Q8E exit"
Dec 12 23:33:38 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _QB7 enter"
Dec 12 23:33:38 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _QB7 exit"
Dec 12 23:33:44 Robbys-MacBook-Pro CloudKeychainProxy[378]:  __45-[ubiqitousKVSProxy doEnsurePeerRegistration]_block_invoke <UB---e-C---> ensurePeerRegistration called, success ((null))
 
 
my laptop toshiba c840,, 
Link to comment
Share on other sites

hi guys i dont know what generated code in system info,, i was install ACPIDebuger.kext and Add DSDT Debug Methods, Instrument EC Queries,,

 

only this i found in sys.log

 

Dec 12 23:33:35 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _QB6 enter"

Dec 12 23:33:35 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _QB6 exit"

Dec 12 23:33:35 Robbys-MacBook-Pro com.apple.xpc.launchd[1] (com.apple.quicklook[353]): Endpoint has been activated through legacy launch(3) APIs. Please switch to XPC or bootstrap_check_in(): com.apple.quicklook

Dec 12 23:33:36 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _Q8D enter"

Dec 12 23:33:36 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _Q8D exit"

Dec 12 23:33:38 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _Q8E enter"

Dec 12 23:33:38 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _Q8E exit"

Dec 12 23:33:38 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _QB7 enter"

Dec 12 23:33:38 Robbys-MacBook-Pro kernel[0]: ACPIDebug: "EC _QB7 exit"

Dec 12 23:33:44 Robbys-MacBook-Pro CloudKeychainProxy[378]:  __45-[ubiqitousKVSProxy doEnsurePeerRegistration]_block_invoke <UB---e-C---> ensurePeerRegistration called, success ((null))

 

 

my laptop toshiba c840,,

You need to monitor system.log when you press each key. Then you'll know correlation.

Link to comment
Share on other sites

when i pres each key, no log about that in my sys.log,,, what wrong with that ?

Probably you didn't patch your DSDT correctly to emulate a version of Windows for _OSI("Darwin").

Link to comment
Share on other sites

i was try, but i cant apply that patch,, here's i screenshoot,,  http://imgur.com/KXuT4RN

It could be your DSDT is old enough to not have any checks for "Windows 2012".

 

You should read each patch carefully. And check your own DSDT for the code the patch is trying to match on.

Link to comment
Share on other sites

Well,, i use AsusNBFnKeys.kext and make some patch. And all off my Fn keys are function normally  :hysterical:  :hysterical:  :hysterical:

Personally, I would not use AsusNBFnKeys.kext for brightness keys -- it is slow and laggy. It is ok with the other keys.

 

Not sure what is so funny, but glad you're having a good time...

Link to comment
Share on other sites

Well,, i use AsusNBFnKeys.kext and make some patch. And all off my Fn keys are function normally  :hysterical:  :hysterical:  :hysterical:

hmmm,, my notebook is toshiba, is the AsusNBFnkeys,kext work for my notebook ?? :D

It could be your DSDT is old enough to not have any checks for "Windows 2012".

 

You should read each patch carefully. And check your own DSDT for the code the patch is trying to match on.

can you help me to patch that rehabman ?

Link to comment
Share on other sites

Personally, I would not use AsusNBFnKeys.kext for brightness keys -- it is slow and laggy. It is ok with the other keys.

 

Not sure what is so funny, but glad you're having a good time...

Sorry for my bad.

 

Rehabman, i used ApplePS2SmartTouchpad then i look at inside Plugin's folder there are ApplePS2Controller.kext and ApplePS2Keyboard.kext.

If i want using your ApplePS2Controller.kext, then do i need to remove ApplePS2Controller.kext of this kext?? And About your PS2Controller.kext, is this kext support for FocalTech Touchpad?? The reason i use ApplePS2SmartTouchpad.kext from EmlyDinesh is because of this Touchpad :)

Link to comment
Share on other sites

Sorry for my bad.

 

Rehabman, i used ApplePS2SmartTouchpad then i look at inside Plugin's folder there are ApplePS2Controller.kext and ApplePS2Keyboard.kext.

If i want using your ApplePS2Controller.kext, then do i need to remove ApplePS2Controller.kext of this kext?? And About your PS2Controller.kext, is this kext support for FocalTech Touchpad?? The reason i use ApplePS2SmartTouchpad.kext from EmlyDinesh is because of this Touchpad :)

You cannot use my keyboard driver with the ELAN kexts. They are not compatible, and contrary to my and others' urging, the author of the ELAN kext continues to violate open source licenses as he/she continues to refuse to publish the source.

Link to comment
Share on other sites

 Share

×
×
  • Create New...