FORUMS
Remove All Ads from XDA

[Kernel Module] Backlight: Lower Brightness (Useful at Night)

115 posts
Thanks Meter: 45
 
By mikstev, Senior Member on 9th May 2012, 12:48 PM
Post Reply Email Thread
(dev only for now, you need to know how to install/load a kernel module by hand/write a init.d script for it)

Hi,
I was annoyed by the too bright backlight especially at night. Even the lowest (non-zero) setting was too bright for me (see my thread in general section).
Thanks to irfanbagus BCM-TWEAK which I could easily adapt here's kernel module to lower the lowest brightness. This means that only the former lowest mode is changed to an even lower brightness, the other modes remain the same.
I've attached a kernel module for this incl. source (based on irfanbagus' source, say thanks to him ).
After loading this module you can simply use the system backlight setter to dim the backlight. In case it was already set to lowest brightness, simply increase the brightness and then decrease it again to apply the updated mode.
This doesn't work with GO Launcher's setting widget's backlight setter and probably also not with other 3rd party backlight setters.
If you test it, please report.

More details about backlight/brightness (see aat1401_bl.c in kernel source if you're interested):
- brightness level is a value in [0,255] (most apps map this to [0,100]%)
- in fact there're just about 25 different brightness levels which a stored in a table, each entry has a 'level' and a 'tune_level' value
- the tune_level (>0) determines the brightness: low level low brightness, high level high brightness
- there's a "lowest" level (30) but only the system setter respects this. This level's tune_level is changed by my kernel module to 1 instead of 2
- system's brightness setter allows no level below 30 thus my mod works good with it
- other setters allow levels below 30 and here is the problem:
The responsible module for setting the backlight brightness looks at the level value in [0,255]. If it's below 30 then a default tune_level of 2 is used.
The GO Launcher widget probably simply sets the level to 0.
I don't know a way to change this default tune_level in a already compiled/running kernel.
So if you want to use another setter, make sure to choose level 30 or about 12% because then my updated tune_level will be used. Usually 12% should map to level 30. If not, I can't help you. Use system setter instead.
Btw to switch backlight off (warning, not recommended) you can use the direct way: echo 0 > /sys/class/backlight/aat1401-backlight/brightness
Attached Files
File Type: zip bl_brightness-tweak.zip - [Click for QR Code] (10.9 KB, 934 views)
9th May 2012, 01:59 PM |#2  
OP Senior Member
Thanks Meter: 45
 
More
Found a widget which allows custom brightness values and works fine with my mod: Brightness Widget - Backlight!
Tested with this settings: 30,1,150,255
9th May 2012, 02:02 PM |#3  
ronnieryan's Avatar
Senior Member
Flag Dumaguete
Thanks Meter: 952
 
More
i am using switch pro widget..range from

0% ----> 100%
9th May 2012, 02:04 PM |#4  
OP Senior Member
Thanks Meter: 45
 
More
Quote:
Originally Posted by ronnieryan

i am using switch pro widget..range from

0% ----> 100%

0% = no backlight?
Anyway, with my mod you'd have the lowest brightness at 12%.
9th May 2012, 02:11 PM |#5  
ronnieryan's Avatar
Senior Member
Flag Dumaguete
Thanks Meter: 952
 
More
Quote:
Originally Posted by mikstev

0% = no backlight?
Anyway, with my mod you'd have the lowest brightness at 12%.

yes, 0% no backlight, but its so inconvenient ..10% is better
9th May 2012, 02:20 PM |#6  
OP Senior Member
Thanks Meter: 45
 
More
Interesting, I'll have a look.
Edit: As far as I see this widget doesn't require root. Even if it could disable backlight (I'm not sure if this is possible) its lowest non-zero brightness is higher than with my mod.
11th May 2012, 04:05 AM |#7  
Senior Member
Sa Puso Mo
Thanks Meter: 26
 
Donate to Me
More
how can i use this sir?
11th May 2012, 07:14 AM |#8  
OP Senior Member
Thanks Meter: 45
 
More
Quote:
Originally Posted by nakawanaoki

how can i use this sir?

1. Copy the .ko file to /system/lib/modules
2. Set the file permissions to 644
3. Install the module via insmod bl_brightness-tweak.ko (you can also use a init.d script for this, you can adapt the one I uploaded in the droidwall thread)
26th November 2016, 08:25 AM |#9  
Senior Member
Thanks Meter: 4
 
More
I am not sure why,
but on trying to turn off screen with "echo 0" it is only get darker, but not completely off.
Is there any way to really turn of screen ?

Thank you,
Ranchu
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes