View Single Post
Posts: 28 | Thanked: 46 times | Joined on Apr 2012
#183
Victory is ours, lads!
Attached is the patched libfilter-brightness-als.so
Mode of installation (manual):
0. Make sure you've uninstalled dr_dk_frost's the custom brightness. If you don't - nothing terrible will happen, you just won't see any change. Also be mindful as this has not been thoroughly tested yet. YOU COULD BRICK YOUR DEVICE!
1. BACKUP YOUR ORIGINAL FILE!!
Code:
$ sudo cp /usr/lib/mce/modules/libfilter-brightness-als.so /usr/lib/mce/modules/libfilter-brightness-als.so.backup
2. Copy the attached file to your phone and unzip it there
Code:
$ unzip libfilter-brightness-als.so.zip
2. a. Obvious alternative: download the zip file to your PC, unzip it there and copy the contained .so to the n900 from there
3. If you're sure you've backed up the original module, go ahead and overwrite it with the modified one. First go to the folder containing the downloaded .so file. Assuming it was to your home folder:
Code:
$ cd
$ sudo cp libfilter-brightness-als.so /usr/lib/mce/modules
4. Restart MCE. This will make it load the new module:
Code:
$ sudo killall mce
at this point you should probably see a change in screen brightness, but not necessarily.
5. To check that it is working, do the following:
- set display brightess to bright (level 4) (through system settings, of course)
- on the n900 open a console and type
Code:
$ cat /sys/class/backlight/acx565akm/brightness
- this should have output a number. If it's 158 then it's done! Otherwise - something went wrong. Double-check that the correct module is in /usr/lib/mce/modules and check that /etc/mce/mce.ini loads the filter-brightness-als module correctly.
6. For your convenience install the Simple Brightness Applet.
Code:
$ sudo apt-get install simple-brightness-applet
How it should work:
Level 1 (Minimum): should be at brightness 2, 12, 25 in ambiences lower than 17600 lux (use the Luxus widget and the above command to check). At ambiences brighter then that - screen should go to 0 brightness. I believe the transflexiveness of the screen should render it readable anyway.
Level 2 (Economy): A stable 20% brightess for all ambient levels. This translates to 51 on the 0-255 scale.
Level 3 (Normal): stable 30% or 76 on the 0-255 scale.
Level 4 (Bright): stable 62% or 158 on the 0-255 scale.
Level 5 (Maximum): no change from original version. Stable 100% or 255 on the 0-255 scale.

Unfortunately, there's no automatic install, .deb package or repository entry yet. Maybe some day.
Unfortunately, there's no user configurable levels (and not likely to be), but the hardcoded levels should satisfy most.
On the bright side, keyboard backlight is unaffected and should turn off when there's enough ambient light.

Dr_dk_frost, I believe your brightness levels requirements are met.

For those that don't like running binaries downloaded from the internet, here's the patch method:
1. The usual uninstall custom_brightness and backup the original libfilter-brightness-als.so
2. In a hex editor open the original module.
3. Go to byte 0x8378. This should be something like
18 00 00 00 20 00 00 00
This is the start of the ambience/brightness structure. Bytes 0x83A0 to 0x83B3 hold the brightess values (in percent, in small endian (first byte is the least meaningfull one)) for Level 1.
4. If you've gotten this far - you should know how to change the rest. (if someone knows how to paste a binary patch on the forum then please let me know )
5. Restart MCE and enjoy.

I'll update later with an automatic patch method and other good stuff.
If someone needs other brightess levels, I can generate a personalized patch (or do it yourself using method 2).
Attached Files
File Type: zip libfilter-brightness-als.so.zip (14.3 KB, 263 views)

Last edited by gebeleysis; 2012-04-30 at 10:46.
 

The Following 14 Users Say Thank You to gebeleysis For This Useful Post: