Jump to content

ACPI Backlight Driver


hotKoffy
 Share

224 posts in this topic

Recommended Posts

Hi,

 

It seems there is some change with OSX 10.7.4 as I've got a KP now with ACPIBacklight kext (it works fine with 10.7.3). Seems that AppleACPIPlatform (in v1.5 now) change something. As someone encounter the same issue ?

 

Fred.

 

P.S.: I need also to revert back to an older AppleACPIPlatform to ensure AppleACPIBatteryManager works again!

Link to comment
Share on other sites

As someone encounter the same issue ?

 

Yeah ... I got a bunch of error messages in Console about missing dependencies right after installing the 10.7.4 update ... I also noticed that I could no longer control the backlight with the hotkeys or the slider ...

 

I have always used the ACPIPlatform kext from Snow since 10.7 (to fix a problem I had with the backlight refusing to turn on after sleep) so I just replaced the one from the update with the old one from Snow ...

Link to comment
Share on other sites

Hi,

 

Yes, I did the same. As i'd got also issues with AppleACPISmartBattery kext... So, there is certainly API change here. Will wait with "old" AppleACPIPlatform until someone is able to fix that (I'm not a developper, sadly :P).

Link to comment
Share on other sites

  • 2 months later...

Hi, i have an All-in-one system with intel HD4000. the display is detected as 1920x1080 connected via displayport, but if IntelFramebuffferCapri.kext is loaded, the monitor goes off (backligh seems to go out too).

 

i am wondering if this isn an ACPI brightness issue, as the panel is LVDS to eDP connected it seems.

 

with no kexts loaded display is fine, also works in windows too so no hardware issue.

 

i tried the injections shown here, but the display is still showing as AppleDisplay instead of AppleBacklightDisplay.

 

also, i've installed this kext but i cannot see any evidence that its loading.

 

i have posted a copy of my dsdt and ioreg here BEFORE adding the injections, so you can see what my DSDT looks like. it lists the _DOS method, whatever that is, but not the others.

 

they are attach to this topic: http://www.insanelymac.com/forum/index.php?showtopic=281275

 

i hope you she some light on this for me!

thanks

Link to comment
Share on other sites

  • 3 weeks later...

Hi hotKoffy,

Thanks for sharing your work. I've almost got it working on an HP 8760w. The brightness slider shows up in preferences, and the Fn + .. keys show the OSD brightness widget. But I can't actually get it to change the brightness of the display. In the console I see the following messages

 

Aug 21 01:28:14 noodle kernel[0]: ACPIBacklightPanel: ACPI Methods _DOS _BCL _BCM _BQC found. Device path: _SB.PNLF
Aug 21 01:28:14 noodle kernel[0]: ACPIBacklightPanel: getIndexForLevel(100) not found in _BCL table !
Aug 21 01:28:14 noodle kernel[0]: ACPIBacklightPanel: Version 1.2

 

I've tried changed the 'BQC use index' property in Info.plist but it doesn't have any effect. Still get the 'getIndexForLevel(100) not found in _BCL table' message. Please could you have a look at the DSDT. It's a bit odd as it never had the _BCL, _BCM, _BQC methods just BCL, BCM and BQC. Also the BCL table seems to be generated rather than a list of predefined values, so I'm not sure I've done the right thing..

 

Cheers,

Tim.

DSDT8760w.dsl.gz

Link to comment
Share on other sites

Hi,

It works on my Lenovo Y550P with Lion 10.7.4 & GeForce G 110M.

Now backlight works using Fn+F11 down and Fn+F9 up.

Is there any way to use Fn+F9 down and Fn+F11 up?

By the way besides new function keys, backlight works using Fn+DownKey down and Fn+UpKey up.

 

Waiting for your comments.

 

Link to comment
Share on other sites

  • 1 month later...

I have other problem with this kext. Brightness bar in System Preferences works well, same as dim after disconnecting AC, but if I try to change brightness with a new combination of keys (Fn+F12 and Fn+Pause) I see the change brightness image but no effect. Anyone have a tip for me?

 

eMachines E730G, Radeon HD 5470, AppleBacklightDisplay loaded, all methods in DSDT exists.

