fight the backlight brightness control feature

Posted 28 April 2008 - 06:52 AM

cele_82

InsanelyMac Geek

Members

167 posts

Ok... a lot of people here have the brightness control that doesn't work on their laptop(me to...obvious) but I don't want to continue using programs like Shades and so on... that put a dark mask over your screen... that's not useful if you to work with photo editing.

If you read the posts at the point one you'll that Linux users change the backlight levels using setpci command that write values on PCI register involved with the brightness control. and this it works for them.

also to change PCI register from OSX you can use Reggie SE (from CHUD Tools search them on Apple Developer Site)

Windows Users (search for RW Everything, HWDirect, or PCISCOPE)

Ok, I have a HP laptop 6720s with X3100 and a Acer 3692 with GMA950 all with Leopard.The HP have no backlight control(Fn+F7 F8), the Acer have the backlight control(Fn+Up Down).

I've started with this idea: changing the backlight from PCI register in Windows XP and then test it on OSX, but (maybe I'm not good as you) I've tried and this doesn't work for me.

The Acer have no Acer utility installed and If I change backlight from PCI register D2:F0:F4 it doesn't do anything.The HP has the Quicklaunch buttons installed and like the Acer don't do anything if I change the values, but the interesting thing is that If I remove the quicklaunch button utility (and then reboot) Volume control works but Brightness control doesn't work like in OSX, and if I watch the PCI Register and I change the brightness through the fn+F7 or F8 key I see that the value on register D2:f0:f4 change from 42 to FF (but the backlight remains at 100% like in OSX)If I installed back the Quicklaunch buttons the backlight control starts working normally but I can not see values in the register changing like they do if Quicklaunch is installed.

It seems that values doesn't matter to Quicklaunch buttons app and maybe is ok cause the register is called LEGACY Backlight Brightness and LEGACY to me means something old...

So is there an APP that can watch what QuickLaunch Buttons write in the memory and where so we can track where the true backlight control is located?

Posted 29 April 2008 - 03:16 PM

CommanderData

InsanelyMac Protégé

Members

6 posts

Nice Summary!

In Windows I've written applications to control the display brightness, but it relies on Windows specific APIs like CreateFile ("\\.\LCD",.... and DeviceIoControl. These methods DO work for Windows XP, the brightness range (Min and Max settings) and current brightness can be queried, the actual brightness can be set (as long as it falls within the Min and Max).

Maybe there's someone with more knowledge of what happens after the Windows API calls I mention? What registers are written, and where?

Looking forward to cracking the display brightness issue sometime soon, my battery life could use a boost.

Posted 29 April 2008 - 05:23 PM

CommanderData

InsanelyMac Protégé

Members

6 posts

cele_82, we may be able to trace what is happening with the brightness buttons or my API call samples in Windows using a debugger (like SoftICE) or disassembler (like IDA). I do not have access to those myself at the moment, but someone here might.

Posted 29 April 2008 - 06:41 PM

cele_82

InsanelyMac Geek

Members

167 posts

cele_82, we may be able to trace what is happening with the brightness buttons or my API call samples in Windows using a debugger (like SoftICE) or disassembler (like IDA). I do not have access to those myself at the moment, but someone here might.

thanks for your answer, please tell me how to do it and where to get your program

Another important point

I removed the kexts of my X3100 so I step back using the generic driver of OSX that give me standard resolution 1024x768 but also as you know the backlight control.Using REGGIE SE to modify the PCI register D2:F0:F4 I WAS ABLE TO CHANGE THE BRIGHTNESS OF MY SCREEN the problem is that the X3100 kext load something that block this feature but now I am sure that this register is for the backlight control. Also I can set a lower value of the backlight that FN+F7 keys allow me to set.Like I wrote in the past posts is the same in windows.Some screenshots attached.

Posted 29 April 2008 - 07:19 PM

CommanderData

InsanelyMac Protégé

Members

6 posts

thanks for your answer, please tell me how to do it and where to get your program

Another important point

I removed the kexts of my X3100 so I step back using the generic driver of OSX that give me standard resolution 1024x768 but also as you know the backlight control.Using REGGIE SE to modify the PCI register D2:F0:F4 I WAS ABLE TO CHANGE THE BRIGHTNESS OF MY SCREEN the problem is that the X3100 kext load something that block this feature but now I am sure that this register is for the backlight control. Also I can set a lower value of the backlight that FN+F7 keys allow me to set.Like I wrote in the past posts is the same in windows.Some screenshots attached.

That is very interesting, I have never used Reggie SE. I'll download the CHUD tools from Apple so I can try to do the same thing. My laptop is a Fujitsu P1620 (also have a P1610), both with GMA950 graphics.

