Contribute
Register

[Guide] Laptop backlight control using AppleBacklightFixup.kext

Problem is I look at all of each of your recent posts here and neither of you have uploaded any "Problem Reporting" files.

i'll upload them soon
 
Could you please help me out, RehabMan? Uploaded my problem reporting files in my last post. Thanks.
 
Hello. So I just updated to 10.12.4 and as expected, my laptop's brightness control stopped working (it stayed at 100% throughout the slider). I followed this guide, rebooted, rebuilt caches, rebooted again, rebuilt caches again, but I'm not even getting brightness controls anymore, no slider on the Display prefpane either. I must be doing something wrong. Here's my files. Thanks for helping.

Code:
Mhks-MacBook-Pro:RehabMan mhk$  sudo touch /System/Library/Extensions && sudo kextcache -u /
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext AppleBacklightInjector.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext SATSMARTDriver.kext
kext file:///System/Library/Extensions/MotMobileUSB.kext/Contents/PlugIns/MotMobileUSBSwch.kext/ is in hash exception list, allowing to load
kext file:///System/Library/Extensions/MotMobileUSB.kext/Contents/PlugIns/MotMobileUSBLANMerge.kext/ is in hash exception list, allowing to load
kext file:///System/Library/Extensions/MotMobileUSB.kext/Contents/PlugIns/MotMobileMTP.kext/ is in hash exception list, allowing to load
kext file:///System/Library/Extensions/MotMobileUSB.kext/Contents/PlugIns/MotMobileMS.kext/ is in hash exception list, allowing to load
kext-dev-mode allowing invalid signature -67013 0xFFFFFFFFFFFEFA3B for kext AppleMobileDevice.kext
kext-dev-mode allowing invalid signature -67030 0xFFFFFFFFFFFEFA2A for kext AppleHDAHardwareConfigDriver.kext
kext-dev-mode allowing invalid signature -67061 0xFFFFFFFFFFFEFA0B for kext AppleHDA.kext
KernelCache ID: 5204E93F6D439D0D1A00F2F53E98B2AC
Mhks-MacBook-Pro:RehabMan mhk$  kextstat|grep -y acpiplat
   13    2 0xffffff7f83158000 0x60000    0x60000    com.apple.driver.AppleACPIPlatform (5.0) 65E05472-6AE7-3308-8CC8-FA6CB0DB2AEE <12 11 7 6 5 4 3 1>
Mhks-MacBook-Pro:RehabMan mhk$ kextstat|grep -y appleintelcpu
   24    0 0xffffff7f82d6a000 0x2b000    0x2b000    com.apple.driver.AppleIntelCPUPowerManagement (219.0.0) C2841490-D1F6-30D4-AC81-48D63A8FA04C <7 6 5 4 3 1>
   33    0 0xffffff7f82d65000 0x3000     0x3000     com.apple.driver.AppleIntelCPUPowerManagementClient (219.0.0) B802638B-251C-3602-BA8C-001F87228765 <7 6 5 4 3 1>
Mhks-MacBook-Pro:RehabMan mhk$ kextstat|grep -y applelpc
  111    0 0xffffff7f82a3e000 0x3000     0x3000     com.apple.driver.AppleLPC (3.1) F51595F0-F9B1-3B85-A1C3-F984DAD4107E <94 12 5 4 3>
Mhks-MacBook-Pro:RehabMan mhk$ kextstat|grep -y applehda
  107    1 0xffffff7f82e0f000 0x1d000    0x1d000    com.apple.driver.AppleHDAController (278.56) CFB0D0AE-F09A-3660-8F95-7A02FD5FBF07 <106 87 80 12 7 6 5 4 3 1>
  127    0 0xffffff7f82f91000 0xb4000    0xb4000    com.apple.driver.AppleHDA (278.56) A4EB06C9-A40A-39EF-9C4A-D7F23DB9A2F9 <126 107 106 91 87 80 6 5 4 3 1>
  128    0 0xffffff7f82e0b000 0x2000     0x2000     com.apple.driver.AppleHDAHardwareConfigDriver (278.56) 06C594F4-3E5D-3BF4-A783-90C741DAA3F0 <4 3>