Link to comment
Share on other sites

  • 1 month later...

hello

 

I tried on 10.8.2 :

 

I put my dsdt.aml and ACPIBacklight.kext to restart the brightness and very low and in the application settings the brightness is at a minimum (does this automatically) and in any case if I try to manually raise the brightness remains the same

Link to comment
Share on other sites

hello

 

I tried on 10.8.2 :

 

I put my dsdt.aml and ACPIBacklight.kext to restart the brightness and very low and in the application settings the brightness is at a minimum (does this automatically) and in any case if I try to manually raise the brightness remains the same

 

PLEASE HELP ME

I JUST NEED TO INCREASE BRIGHTNESS !!!!!!

 

CURSOR RUNS BUT THE BRIGHTNESS IS LOW

Link to comment
Share on other sites

Hello.

I'm using AsusK70IO notebook.

But there's no brightness bar in SystemPreferences. Fn Hotkey doesn't work either.

In IORegistryExplorer, my LCD is already built-in and recognized as AppleBacklightDisplay.

Anyone knows why?

In system log, there's an error.

ACPIBacklightPanel: getIndexForLevel(-256) not found in _BCL table !

 

I'm pretty sure I've fixed this in dsdt.

Here's my dsdt. WSY dsdt.dsl.zip

Link to comment
Share on other sites

  • 4 weeks later...

New version 1.2:

  • Added Boolean property in info.plist "BQC use index" to be use if your _BQC returns an index to _BCL entries (not tested)
  • Added an optional DSDT optimization : you can add a method SAVE with same parameters than _BCM and on the same device in order to split the DSDT code that set the backlight value in the PWM control register (usually located in EC) and the DSDT code that save the value in CMOS (usually in the RTC second bank of RAM : OperationRegion (xxxx, SystemIO, 0x72, 0x02) but triggered by a SMI interrupt to ensure CMOS checksum computation)

 

Source: ACPIBacklight.kext_src.zip

 

 

Ciao

I want to tell you my progress.

we are a team trying to use it in the ASUS ROG family.

--> I want to attach my IOREG and my DSDT

 

We tried to manage the DSDT adding a good and complete PNLF to tell to your driver that it has the 4 methods.

those methods attach to GFX0._DOS and GFX0.LCDD._BCM/_BCL/_BCQ

 

in your source I've commented the 1st IF to bypass the pnlf discovering.. in fact if we force the gpuDevice function the slider is more well indexed and point directly to the 1st BCL method.

 

the 1st bcl is in the DPOD device. So I tested it and I've also erased the DPOD device to permit to your kext to attach to LCDD device correctly. which is the 2nd device with BCL method.

 

well..

in those 3 tries (pnlf, DPOD, LCDD) the output is THE SAME

a good slider.. a good verbose log

but no SET brightness

 

this is what i think to be corrected

 

i'm not able to touch that.. but I think the binary is able to work until the SET

i think that because the log in the debug version is showing all the important thing we can see to verify that

it can invoke the gpu.. discover the methods.. initialize the index.. initialize the bat

 

but .. the routing shows the SET bcm .. when I move the slider. without success.

so the only think in my mind is that either the BCM is not good.. or the BCM is linked in the wrong device in DSDT.. or the routine is bad.

my dsdt has 2 bcm.. but those are equal and invokes the same external method.

remains the bcm itself in the dsdt.. so in ubuntu or windows I cannot test it with a slider.. but I can test the ATKD fn+ keyboard buttons. and they works.

 

remains the routine

void ACPIBacklightPanel::setACPIBrightnessLevel(UInt32 level)
{
   DbgLog("%s::%s()\n", this->getName(),__FUNCTION__);

OSObject * ret = NULL;
OSNumber * number = OSNumber::withNumber(level, 32);

if (kIOReturnSuccess == backLightDevice->evaluateObject("_BCM", &ret, (OSObject**)&number,1))
   {
if (ret)
 ret->release();

DbgLog("%s: setACPIBrightnessLevel _BCM(%u)\n", this->getName(), (unsigned int) level);
   }
   else
    IOLog("%s: Error in setACPIBrightnessLevel _BCM(%u)\n", this->getName(), (unsigned int) level);
}

 