The program I wrote for Windows brightness control is kind of tied to the Fujitsu line because it also reads accelerometer feedback to know when you're holding the tablet/laptop. It basically does the multi-step dimming based on lack of user interaction, just like a MacBook would dim, and then later go dark if you leave it alone. It will be a dead end for us in the Mac world.

What seems really odd is the X3100 kext (and possibly the GMA950) must be monitoring that register and setting it back every time you change it. If we could disassemble or get the source for the kext someone might be able to see where it is happening and remove it.

SticMan- off topic but I'd guess his SD reader was on the USB bus in that laptop, rather than an offshoot of the PC Card / PCI bus like it is in mine. Or you could use a PC Card to SD adapter if your PCMCIA slot works.

Posted 29 April 2008 - 07:28 PM

I have a Hp DV6716ez and my Fn F7, F8 keys work!? I have the standard apple Graphics Update loaded for my X1300.

How did you? "Card Reader: Works (tested with SD only)"

SticMAN

"Ok, I have a HP laptop 6720s with X3100 and a Acer 3692 with GMA950 all with Leopard.The HP have no backlight control(Fn+F7 F8), the Acer have the backlight control(Fn+Up Down)."

Stickman if you have you X3100(no generic driver) with full resolution and Quartz acceleration and you have backlight control

Can you please try downloading Reggie SE and changing manually setting the value of the F4 register the backlight of your screen I need to know if it works for you.

Also do this:- send me a copy of your X3100 kexts under extensions folder- send a screenshot of the section GRAPHIC of the SystemProfiler.- check the file system.log for the string that I mention in the first post (also send me the system log)

Please explain what Reggie does BEFORE I load it on my machine!?I hope this helps?

Reggie SE do nothing that can "hurt" your PC, It just change PCI Register Values (that you want) for session that you are using, those changes are not permanent on the next reboot they go away.

So please do what I ask you to do and also can you please:

- Move out the kexts of X3100 from extensions folder (so osx boot with generic driver)- Delete system.log- Test if you have full resolution of the screen, and if the brightness keys are working also test if you can change the value of brightness from Reggie SE and if it works- Send me this system.log

after this move the X3100 kexts in the extensions folder and use disk utility to repair permission and you come back to your original situation.

Finally:- Test if Reggie SE can change the value of brightness of the screen

Posted 09 June 2008 - 10:21 AM

Posted 11 June 2008 - 09:32 AM

jodo

InsanelyMac Protégé

Members

95 posts

I tried my best on this issue. For one moment I thought it was solved - by changing nothing but the AppleIntegratedFramebuffer.kext to an older Version (10.4 I think) from this thread: http://forum.insanel...showtopic=65480

But what I've got then are mouse artifacts. When rolling back to the 10.5 framebuffer, everything is fine, but I cannot control the backlight. Seems that this problem is closely related to the framebuffer.kext...

Posted 14 June 2008 - 08:31 AM

cele_82

InsanelyMac Geek

Members

167 posts

I tried my best on this issue. For one moment I thought it was solved - by changing nothing but the AppleIntegratedFramebuffer.kext to an older Version (10.4 I think) from this thread: http://forum.insanel...showtopic=65480

But what I've got then are mouse artifacts. When rolling back to the 10.5 framebuffer, everything is fine, but I cannot control the backlight. Seems that this problem is closely related to the framebuffer.kext...

Yes jodo... but I think that you have the GMA950 video card.. Am I Wrong? This "trick" is not valid for x3100.

Please someone (I have not time) test what I wrote before... and I write it again:

Requirement: A laptop that have the brightness in Windows controlled by software (like my HP 6720s with QuickLaunchButtons) if the software is loaded Brightness controls work if not... it doesn't work...

Test: We have to debug the application that control the brightness (ollydbg is a good debugger) to find where and what write in memory for changing brightness.

Hopes: Maybe doing the same in the memory registers that make in Windows brightness change works also in Leopard.

I really hope that someone, have the time to do it.. because I have not much time now to do this.

Posted 17 August 2008 - 07:13 AM

cele_82

InsanelyMac Geek

Members

167 posts

I've found another small, but not less important thing.

Take a look at the GMA950 users, in other posts they say using the kext from Leopard(FOR 950) they can't control brightness but using the AppleIntelIntegratedFramebuffer.kext from version 10.4.3 in Leopard the can.

So the first thing is: the 10.4.3 kext was for Mac Mini(without LCD and so without backlight control), then I disassemble the code of the AppleIntelIntegratedFramebuffer.kext(the versions that came with 10.5.4 and 10.4.3) and I clearly see in it, that 10.4.3 have no functions named backlight, but 10.5.4 have function named backlight.

If you take a look at X3100 Framebuffer is the same... has the functions for backlight in it.

So it would be wonderful to "open" the X3100 Framebuffer and remove the backlight functions but HOW TO DO IT?

Here are the ASM code for the two kext mentioned before, so you can see in person what I am talking about...