Mhks-MacBook-Pro:RehabMan mhk$

Your DSDT has an existing PNLF patch.
As per guide, you must remove any existing brightness/PNLF patch you may have used before and use only SSDT-PNLF.aml.
 
The Clover installer only installs what you ask it to install via "Customize".
It is your responsibility to make sure you have the correct selections there.
Well, in that case I followed your guide and did whatever you wrote there. EmuVariableUefi-64.efi was optional in the guide so I didn't include it but then I needed it with your directive and installed it.

As for RC Scripts I've selected "Install RC scripts on target volume", should I have selected both of them?

- select "Install RC scripts on target volume" and/or "Install all RC scripts on all other boot volumes", but not for USB
- there are also some "Optional RC Scripts" you might want to read about

Also, for Optional RC Scripts, I didn't see anywhere to read about them except the installer and it says
"Disable the mDNSResponder sleep proxy client service. This will prevent the system waking from sleep every hours"
for its only option which is "disable sleep proxy client". Since I have different waking up issue like after laptop sleeps, it wakes up without any display, backlight is on but nothing on the screen, a.k.a blank screen, so, this Optional Script has nothing to do with my case, right?

Your Clover bootlog shows this for backlight-level:
Code:
0:258  0:000   Adding Key: backlight-level: Size = 2, Data: F7 00

Does it correspond to last brightness level you set?

I'm not an engineer, designer instead, so I don't know what that value means, but I can tell by the slider position it should be 30-40% brightness. Does it match with the value of Clover bootlog?

Thanks
 
Well, in that case I followed your guide and did whatever you wrote there. EmuVariableUefi-64.efi was optional in the guide so I didn't include it but then I needed it with your directive and installed it.

EmuVariable only optional if you know your native NVRAM is functional.
Requires testing native NVRAM...

As for RC Scripts I've selected "Install RC scripts on target volume", should I have selected both of them?

The other option only matters if you have multiple boot volumes (eg. different versions of OS X/macOS in separate partitions).

backlight is on but nothing on the screen, a.k.a blank screen, so, this Optional Script has nothing to do with my case, right?

Problems with sleep are off-topic in this thread.

I'm not an engineer, designer instead, so I don't know what that value means, but I can tell by the slider position it should be 30-40% brightness. Does it match with the value of Clover bootlog?

It corresponds to backlight level 0x00f7 (it is byte reversed in the data, aka Intel byte order).
 
Display ID dependencies

Some product/display-IDs as published in EDID present a problem. Although the patches used here will accomplish the correct FxxTxxxx profile selection in AppleBacklight, certain IDs have special case code (somewhere) that cause the backlight to not work.

To fix it, you must inject a patched EDID...

If Clover can automatically detect your EDID, the easy fix is to change your config.plist such that Clover automatically injects a custom EDID with patched product-id. You can use a bogus product ID such as 0x1111. Just set config.plist/Graphics/EDID/Inject=true, and config.plist/Graphics/EDID/ProductID=0x1111.

For some laptops (Sony, Fujitsu, to name a couple of common ones), Clover cannot detect your EDID. You will notice it in your Clover bootlog that detected EDID size is zero. For these laptops you are probably already injecting a custom EDID which you extracted (otherwise your internal display would not work). Simply change the product-id in the EDID data to 0x1111. Although macOS/OS X does not seem to check it, you should also update the checksum of the EDID to match the new checksum after patching.

Note: You cannot patch a custom EDID with the EDID/ProductID setting. That setting is ignored if you're specifying an EDID via config.plist/Graphics/CustomEDID or config.plist/Graphics/EDID/Custom. You must patch the actual EDID data itself.

RehabMan, the info you posted has some wrong information. You can't just use bogus product id. As you can remember from my posts, my original EDID which had bogus ProductID(not Apple one) didn't work. The ProductID you inject must be something that AppleBacklight knows about and 0x1111 is NOT one of them. I tried and it didn't work. I attached IOreg report. As you can clearly see ProductID is set to 0x1111 but brightness settings are not working and correct profile is not selected. Please update your post. 0x9C7C is one of the many ProductID that works. You may also attach or link to my ruby script which allows to set any ProductID you want.
 

Attachments

  • MacBook Pro.zip
    500.5 KB · Views: 201
RehabMan, the info you posted has some wrong information. You can't just use bogus product id. As you can remember from my posts, my original EDID which had bogus ProductID(not Apple one) didn't work. The ProductID you inject must be something that AppleBacklight knows about and 0x1111 is NOT one of them.
...
Please update your post. 0x9C7C is one of the many ProductID that works.

I'll have to look back at what has been written, because I remember you previously wrote that a bogus id (specifically 0x1111) worked! Now you write different... checking...

Yes, here it is, from post #377:
Injected Patched EDID with Bogus Product ID 11111
Result Working

Is what you wrote previously incorrect? Or did something change with your latest attempt?
I assume you meant 0x1111, not decimal 11111 (which is 0x2b67).

I tried and it didn't work. I attached IOreg report. As you can clearly see ProductID is set to 0x1111 but brightness settings are not working and correct profile is not selected.

Actually, this ioreg shows the correct profile *is* selected.

You may also attach or link to my ruby script which allows to set any ProductID you want.

If you want to write a post that clearly explains how to use your script (preferably in a separate thread), I may link to it from post #1. But I have learned you can't expect novices to know how to use a script without clearly written instructions.
 
I'll have to look back at what has been written, because I remember you previously wrote that a bogus id (specifically 0x1111) worked! Now you write different... checking...

Yes, here it is, from post #377:


Is what you wrote previously incorrect? Or did something change with your latest attempt?
I assume you meant 0x1111, not decimal 11111 (which is 0x2b67).

Here is what I said
Injected Native EDID with Product Id (Apple)
Result: Brightness Keys not working. Checked IOReg Product Id is NOT injected using from EDID

Injected Patched EDID with NO Product ID
Result: Working

Injected Patched EDID with Bogus Product ID 11111
Result Working

I said in that thread that without patched EDID, there is no way to make it work. Real ID, Bogus ID, etc doesn't work. Only Apple ID injected by Custom EDID works.

As we proved before, ProductID is ignored and can't be injected by Clover if Custom EDID is used. Therefore if Custom EDID is necessary, Apple Product ID must be injected to custom EDID. I will write separate post. I will appreciate if you can tell me in which section I should put my post. Thanks.
 
Injected Patched EDID with Bogus Product ID 11111
Result Working

So just to clarify, you DID NOT inject ProductID 0x1111 in your EDID in this scenario...

It "worked" because you failed to inject the intended EDID properly. That is you tried to use config.plist/Graphics/EDID/ProductID with config.plist/Graphics/EDID/Custom, assumed that ProductID was working as you thought it should, and did not verify that the EDID you expected to inject was actually injected and did not check that DisplayProductID was 0x1111 as you intended.

So... the faulty injection method for ProductID and lack of checking lead to an incorrect conclusion being posted...
Which then led to what I wrote in post #1 regarding 0x1111.

I will fix post #1 to use 0x9c7c. DONE.
 
Last edited:
So just to clarify, you DID NOT inject ProductID 0x1111 in your EDID in this scenario...

It "worked" because you failed to inject the intended EDID properly. That is you tried to use config.plist/Graphics/EDID/ProductID with config.plist/Graphics/EDID/Custom, assumed that ProductID was working as you thought it should, and did not verify that the EDID you expected to inject was actually injected and did not check that DisplayProductID was 0x1111 as you intended.

So... the faulty injection method for ProductID and lack of checking lead to an incorrect conclusion being posted...
Which then led to what I wrote in post #1 regarding 0x1111.

I will fix post #1 to use 0x9c7c. DONE.

I finished writing the post. It is located at here. If you find any error, please feel free to edit it. Thanks
 
Back
Top