ah.

another question:

and I discovered that if i have the ACPICodec.dylib

in the Modules folder of Extra (Chameleon module)

the acpibacklight is not loaded..

Archivio.zip

Link to comment
Share on other sites

  • 2 months later...

Hi, everyone!

 

I have load the ACPIBacklight Driver, and I can adjust the brightness through the slide bar, but I still have some problem:

 

1.Can't store brightness level, it will set to 100% when reboot.

2.Keyboard control is not working, it just display the sun, but no value changing.

 

Anybody can help ? Thanks!!

 

---------------------- Log --------------------------

 

ACPIBacklightPanel: Found Backlight Device: LCD0
ACPIBacklightPanel: ACPI Method _DOS found. Device path: _SB.PCI0.GFX0
ACPIBacklightPanel: ACPI Methods _BCL _BCM _BQC found. Device path: _SB.PCI0.GFX0.LCD0
ACPIBacklightPanel: Version 1.2

 

------------------------- My DSDT -----------------------

 

Method (_BCL, 0, NotSerialized)
{
Return (Package (0x0A)
{
0x1C,
0x0E,
Zero,
0x0E,
0x1C,
0x2A,
0x38,
0x46,
0x54,
0x64
})
}
Method (_BCM, 1, NotSerialized)
{
If (LEqual (Arg0, Zero))
{
Store (Arg0, ^^^LPCB.EC.OEM2)
}
Else
{
Divide (Arg0, 0x0E, Local0, ^^^LPCB.EC.OEM2)
}
If (^^^LPCB.EC.ECOK)
{
Add (^^^LPCB.EC.OEM2, 0xE0, \_WMI.EVNT)
Notify (WMI, 0xD0)
}
}
Method (_BQC, 0, NotSerialized)
{
If (^^^LPCB.EC.ECOK)
{
If (LEqual (^^^LPCB.EC.OEM2, 0x07))
{
Return (0x64)
}
Multiply (^^^LPCB.EC.OEM2, 0x0E, Local0)
Return (Local0)
}
Else
{
Return (0x1C)
}
}

Edited by Macrow_wh
Link to comment
Share on other sites

  • 2 weeks later...

Just upgraded to 10.8.3 from 10.7.5 and noticed brightness control is broken when using shortcut keys, slider in preferences pane works well though.

Any comments on this?

 

Yep. Noticed this too ..

 

Brightness increase stops halfway through and then refuses to decrease with the hotkeys ... :worried_anim:

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

For the sun bezel to work on 10.8.4, I needed the brightness values to range from 0x000 to 0x400. Sadly, my BIOS can only handle 11 levels (0x0 to 0xA). To fix this, I patched your awesome kext to present 0-0x400 to the OS and then convert to levels internally. Now, the sun bezel works for my laptop :)

 

kext and source attached

 

Thanks again for your work in creating this kext :)

 

NOTE to others: This kext is intended to fix the problem where the brightness slider already works, but pressing the function keys will only show the sun, not change the brightness.

ACPIBacklight Source.zip

ACPIBacklight.kext.zip

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Hi!

 

So I put this into my ML install by side-loading it via injectKext in Clover (.../CLOVER/kext/10.8(). It did load properly, but now when I change my brightness, it doesnt change at all x). I didn test if it is my emulated NVRAM, but that shouldnt be a cause O.o

 

Any help would be great. My DSDT is patched with PNLF.

Link to comment
Share on other sites

So I just ran thru the forst of messages, and Now i realized my issue...the injector-code. I absolutely have NO CLUE where to put it X3. I know the method, but when I compile, I get a "already exists" error. >.>... Gonna try the patched version up there real quick since I hae the same issue, mayby by some magic it makes my brightness work.

 

Besides. I am able to change my brightness without the driver, however...it says its on maximum, but its horribly dark. Only when my screen sleeps and comes back, THEN it suddenly becomes all normal (or better said, bright) again... waaaat o.o".

 

It seems though that my emulated NVRAM does a nice trick and saves my brightness level! ... but, it doesnt affect the hardware, booo. v.v

 

