Active Topics

 



Notices


Reply
Thread Tools
dr_frost_dk's Avatar
Posts: 1,503 | Thanked: 2,688 times | Joined on Oct 2010 @ Denmark
#181
Well for me disabling the light sensors role on display light is a very good start, and if an .ini file can be made witch can control the 5 normal steps then go for it, my 4 steps right now are 2, 50, 160, 255 (custom brightness)
2 - for night time reading and not disturbing anybody, like wife sleeping
50 - still for low light settings but easier on the eyes
160 - Normal usage (set 99% of the time)
255 - Very bright sunlight that needs to be drowned out.
 
Posts: 28 | Thanked: 46 times | Joined on Apr 2012
#182
Hi all!
I'm afraid I won't be modding the mce module filter-brightness-als.
I've just now noticed that the source code that was advised here (twice, if you consider my reposting) is for MEEGO mce. Although related, it's NOT the module that is used in Maemo. From an article on a blog (http://cool900.blogspot.co.uk/2009/1...n-maemo-5.html) I gathered that Nokia moved parts of other proprietary software into MCE (I hope that was done in order to open the sources for that other stuff), but as a result MCE was open-source in Diablo but is a proprietary bit in Fremantle. Pity.
This wiki page contains details:
http://wiki.maemo.org/N900_Resources
MCE source code from MeeGo Won't work as-is on Maemo but still useful for reference.
An attempt to match the MeeGo MCE source tree to Fremantle Nothing works yet but it may be a good starting point.
Community SSU git repository, contains re-implementations of some Nokia closed binaries
Unfortunately the CSSU doesn't contain reimplemented MCE sources. At least it's not findable.

It should still possible to do what I have in mind by at least 2 ways
- adapt the MeeGo mce to fremantle. Hard to do since the maemo mce is a black box and it would be really hard to properly test that the replacement is doing everything the original did.
- patch the Maemo MCE binary - basically edit it in hex replacing the bytes that are responsible for brightess thresholds and levels. Considering the circumstances, this should be much easier to do and less risky.
However, I won't be able to do that until I repair my usb port because MCE es an essential part of the phone OS and breaking it would most probably require a reflash, which I can't do at the moment.
For now I'm limited to exploring the binary. Sorry.

Edit: found it! In filter-brightness.als.so, at offset 0x8378, in small endianness, there it is: the struct containing the ambience levels and their corresponding brightness. Will keep you posted.

Last edited by gebeleysis; 2012-04-28 at 21:52.
 

The Following 4 Users Say Thank You to gebeleysis For This Useful 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:
dr_frost_dk's Avatar
Posts: 1,503 | Thanked: 2,688 times | Joined on Oct 2010 @ Denmark
#184
Sounds Awesome, will test when i get the time

Now what about the -simple, can that be made to fit 5 other levels then stock?
 
Posts: 28 | Thanked: 46 times | Joined on Apr 2012
#185
That would be harder to do as in -als I just edited the levels & values (data) but in -simple, as you can remember, there's the algorithm that's different.
Why do you want -simple to have other 5 levels, if you don't mind me asking?
I thought the edited -als already has the levels you need. I think the only difference between these two is that -simple has fixed levels (at 20% intervals) whereas -als flexes according to ambience. Now the edited -als has fixed brightness for levels 2 to 5. THe only one that's still flexible is level 1, and that's because I use my phone a lot as bicycle mounted GPS and find it useless to be backlit in daylight.
Anyway, let me know what you think. It's not hard to make another, personalized -als - a 5 minute job, actually
 
Posts: 153 | Thanked: 81 times | Joined on Dec 2011 @ P town
#186
gebeleysis,
could change the brightness level for me?
for level 1, i find 2 is too low. could you replace 2 with 6?
for level 2, i find 51 is too bright. coulde you change it to 23?
for level 3, i want 51
for level 4, i want 178
for level 5, 255

i don't know how to edit hex.
thank you

Last edited by sLumPia; 2012-04-29 at 12:32. Reason: .
 
Posts: 28 | Thanked: 46 times | Joined on Apr 2012
#187
Here you go, sLumPia.
Mind you that since the values I can edit there are in percent (not in 0-255), there are slight differencies between what you requested and what I did:
Level 1: 3% = 7
Level 2: 9% = 22
Level 3: 20% = 51
Level 4: 70% = 178
Level 5: 100% = 255
Enjoy!

P.S.: As usual, backup your original .so file, be mindful that it's untested and be prepared to reflash.
Attached Files
File Type: zip [sLumPia]libfilter-brightness-als.zip (14.3 KB, 134 views)
 

The Following 4 Users Say Thank You to gebeleysis For This Useful Post:
Posts: 153 | Thanked: 81 times | Joined on Dec 2011 @ P town
#188
thank you gebeleysis
one question, level 1 have fix brightness right? not flexible like your first configuration/patch?
i dont really need flexible brightness

thanks again
 
Posts: 28 | Thanked: 46 times | Joined on Apr 2012
#189
Yes. Fixed brightness
 

The Following User Says Thank You to gebeleysis For This Useful Post:
Posts: 28 | Thanked: 46 times | Joined on Apr 2012
#190
Some funny side effects I noticed with the patch:
If screen is left on more than the backlight time out (mine set to 2 min) it might "fade out" to being actually brighter than the set brightness. I guess the values the screen fades out to are hardcoded somewhere to.
Also, this patch will never set the brightness to lower then 2 (1% of max). It has a stupid check which sets it to 1 if it goes any lower.
 

The Following User Says Thank You to gebeleysis For This Useful Post:
Reply

Tags
brightness, display, light sensor, screen


 
Forum Jump


All times are GMT. The time now is 15:49.