Ill attach my DSDT later.

 

Edit:

Weeeeell, here we go!

Sony Vaio Duo 11 (SVD1121X9EB) [Pre-Patched]

Edited by Ingwie Phoenix
Link to comment
Share on other sites

  • 3 months later...

Hi there...i tried the kext and dsdt fixes and didnt work 100%

The slider working with 10 steps fine (when i move it my backlight change) but when i press keyboard key the sun comes on lcd with true indicator but cant change the brightness value.

 

Also up key  (F1) working when slider is on 50% for one time and down key (F2) working only if sider is at 40% also for one time.

i tried many thinks on _BCM method without success.
 

When system fails to change brightness the system log outputs:
 

Dec 14 12:21:43 HackBook-Pro.local BezelServices 240.49[55]: ASSERTION FAILED: "Could not set brightness" -[DisplayStateMachine changeBrightnessBy:type:] line: 576

My laptop is Acer 4741G (i5, GT 330m)

Everything working except brightness control.

 

Zip file contains clean dsdt (fixed some errors for compiing and some warnings) and pathed dsdt.

 

*** PROBLEM FIXED.
if u have the same problem with me download patched kext in page7 from fxtentacle.

guys you are aweoseme THANKS.
 

4741G - DSDTs.zip

Link to comment
Share on other sites

  • 2 weeks later...

I have created my own fork of this code. Thought I would post to the original thread here...

 

Highlights:

- Smooth transitions, just like a real MacBook[Pro/Air]

- Ability to set levels between those called out by _BCL (must implement XBCM/XBQC in DSDT/PNLF device)

- Saving previous value to NVRAM for restoration between restarts (eg. fake NVRAM as supported by Clover/Chameleon)

- various bug/memory leak fixes

 

I started with 1.2 from hotKoffy, added the changes by fxtentacle, and then did my own changes, such that the development history is retained. Hopefully I didn't introduce too many new bugs...

 

The sources and more information are available here: https://github.com/RehabMan/OS-X-ACPI-Backlight

 

Note: I still have some cleanup and code review to do.

 

Note also: For examples of the DSDT patches required to access hardware registers directly and example implementations of XBCM/XBQC see the ProBook DSDT patches at: https://github.com/RehabMan/HP-ProBook-4x30s-DSDT-Patch

  • Like 3
Link to comment
Share on other sites

I'm having some problems with my laptop backlight (Mavericks). Everything works ootb, backlight dimming when unplugging AC, hotkeys and so on. Only problem is that the backlight slider is at about 80% when backlight is at max. If I set it to 100%, it is again about 80% after reboot and lower if on battery.

 

I guess RehabMans kext and the DSDT fix would solve it but since everything else seems to work with native driver, I was wondering if there is just a simple DSDT fix for the low backlight?

Link to comment
Share on other sites

I'm having some problems with my laptop backlight (Mavericks). Everything works ootb, backlight dimming when unplugging AC, hotkeys and so on. Only problem is that the backlight slider is at about 80% when backlight is at max. If I set it to 100%, it is again about 80% after reboot and lower if on battery.

Is that using ACPIBacklight.kext or the native Apple kext?

 

I guess RehabMans kext and the DSDT fix would solve it but since everything else seems to work with native driver, I was wondering if there is just a simple DSDT fix for the low backlight?

ACPIBacklight prior to my version did not save the state of the backlight across reboots (unless you're able to figure out how to write a SAVE method that writes to your native nvram). My version writes/restores the backlight level using OS X "fake NVRAM". The additional DSDT patches allow you to access the entire range of brightness (and control individual levels), allow smooth transitions between brightness levels, and fix problems where the backlight doesn't work prior to display sleep/wake.

 

If you're happy with the way the native Apple backlight driver works, you can just use it. Backlight levels will be restored, provided you force a sleep/wake cycle on your display (use 'blinkscreen' from the ProBook Installer) and you have some solution to nvram in play (eg. FileNVRAM for Chameleon, or using the RC scripts in Clover).

Link to comment
Share on other sites

 Share

×
×
  • Create New...