[How to] Adjust auto-brightness on GB Sense ROM - Desire Android Development

with the new snq- GB sense kernel we have some more auto-brightness levels available and we can adjust these levels in Framework-res.apk :
i'm not sure others GB SENSE kernel will works.
it's sure it works with DEODEX roms but it works to on my BravoS V7 ODEX Rom, so test by yourself and never forget to make a nandroid backup before flashing anything !
link for the snq- kernel working with this mod, all others will works to :
http://forum.xda-developers.com/showpost.php?p=17688555&postcount=644
How to :
At first, i'm not responsible for your problems. it worked well for me.
I will only explain with the use of APKManager but you can do it with all apk compiler decompiler.
at least i forgot to say that you can use a moded framework from UOT to do the trick.
the better way for me is to do your UOT mods before tweaking the sensor levels.
if you tweak you famework before doing UOT mods, framework-res.apk will be much bigger, probably due to a lower zip compression level with UOT.
1 - install APKManager,
2 - place Framework-res.apk from your ROM in the \apkmanager\place-apk-here-for-modding\ folder,
3 - launch Script.bat, a cmd prompt window will apear,
4 - type 22 and choose your framework-res.apk,
5 - type 9 for decompiling, when done your decompiled framework-res.apk files
are in \apkmanager\projects\ folder,
6 - minimize apkmanager window,
7 - go in \APKmanager\projects\framework-res.apk\res\values\ and edit arrays.xml,
8 - search for this : (exemple with BravoS V7 framework)
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>87</item>
<item>87</item>
<item>87</item>
<item>87</item>
<item>136</item>
<item>174</item>
<item>194</item>
<item>214</item>
<item>234</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesUp">
<item>87</item>
<item>87</item>
<item>87</item>
<item>87</item>
<item>136</item>
<item>174</item>
<item>194</item>
<item>214</item>
<item>234</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesDown">
<item>87</item>
<item>87</item>
<item>87</item>
<item>87</item>
<item>136</item>
<item>174</item>
<item>194</item>
<item>214</item>
<item>234</item>
<item>255</item>
Click to expand...
Click to collapse
*** Here you can modify the values for backlight :
- Do not change "config_autoBrightnessLevels" before
- you can modify "config_autoBrightnessLcdBacklightValues" / "config_autoBrightnessLcdBacklightValuesUp" / "config_autoBrightnessLcdBacklightValuesDown" with your own values between 0 an 255.
40/45 is a good start point for indoor use
personally I use these :
41
55
72
87
121
141
161
201
231
255
--------------------------------------------------------------------------------------------------------------
<integer-array name="config_autoBrightnessButtonBacklightValues">
<item>255</item>
<item>255</item>
<item>255</item>
<item>255</item>
<item>-1</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
</integer-array>
<integer-array name="config_autoBrightnessKeyboardBacklightValues">
<item>255</item>
<item>255</item>
<item>255</item>
<item>255</item>
<item>-1</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
Click to expand...
Click to collapse
*** OPTIONAL : Here you can modify the keyboard backlight on/off :
- the four first 255 says "led on" for the corresponding levels, the -1 value say "led turn off" for the corresponding level.
9 - save changes for arrays.xml,
10 - return to APK manager window,
11 - type 11 for recompiling apk
- is this a system APK : y
- Aside from the signature ... : y
-remove resources.asrc from \apkmanager\keep\ folder then return to apkmanager window and press a key.
12 - type 22 an select unsignedframework-res.apk,
13 - type 5 and zipalign,
14 - type 24 to exit : DONE.
now rename unsignedframework-res.apk to framework-res.apk and you get your moded file!
for pushing the new framework-res.apk i use a existing zip file and flash it with recovery :
these come from Acesmod007, please do not flash this without any changes !
- for Stock Hboot : http://dl.dropbox.com/u/22617624/Android/lumisense/Framework-Stock.zip
- for CM7 Hboot : http://dl.dropbox.com/u/22617624/Android/lumisense/Framework-CM7.zip
open it with and replace framework-res.apk in the zip file by yours in /framework/ folder for Stock and /sdext/framework_s/ folder for CM7.
put your zip in your sdcard, reboot into recovery
!!!!! always make a nandroid backup before flashing !!!!!
then flash your zip.
you can wipe dalvik but it seems it will works without.

tnx bro for the info ...

Great guide. Many thanks

Great post..Thanks a lot..Added these to the latest Supernova

Isn't that quite the same as this one: http://forum.xda-developers.com/showthread.php?t=1034743
That's where I learned how to mod autobrighness. and that's actually where I discovered that there is something wrong with the desire and started looking for the problem.
Thanks anyway... Now we have a guide in the desire section as well.
Just a few remarks:
I personally have the hardware keys only lid on the lowest level - meaning when there is absolutely darkness.
Further, the values for up and down should be adjusted accodingly but (IMHO) should not be the same as the brightness levels. The reason is, that those values are there to get smother changes (kind of hysteresis).
So e.g. If you are on the lowest level and the sensor driver signals the next higher level, the value for up should be between the current and the next brightness setting. Don't know if it even works but I think that is how it is supposed to be.

i'm showing only what i saw in BravoS framework.
the 3 sections have same values, I'll test with other rom.
EDIT // you're right :
for 3d AceS :
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>81</item>
<item>81</item>
<item>81</item>
<item>112</item>
<item>143</item>
<item>163</item>
<item>186</item>
<item>208</item>
<item>231</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesUp">
<item>81</item>
<item>81</item>
<item>128</item>
<item>163</item>
<item>163</item>
<item>163</item>
<item>186</item>
<item>208</item>
<item>231</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesDown">
<item>81</item>
<item>128</item>
<item>163</item>
<item>163</item>
<item>163</item>
<item>186</item>
<item>208</item>
<item>231</item>
<item>255</item>
<item>255</item>
Click to expand...
Click to collapse
will test for these values.

Well, I just remembered.. I tested once and never saw the values for up and down but only the "common" brightness values.
I logged that to a text file "cat /sys/... " so I could see at which sensorlevel, adb value and time the brightness was applied.
But better you test as well. Maybe I was somehow wrong in the first place.
/edit: for the record: this should work for froyo as well. Atm without all sensor levels. But it wouldn't require that much to build a froyo kernel with the driver mod/fix.
Sent from my HTC Desire using xda premium

I'm quite sure to have seen values from up and down arrays... I just use catlog and filter by "bright"... But I didn't know when did they were used, and why...
bye!

In my opinion, the up and down values are used to set smoother brightness changes. I think , HTC didn't set them very well. I tried to adjust them a bit and think, its better now (see my sig, autobrightness mod, dark+_Lee3.3.x)
I always use apktool to decompile apk's, its a commandline tool and in my opinion better to handle as the available gui's.
Sent from my HTC Desire using XDA App

Thanks will try ..lol

anderl78 said:
In my opinion, the up and down values are used to set smoother brightness changes. I think , HTC didn't set them very well. I tried to adjust them a bit and think, its better now (see my sig, autobrightness mod, dark+_Lee3.3.x)
I always use apktool to decompile apk's, its a commandline tool and in my opinion better to handle as the available gui's.
Sent from my HTC Desire using XDA App
Click to expand...
Click to collapse
Thanks. Yo've answered in some way my yesterday PMs to you...
And yes, I also use apktool to decompile and compile/zipalign back... I use apkmanager DOS GUI.
bye!

PeQuEsan said:
Thanks. Yo've answered in some way my yesterday PMs to you...
And yes, I also use apktool to decompile and compile/zipalign back... I use apkmanager DOS GUI.
bye!
Click to expand...
Click to collapse
I never been lucky using those scripts. So I prefer using apkmanager and zipalign from the command line - just like anderl78
However, seems to work for you so why shouldn't you...
Sent from my HTC Desire using xda premium

... use what you want, all are using apktool.jar and the same tools from adb.
you can do the job with another tool of your choice.
The purpose of this topic is to show how to optimize the three levels that did not exist in previous kernels.
at least i forgot to say that you can use a moded framework from UOT to do the trick.
the better way for me is to do your UOT mods before tweaking the sensor levels.
if you tweak you famework before doing UOT mods, framework-res.apk will be much bigger, probably due to a lower zip compression level with UOT.

@t-minik
Nice guide...
Did you find a way to adjust Camera's backlight..?
Every time the Camera app launches, the screen's backlight always turn up the brightness substantially...
If this can be adjusted, then it will be a perfect complimentary...

NeoEpsilon said:
@t-minik
Nice guide...
Did you find a way to adjust Camera's backlight..?
Every time the Camera app launches, the screen's backlight always turn up the brightness substantially...
If this can be adjusted, then it will be a perfect complimentary...
Click to expand...
Click to collapse
+1 *10chars*
ToM

I really don't know how to change this and i'm not skilled for. sorry

NeoEpsilon said:
@t-minik
Nice guide...
Did you find a way to adjust Camera's backlight..?
Every time the Camera app launches, the screen's backlight always turn up the brightness substantially...
If this can be adjusted, then it will be a perfect complimentary...
Click to expand...
Click to collapse
Some follow-up...
I didn't find anything in the framework...
But decompiling HTCCamera.apk, and looking at smali's did show something...
It seems that it call's setMaxBrightness (), in almost all activity...
I always felt it increases the backlight, but quite surprised that it's set at MAX...
So...
Anyone experienced in smali's..?
Which line is save to delete/edit to prevent this backlight maxing out..?
Thanx in advance...
---------- Post added at 06:52 PM ---------- Previous post was at 06:52 PM ----------
t-minik said:
I really don't know how to change this and i'm not skilled for. sorry
Click to expand...
Click to collapse
Oops...
Missed your post...

NeoEpsilon said:
Some follow-up...
I didn't find anything in the framework...
But decompiling HTCCamera.apk, and looking at smali's did show something...
It seems that it call's setMaxBrightness (), in almost all activity...
I always felt it increases the backlight, but quite surprised that it's set at MAX...
So...
Anyone experienced in smali's..?
Which line is save to delete/edit to prevent this backlight maxing out..?
Thanx in advance...
---------- Post added at 06:52 PM ---------- Previous post was at 06:52 PM ----------
Oops...
Missed your post...
Click to expand...
Click to collapse
Is there a point for this?
Its even hard to see now when you taking photos outside during sunlight.
Most of the times i shoot photos half blind on screen, and if you reduce this value most of the times you wont see NOTHING outside...

ivicask said:
Is there a point for this?
Its even hard to see now when you taking photos outside during sunlight.
Most of the times i shoot photos half blind on screen, and if you reduce this value most of the times you wont see NOTHING outside...
Click to expand...
Click to collapse
Well my case got this flap that covers the screen...
In landscape mode, it doubles as a sun visor...
So fine for me, and maybe others who prefer some options...
Especially if it can utilize the setting from auto-brightness...

I'll bring this back up, this is a good mod, used it on my glacier and now my sensation. Works great, stock values suck.

Related

[MOD/FIX] Enable all light sensor levels in Sense Kernels and Frameworks

This MOD/FIX is only for Sense Kernels and ROMs/Frameworks
This is only for Kernel and ROM developers. (And maybe some framework tweakers.)
If you wan't to make use out of it, ask your favorite ROM and7or kernel developer.
The mod I describe here, should work with GB as well as Froyo (Desire/Bravo of course).
At first, big thanks to snq- for implementing the kernel mod and making it available for testing and further development.
Thanks to Leedroid for his great ROM in which I am using this MOD/FIX.
Further, thanks to anderl78 for pointing me to adjust the autobrighness in the framework and to sloppy for providing the howto on how to actually change the brightness in the framework.
Big thanks to ivicask who actually patched services.jar to make autobrightness together with the fixed/improved sensor driver work like a charm (see here and here)
If I forgot someone, just let me now.
So as many of you who like to use the autobrightness setting to automatically get the best brighness setting in every light condition I was not quite happy with the way HTC implemented it. Reason for that is, that the autobrightness in the stock framework was at far too high levels leading in to bright screens and unnecessary battery drain.
I will describe both changes in the Kernel and one (optional but recommended) mod in android itself - namely services.jar.
Let's start with the Kernel:
Kernel Mod:
While adjusting the values in the framework and during some testing I realized that not all sensor levels stated in the framework are reported by the lightsensor driver. Most importantly, Level 0 (which refers to absolutely darkness) was never reported by the driver. This made me look into the kernel sources and I finally found a solution.
I will not go into detail and explain the code for you. Every kernel developer should be able to understand and to follow the changes I provide.
First of all, the lightsensor driver uses a loop to report lightlevels for a range of sensor raw data. The lightsensor driver can be found in drivers/input/misc/cm3602_lightsensor_microp.c. In order to make the mod work, there would actually no need in changing the driver itself. But snq- provided a change that makes it even more simple.
Original Code: (drivers/input/misc/cm3602_lightsensor_microp.c)
Code:
static int get_ls_adc_level(uint8_t *data)
{
[B]...[/B]
for (i = 0; i < 10; i++) {
if (adc_value <=
li->ls_config->levels[i]) {
adc_level = i;
[I][B]if (li->ls_config->levels[i])
break;[/B][/I]
}
}
ILS("ALS value: 0x%X, level: %d #\n",
adc_value, adc_level);
data[2] = adc_level;
}
[B]...[/B]
}
Changed Code: (drivers/input/misc/cm3602_lightsensor_microp.c)
Code:
static int get_ls_adc_level(uint8_t *data)
{
[B]...[/B]
for (i = 0; i < 10; i++) {
if (adc_value <=
li->ls_config->levels[i]) {
adc_level = i;
[I][B]break;[/B][/I]
}
}
ILS("ALS value: 0x%X, level: %d #\n",
adc_value, adc_level);
data[2] = adc_level;
}
[B]...[/B]
}
Now for the "real" kernel tweak:
The lightsensor values are stored in the bravo board file: arch/arm/mach-msm/board-bravo.c
Original Code: (arch/arm/mach-msm/board-bravo.c)
Code:
static struct microp_function_config microp_lightsensor_function = {
.name = "light_sensor",
.category = MICROP_FUNCTION_LSENSOR,
[B][I].levels = { 0, 0x21, 0x4D, 0xDC, 0x134, 0x18D, 0x1E5, 0x3FF, 0x3FF, 0x3FF },[/I][/B]
.channel = 6,
.int_pin = 1 << 9,
.golden_adc = 0xC0,
.ls_power = capella_cm3602_power,
};
Changed Code: (arch/arm/mach-msm/board-bravo.c)
Code:
static struct microp_function_config microp_lightsensor_function = {
.name = "light_sensor",
.category = MICROP_FUNCTION_LSENSOR,
[B][I].levels = { 0x04, 0x21, 0x4D, 0xDC, 0x134, 0x18D, 0x1E5, 0x280, 0x340, 0x3FF },[/I][/B]
.channel = 6,
.int_pin = 1 << 9,
.golden_adc = 0xC0,
.ls_power = capella_cm3602_power,
};
I changed the values again (just took the ones from bravoc which has all levels defined) to the following - which is working great:
Code:
static struct microp_function_config microp_lightsensor_function = {
.name = "light_sensor",
.category = MICROP_FUNCTION_LSENSOR,
[B][I].levels = { 0, 10, 15, 21, 60, 209, 362, 488, 560, 0x3FF },[/I][/B]
.channel = 6,
.int_pin = 1 << 9,
.golden_adc = 0xC0,
.ls_power = capella_cm3602_power,
};
the final code - especially the lightsensor driver - looks a little bit different (few more tweaks).
They are implemented in snq-'s current kernel and from what I've seen even in bananacakes and tristans...
Those changes enable level 0 (since it is no longer skipped from the driver) and enables levels 7 to 9 (since 0x3FF is the last one and the previous ones are adjusted to lower values).
So, if you have a kernel with the changes implemented you can easily verify with
Code:
cat /sys/devices/i2c-0/0-0066/ls_adc
(and proper light conditions) all sensor levels from 0 to 9 are reported. You can even use a sensor app to verify that all light levels are reported (in lux within those apps).
Here comes the first and (in my opinion) only downside:
I have no idea if HTC implemented the driver the way they did by purpose. And I have no idea if the new reported sensor values in any way report the "right" lux values for the environment brightness. But I actually do not care about that, because I can adjust the framework and do not rely on exactly reported lux values (which is anyway only possible in a quite large range between the levels).
Framework:
Now for the framework / android:
I was quite happy to have all sensor levels enabled. And with proper adjusted autobrightness levels in the framework (framework-res.apk) it works quite well.
I adjusted my framework to tweak the values a little bit further (especially to have the screen quite dimmed in low light conditions). I tried to verify my changes with simply logging sensor data and screen brightness. I do this with a simple script:
Code:
#!/bin/bash
#
while :
do
sleep 1
echo.
adb shell cat /sys/class/leds/lcd-backlight/brightness
adb shell cat /sys/devices/i2c-0/0-0066/ls_adc
done
The script showed me, that even with all levels being reported, the value I set for the lowest level was not applied if you wake up the screen. On screen wakeup, what I saw was either the value for level one, or the maximum brightness (this only happens if you turn off and on again very quickly using the power button). Further, without changines in the environmental light conditions, no new values were applied. This is still annoying if you get max brightness in the middle of the night. Fortunately I was not the only one with that experience. The solution seems to be the (maybe poorly implemented) services.jar in the desire rom. So ivicask patched services.jar with the PowerManager related stuff from the Sensation to make autobrightness together with the fixed/improved sensor driver work like a charm (see here and here).
I flashed this on on my LeeDrOiD 3.3.3 (HD Mod) and it works perfectly.
With those changes in the services.jar (and the "config_autoBrightnessLcdBacklightValues" etc) adjusted accordingly, I now get all levels and the corresponding brightness which feels good and will hopefully add some highly appreciated hours to my battery life.
So, that's all in short. If you have any specific (development related) questions, just let me know.
Please do not ask how to implement it or where to get it - since despite the references below - I have no information on who has implemented or ever will implement this. Use the search function or ask your ROM/Kernel developer.
Update: Information for Brightness / Gamma settings for Amoled (not SLCD)
- max brightness value is 250
- min value is 10 but anything <31 will be set to 20
- gamma steps are 30 and there are actually 9 levels. But that doesn't matter. any value between 30 an 250 should be (more or less).
So if you take those "restrictions" into account while changing your framework, it could add a bit of smoothness (yet not sure about it).
References:
I do not know of any ROM with the mod applied. I personally use
LeeDrOiD HD V3.3.3-Port-R5
snq-'s kernel thread where we tried and made sure it works. I currently use 110918-lsmod1
HowTo change Autobrightness in framework:
Desire HD (Ace) (where I learned to tweak it) Lower Auto-Brightness Settings for DEODEXED FROYO / GINGERBREAD Sense ROMs
Classic Desire specific (Bravo) [How to] Adjust auto-brightness on GB Sense ROM
Question:
Has anyone been successfull to do the same for the hardware button backlights? (meaning to turn them off at higher levels). Seems the changes I applied so far do not work like I expect it.
So, I hope that this mod is of any use for Sense Rom's and kernels. I am more than happy with it and just wanted to share it with you.
Best regards,
Toby
Finally, if any mod thinks this is the wrong section or has no reason to be here, just let me know.
tobi01001 said:
The script showed me, that even with all levels being reported, the value I set for the lowest level was never applied. (Maybe someone can confirm).
Click to expand...
Click to collapse
I can confirm to have seen this behaviour. I could see in the log that the lower level in "config_autoBrightnessLcdBacklightValues" was being applied when no ambient light, but I couldn't see any change in my screen light...
Thanks a lot for your effort. I'm sure anderl78 will take note and adapt his modified frameworks with this 10er value.
If I'm right, currently snq- kernel is up to date with this info (from 110918-lsmod1). I don't really know about bananacakes and others.
bye!
Since this thread deals with brightness level, I'm hoping someone can look at this and shed some light...
Re-posting my post from the orher thread...
Delete it if it's not cool to post this here...
Nice guide...
Did you find a way to adjust Camera's backlight..?
Every time the Camera app launches, the screen's backlight always turn up the brightness substantially...
If this can be adjusted, then it will be a perfect complimentary...
Click to expand...
Click to collapse
Some follow-up...
I didn't find anything in the framework...
But decompiling HTCCamera.apk, and looking at smali's did show something...
It seems that it call's setMaxBrightness (), in almost all activity...
I always felt it increases the backlight, but quite surprised that it's set at MAX...
So...
Anyone experienced in smali's..?
Which line is save to delete/edit to prevent this backlight maxing out..?
Thanx in advance...
Click to expand...
Click to collapse
i just see 1 problem with your framework-res.apk values.
light sensor value can only reach to 10240 so adding 10241 value is useless.
adc reads these values :
- 10
- 40
- 90
- 160
- 225
- 320
- 640
- 1280
- 2600
- 10280
and in framework we have :
- 11
- 41
- 91
- 161
- 226
- 321
- 641
- 1281
- 2601
so all 10 levels (0 to 9) are already presents as you can see :
(level 0 : lower than 11 so 10 indeed)
- 11
(level 1 : from 11 to 40)
- 41
(level 2 : from 41 to 90)
- 91
(level 3 : from 91 to 160 )
- 161
(level 4 : from 161 to 225)
- 226
(level 5 : from 226 to 320 )
- 321
(level 6 : from 321 to 640)
- 641
(level 7 : from 641 to 1280)
- 1281
(level 8 : from 1281 to 2600 )
- 2601
(level 9 : from 2601 to 10280)
so IMOH it's useless to add the last level.
if i didn't understand something please can you explain to us
That's exactly what I thought it should work. Unfortunately the lowest value was never set. So I just added the (rather useless) last value. Now all works like it should and like you described.
So even if it seems useless (and I would agree to that), this is the way it worked out for me...
Sent from my HTC Desire using xda premium
strange, it worked good for me without any other changes than "backlightvalues" in arrays.xml.
probably it depends on rom you use.
NeoEpsilon said:
Since this thread deals with brightness level, I'm hoping someone can look at this and shed some light...
Re-posting my post from the orher thread...
Delete it if it's not cool to post this here...
Click to expand...
Click to collapse
Here's autobrightness fix for HTCCamera
Change
HTCCamera.smali, HTCSnapbooth.smali
Code:
const-string v2, "com.android.settings.request.BRIGHTNESS_[COLOR="Red"]MAX[/COLOR]"
Into
Code:
const-string v2, "com.android.settings.request.BRIGHTNESS_[COLOR="red"]NORMAL[/COLOR]"
Now when you start camera app screen wont go to MAX but standard android autobrightness will work for camera app.
Here's Camera apk for michaelm_007 Sense2.1+3ROM
View attachment HTCCamera.apk
Or give me you apk so ill mod it for you so you can test.
tobi01001 said:
So, if you have a kernel with the changes implemented you can easily verify with
Code:
cat /sys/devices/i2c-0/0-0066/ls_adc
(and proper light conditions) all sensor levels from 0 to 9 are reported. You can even use a sensor app to verify that all light levels are reported (in lux within those apps).
Click to expand...
Click to collapse
cat /sys/devices/i2c-0/0-0066/ls_adc
ADC[0x0EC] => level 4
Presumably this means it's not working in tristans kernel?
Bit confused by => level 4
ivicask said:
Here's autobrightness fix for HTCCamera
Change
HTCCamera.smali, HTCSnapbooth.smali
Code:
const-string v2, "com.android.settings.request.BRIGHTNESS_[COLOR="Red"]MAX[/COLOR]"
Into
Code:
const-string v2, "com.android.settings.request.BRIGHTNESS_[COLOR="red"]NORMAL[/COLOR]"
Now when you start camera app screen wont go to MAX but standard android autobrightness will work for camera app.
Here's Camera apk for michaelm_007 Sense2.1+3ROM
View attachment 731562
Or give me you apk so ill mod it for you so you can test.
Click to expand...
Click to collapse
Thanx...
I've already edited mine exactly like that...
Haven't tried it yet though...
Glad to see the same solution...
Currently looking for a way to enable auto-brightness when launching HTCCamera...
Just in case the phone is set to manual brightness...
t-minik said:
strange, it worked good for me without any other changes than "backlightvalues" in arrays.xml.
probably it depends on rom you use.
Click to expand...
Click to collapse
Are you sure that you've seen all levels and the according screen brightness values? Level 0 and level 1 were always the same for me...
Sent from my HTC Desire using xda premium
NeoEpsilon said:
Thanx...
I've already edited mine exactly like that...
Haven't tried it yet though...
Glad to see the same solution...
Currently looking for a way to enable auto-brightness when launching HTCCamera...
Just in case the phone is set to manual brightness...
Click to expand...
Click to collapse
With the above fix camera is on auto-brightness all the time, theres no manual setting...
ziggy1001 said:
cat /sys/devices/i2c-0/0-0066/ls_adc
ADC[0x0EC] => level 4
Presumably this means it's not working in tristans kernel?
Bit confused by => level 4
Click to expand...
Click to collapse
How can you come to such conclusion? The level you see will depend on the light that is on the sensor... That's the whole meaning about it..
And make sure the screen is one. Otherwise what you get from the sensor is everything but the light level.
Sent from my HTC Desire using xda premium
ivicask said:
With the above fix camera is on auto-brightness all the time, theres no manual setting...
Click to expand...
Click to collapse
Seriously..?
I'm under impression that if my phone uses manual brightness, then the above fix will also use the same manual setting...
So whatever setting my brightness is, it HTCCamera will always use auto..?
Will try this later...
---------- Post added at 09:04 PM ---------- Previous post was at 09:00 PM ----------
tobi01001 said:
How can you come to such conclusion? The level you see will depend on the light that is on the sensor... That's the whole meaning about it..
And make sure the screen is one. Otherwise what you get from the sensor is everything but the light level.
Sent from my HTC Desire using xda premium
Click to expand...
Click to collapse
@tobi01001
tobi...
In a normally lighted bedroom, what level is your Desire set to..?
My Desire never set the level above 2...
To push it to level 4, I need to blast it with a flashlight...
Just curious about the sensitivity...
NeoEpsilon said:
Seriously..?
I'm under impression that if my phone uses manual brightness, then the above fix will also use the same manual setting...
So whatever setting my brightness is, it HTCCamera will always use auto..?
Will try this later...
Click to expand...
Click to collapse
If you turn off automatic brightness in your phone and put it manualy to the max Camera will be also at max.
If you put it on middle..camera will be middle
If you put it to Auto, camera will be auto
thats it
tobi01001 said:
Are you sure that you've seen all levels and the according screen brightness values? Level 0 and level 1 were always the same for me...
Sent from my HTC Desire using xda premium
Click to expand...
Click to collapse
i'm sure
as i set level 0 is 41 and level 1 is 55 all others are working.
i just saw a thing that can help.
for me when screen is off, adc level is set to 5.
so when you lit up screen adc can read a value between 0 and 9 and screen brightness change to desired value.
but when adc level go up brightness setting used seems to be those :
<integer-array name="config_autoBrightnessLcdBacklightValuesUp">
when adc level go down it's the same with :
<integer-array name="config_autoBrightnessLcdBacklightValuesDown">
if values for a same level are higher than in <integer-array name="config_autoBrightnessLcdBacklightValues">, when adc level returns to 0 backlight will never go down to the normal value but go to the "config_autoBrightnessLcdBacklightValuesDown" for exemple.
so extreme personally I set the same extreme values for the 3 lists.
EDIT // do you think adc level 0 can be set to 20 instead of 10 for a slightly less sensibility ?
Here are my values, and so far working perfectly, minimum and maximum values and everything... (gingercakes-0.7c) .
Code:
<integer-array name="config_autoBrightnessLevels">
<item>11</item>
<item>41</item>
<item>91</item>
<item>161</item>
<item>226</item>
<item>321</item>
<item>641</item>
<item>1281</item>
<item>2601</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>33</item>
<item>51</item>
<item>81</item>
<item>115</item>
<item>133</item>
<item>153</item>
<item>186</item>
<item>208</item>
<item>230</item>
<item>254</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesUp">
<item>31</item>
<item>51</item>
<item>81</item>
<item>115</item>
<item>133</item>
<item>153</item>
<item>186</item>
<item>209</item>
<item>231</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesDown">
<item>32</item>
<item>52</item>
<item>82</item>
<item>115</item>
<item>133</item>
<item>153</item>
<item>186</item>
<item>207</item>
<item>229</item>
<item>253</item>
What's your opinion?
t-minik said:
i'm sure
as i set level 0 is 41 and level 1 is 55 all others are working.
i just saw a thing that can help.
for me when screen is off, adc level is set to 5.
so when you lit up screen adc can read a value between 0 and 9 and screen brightness change to desired value.
but when adc level go up brightness setting used seems to be those :
<integer-array name="config_autoBrightnessLcdBacklightValuesUp">
when adc level go down it's the same with :
<integer-array name="config_autoBrightnessLcdBacklightValuesDown">
if values for a same level are higher than in <integer-array name="config_autoBrightnessLcdBacklightValues">, when adc level returns to 0 backlight will never go down to the normal value but go to the "config_autoBrightnessLcdBacklightValuesDown" for exemple.
so extreme personally I set the same extreme values for the 3 lists.
Click to expand...
Click to collapse
Well, I've never seen the values in up and down. I set them different by purpose. But at least for me, it turns out they are never set.
EDIT // do you think adc level 0 can be set to 20 instead of 10 for a slightly less sensibility ?
Click to expand...
Click to collapse
Short answer: maybe, but with little use.
Well, at the moment it is possible to adjust the table in the bravo board file. Those represent somehow the raw values and are then set as light levels.
I do not know how to change the 10 to a 20. But that would make not that much sense since the driver will set the same levels. Android (the sensor manager) would only see a 20 instead of a 10 - but the environmental light conditions didn't change.
However, it would be possible to increase the value, which represents level 0 - so the span for level 0 would be a bit wider. Actually, I already proposed this with using 4 instead of 1...
Further:
I just found, that if you turn on the screen in absolutely brightness then the screen brighness is still set to the value of level 1 (40 in my framework). In this case it does somehow not go down to the value of level 0. There is a change to a brighter value needed first.
I will investigate a bit more and play with different settings as soon as I have time to do so.
NeoEpsilon said:
Seriously..?
I'm under impression that if my phone uses manual brightness, then the above fix will also use the same manual setting...
So whatever setting my brightness is, it HTCCamera will always use auto..?
Will try this later...
---------- Post added at 09:04 PM ---------- Previous post was at 09:00 PM ----------
@tobi01001
tobi...
In a normally lighted bedroom, what level is your Desire set to..?
My Desire never set the level above 2...
To push it to level 4, I need to blast it with a flashlight...
Just curious about the sensitivity...
Click to expand...
Click to collapse
In my bedrom is totally darkness... at least when I intend to sleep. So level 0. With common indoor light it is usually level 1 to 3. Level 4 to 5 in some cloudy sky and or in the shadow. The upper levels need more or less sunlight.
Do you have a case or something covering the lightsensor maybe?
ivicask said:
Here are my values, and so far working perfectly, minimum and maximum values and everything... (gingercakes-0.7c) .
Code:
<integer-array name="config_autoBrightnessLevels">
<item>11</item>
<item>41</item>
<item>91</item>
<item>161</item>
<item>226</item>
<item>321</item>
<item>641</item>
<item>1281</item>
<item>2601</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>33</item>
<item>51</item>
<item>81</item>
<item>115</item>
<item>133</item>
<item>153</item>
<item>186</item>
<item>208</item>
<item>230</item>
<item>254</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesUp">
<item>31</item>
<item>51</item>
<item>81</item>
<item>115</item>
<item>133</item>
<item>153</item>
<item>186</item>
<item>209</item>
<item>231</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesDown">
<item>32</item>
<item>52</item>
<item>82</item>
<item>115</item>
<item>133</item>
<item>153</item>
<item>186</item>
<item>207</item>
<item>229</item>
<item>253</item>
What's your opinion?
Click to expand...
Click to collapse
So you are using 9 values (stock ones of course) in
Code:
<integer-array name="config_autoBrightnessLevels">
as well.
Could you maybe confirm that you see Level 0 and the corresponding screen brightness (33 in your case)... If so, I may have been totally wrong in my assumptions about the framework.
I do not understand the slight differences in the up/down lists and my personal feeling is that those have no impact on what you actually see.
I have them set totally different and as already mentioned, I never saw the screen brightness set to any of them.
this is how I set my values in the framework, but thats personal feeling anyway:
Code:
<integer-array name="config_autoBrightnessLevels">
<item>21</item>
<item>41</item>
<item>91</item>
<item>161</item>
<item>226</item>
<item>321</item>
<item>641</item>
<item>1281</item>
<item>2601</item>
<item>10241</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>21</item>
<item>40</item>
<item>50</item>
<item>70</item>
<item>80</item>
<item>90</item>
<item>120</item>
<item>160</item>
<item>200</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesUp">
<item>21</item>
<item>28</item>
<item>45</item>
<item>60</item>
<item>75</item>
<item>85</item>
<item>105</item>
<item>140</item>
<item>180</item>
<item>228</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesDown">
<item>28</item>
<item>45</item>
<item>60</item>
<item>75</item>
<item>85</item>
<item>105</item>
<item>140</item>
<item>180</item>
<item>228</item>
<item>255</item>
</integer-array>
I'm pretty sure it works perfectly on 10 levels without adding any level in framework.
values, valuesip and valuesdown are very close and it should work perfectly.
for me, values, valuesip and valuesdown are the same and it's perfect on BravoS V7

A request to all devs...

I think the this is pertinent to all Samsung ROMs, and I would like Devs to provide input on an aspect that affects the whole reason we buy the phone - in this case the Skyrocket.
This is about brightness/clarity changes that happen between ROMs. One MAIN reason that we buy the Samsung phones is the brilliance of the Super AMOLED screens. When custom ROMs are flashed, the screen brighness and clarity - yes, clarity which may itself be a psychological link to brightness - changes quite a bit.
Almost all ROMs do NOT mention if the dev ACTIVELY changed the brightness settings in framework-res. NO DISSIN ANYBODY here. So please this is not a negative. Or did the dev remove stock apks, files etc., that may or may not be linked to screen/display settings. I UNDERSTAND THAT THIS MAY BE DONE TO SAVE BATTERY. So no biggie there either.
ALSO, I know how to hack the brightness in framework-res, and also have apps that can do it for me.
It would be great if devs could indicate if brightness was hacked, because STOCK BRIGHTNESS/DISPLAY always looks so much more impressive. Much more impressive than any custom rom, BUT STOCK SUCKS otherwise. If it was not hacked then clearly settings are getting affected.
It would be really great if we could retain stock display quality in custom ROMs. Also, by indicating about brightness in Rom OP, this would give a heads up what to expect. Whether to hack myself, or use apk.
THANKS TO ALL DEVS, anyways for their super work that makes the phones so much better than manufacturer's want us to have !!
chappatti said:
I think the this is pertinent to all Samsung ROMs, and I would like Devs to provide input on an aspect that affects the whole reason we buy the phone - in this case the Skyrocket.
This is about brightness/clarity changes that happen between ROMs. One MAIN reason that we buy the Samsung phones is the brilliance of the Super AMOLED screens. When custom ROMs are flashed, the screen brighness and clarity - yes, clarity which may itself be a psychological link to brightness - changes quite a bit.
Almost all ROMs do NOT mention if the dev ACTIVELY changed the brightness settings in framework-res. NO DISSIN ANYBODY here. So please this is not a negative. Or did the dev remove stock apks, files etc., that may or may not be linked to screen/display settings. I UNDERSTAND THAT THIS MAY BE DONE TO SAVE BATTERY. So no biggie there either.
ALSO, I know how to hack the brightness in framework-res, and also have apps that can do it for me.
It would be great if devs could indicate if brightness was hacked, because STOCK BRIGHTNESS/DISPLAY always looks so much more impressive. Much more impressive than any custom rom, BUT STOCK SUCKS otherwise. If it was not hacked then clearly settings are getting affected.
It would be really great if we could retain stock display quality in custom ROMs. Also, by indicating about brightness in Rom OP, this would give a heads up what to expect. Whether to hack myself, or use apk.
THANKS TO ALL DEVS, anyways for their super work that makes the phones so much better than manufacturer's want us to have !!
Click to expand...
Click to collapse
how exactly do you hack the brightness? I'd love to play with this.
Sent from my SAMSUNG-SGH-I727 using xda premium
Shadeslayers said:
how exactly do you hack the brightness? I'd love to play with this.
Sent from my SAMSUNG-SGH-I727 using xda premium
Click to expand...
Click to collapse
Here are some spots to help you: I would try to make a tutorial but have not gotten arond to it since it is available in some places.
The first is very up-to-date:
http://forum.xda-developers.com/showthread.php?t=1377410
http://forum.xda-developers.com/showthread.php?t=1337722
This tutorial below is form a different forum posted originally by DRGilroy (at Team BAMF Forums). This particular post is not available and I have copied it from Google's cached version: BUT ALL CREDIT GOES TO DRGilroy:
[How To] Customize Auto Brightness
I've created my own Auto Brightness Mods for people to use and I thought I would help those out who are interested in creating their own.
I learned how to do it myself by searching and finding tutorials here and there in different posts and forums. Some of what I found was either not detailed enough or had incorrect instructions for the version of APK Manager I am using. So, most of what I'm going to do here is just reiterate what someone else has already written out there somewhere in the world wide web.
Tools:
APK-Manager v5.0.2 (versions earlier than 5.0 behave differently so instructions would be somewhat different if your attempting to use one of them)
Notead++
7-Zip
Instructions for Creating Your Own Custom Auto Brightness Levels:
Extract the file "framework-res.apk" from your favorite ROM. You can find it in /system/framework/
Copy the framework-res.apk file into the APK Manager directory "place-apk-here-for-modding"
Execute the Script.bat file in the root of the APK Manager directory
Type option "9" and press Enter to Decompile the framework-res.apk file
Leaving the Command Window open, with Notepad++ open the file "arrays.xml" found under "\projects\framework-res.apk\res\values"
Find and edit the following *values:
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>94</item>
<item>94</item>
<item>94</item>
<item>94</item>
<item>143</item>
<item>143</item>
<item>171</item>
<item>199</item>
<item>227</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesUp">
<item>94</item>
<item>94</item>
<item>94</item>
<item>94</item>
<item>143</item>
<item>143</item>
<item>171</item>
<item>199</item>
<item>227</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesDown" >
<item>94</item>
<item>94</item>
<item>94</item>
<item>94</item>
<item>143</item>
<item>143</item>
<item>171</item>
<item>199</item>
<item>227</item>
<item>255</item>
Save your edits and close Notepad++
Reopen the Command Window and Type option "11", press Enter to Compile apk
When asked "Is this a system apk (y/n)" type "y" and press Enter
When asked "Aside from the signatures, would you like to copy... (y/n)" type "y" and press Enter
When prompted with "Press any key to continue . . .", Leaving the Command Window open, Navigate to the APK Manager directory "keep" and delete the file "resources.arsc"
Reopen the Command Window and now press any key to continue
Type option "22" and press Enter to Set current project
Select the newly compiled unsignedframework-res.apk file, it should be number 2, type "2" and press Enter
Take note of the "Current-App:" unsignedframework-res.apk should be shown on the upper right corner of the Command Window
Type option "5" and press Enter to Zipalign apk
At this point you can close the Command Window
Copy the file "unsignedframework-res.apk" from the APK Manager directory "place-apk-here-for-modding" and rename it to framework-res.apk
Congratulations, you now have a framework-res.apk that has your own custom Auto Brightness values!
Now what do you do with the framework-res.apk file?
There are a couple things you can do with the file.
You can use ADB to push your new framework-res.apk to the phone
You can create a flashable Zip using the UOT Kitchen website
You can use an existing flashable Zip that contains a framework-res.apk file and replace it with yours
I'll throw you a bone and you can use my flashable zip below, Yes, I'm just that nice!
bamf_forever_1.0.8_auto_brightness_1.0.zip
Brightness: 31, 31, 59, 87, 115, 143, 171, 199, 227, 255
MD5: A1360E982CE401E9302929D527BC3641
*Brightness Values Explained
The following numbers represent the light sensors steps for using brightness:
11, 41, 91, 161, 226, 321, 641, 1281, 2601
The following numbers are the stock values that I mod and they represent the level of brightness, lowest to highest in ten level steps:
94, 94, 94, 94, 143, 143, 171, 199, 227, 255
Example:
Light Sensor___Brightness
10---------------94
40---------------94
90---------------94
160--------------94
225--------------143
320--------------143
640--------------171
1280-------------199
2600-------------227
Higher------------255 = Max
You can use a free app on the Market called AndroSensor. It can provide you with the value of how much light the sensor is detecting.
In my testing, it appears to me that brightness values lower than 30 do not cause the backlight to dim any further. Also, when connected to a charger with battery charging, the light sensor doesn't go lower than 40 until the battery is fully charged, then it will lower to 10.
Then there is this http://forum.xda-developers.com/showpost.php?p=24437288&postcount=29
After all this there are free apps: I am using LogGraph.......
Good Luck !!
call me crazy but why bother. there are three options, I always just use dim to save battery, but occasionally ill go full bright when viewing a photo or something.
edgex said:
call me crazy but why bother. there are three options, I always just use dim to save battery, but occasionally ill go full bright when viewing a photo or something.
Click to expand...
Click to collapse
This phone has a great screen that clearly is the major selling point for it. Why ruin the screen under sub optimal conditions?
I am actually running mhx's full bloat stock ROM, and am loving the screen......... but I am restricted to this if I want the full visual experience. It is a little like buying HDTV for watching only 480p programming.
also automatic brightness when executed properly makes viewing under changing light conditions so much more smoother and pleasurable..
Well........that's just my opinion, not really complaining since a custom room is better than ATT cares to give us and I am thankful For that.

[REF] Auto-brightness Changes

A long, long time ago, in a land far far away...
...there was a king of an empire on a peninsula near what we today call China. He had great scientists that made devices that let you magically talk with people in other places.
However, one of those devices annoyed the king. The king brought in his chief scientist and said, "How dare you make a magic box like this! Whenever I turn it on, the screen flashes bright when it is dim, or dim when it is bright. What do you have to say about this grave mistake of yours?" The chief scientist began, "Your honor, it is an issue with the start up of the GP2A sensor. You see, during the first 50,000 nanoseconds..." The king grew furious and interrupted him, "I don't want to hear about stinkin' nano-whatevers." He waved the chief scientist off and looked at the court jester. The jester smiled and said, "You could always just turn off auto-brightness." The king laughed and proclaimed, "Bring in my best consultants!"
In came the butcher, the baker, and the candlestick maker.
The king explained the problem to them and each thought carefully before responding.
The butcher said, "I'd just modify the kernel and only have it send out an event when the light level was very stable for 20 seconds."
The baker said, "I'd look at six samples, throw out the high, throw out the low, and return the average of the other four."
The candlestick maker said, "I know a little about light, you see. I'd throw out the first four samples, then just use wide bands so the light doesn't bounce around much."
The king listened to all three and looked at the jester. The jester said, "Don't look at me, it's all gobbledegook, but it all sounds good!"
The king proclaimed, "You heard the jester. Make it so!"
So the butcher hacked the kernel driver, as did the baker, and the candlestick maker hacked libsensors and the framework.
The jester laughed to himself, "What a hack job! Put in all three, that is going to be a mess and a half." Thankfully for the jester, the king didn't hear him.
The people awaited something from the king that would compete with the iPhone (yes, they had Apple Stores back then) and it came forth, named for the stars, the Galaxy S4G. And the people flocked to it. They were frustrated as its auto-brightness didn't work very well. It didn't flash bright and dim, but it took 20 seconds or more to adjust, and sometimes never did. So they took the advice of the jester, they turned auto-brightness off.
Then came the excitement. The pastry chefs were cooking up ice cream sandwiches. But their first results had the same problem as the gingerbread and the frozen yogurt. The people were disappointed. Again, they turned off the auto-brightness.
Thankfully, a magician from another court sent them a message that he had solved their problems. He had a phone that the auto-brightness worked well for him, to the point he forgot that auto-brightness was even on. He checked it for several days and tweaked it a bit for his personal preference.
This is that message.
Source has been committed to the TeamAcid repository that should resolve the auto-brightness issues with the SGS4G. New builds of CM9 and AOKP (and ROMs that use the TeamAcid code base) should soon see these changes after a repo sync is done.
For those assembling ROMs rather than building from scratch, you are likely to need:
Kernel with updated GP2A driver
Updated libsensors
Changes to framework to use the new values to set brightness
I can't say if one of the libsensor objects from one ROM can safely be used in another.
If you want to change the light levels and brightness, CM9 (and perhaps other ROMs) let a user select System settings > Display > Automatic Backlight and adjust the settings by checking "Use custom" and then clicking "Edit other levels..." I did not turn on the "Light Sensor Filter," but did select "Allow light decrease" and set "Decrease hysteresis" to 0%.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Edit -- I have since added an intermediate step at 180 brightness starting at 1750 lux to better handle overcast mornings/evenings.
If you're not familiar with lux and perceived brightness, the eye sees a doubling of light level as "one step" in brightness. The difference between "50% gray" and "white" is a doubling of light level. You'll see in the framework that for one of the steps the screen brightness varies by 0.7 -- half a "doubling" step -- to reduce big "jumps" at low brightness levels.
Here are some typical light levels in lux:
9 lux -- lower limit of output of sensor to Android code
50-150 lux -- typical home "living room" illumination
300-500 lux -- typical office illumination, sunrise or sunset
1,000 lux -- overcast day
10,000 lux -- indirect light on a sunny day
100,000 lux -- direct sun
These changes do not, unfortunately, resolve the soft-key light issues, nor do they seem to allow auto-brightness to set the brightness lower than the "20" that seems to be the "dim" level.
Very nice. About the only bug in CM9 that would these phones work. Hope this gets pushed to CM9 for us soon.
Great fix and one of the better reads I've had hear in a while. Oh and here's a log:
hechoen said:
Great fix and one of the better reads I've had hear in a while. Oh and here's a log:
Click to expand...
Click to collapse
Made me lol. I'm submitting the same log I guess
No, you guys are doing it wrong. This is what devs want. Right?
So... can I get an ETA on when jeffsf will be the next official member of Team Acid?
Seriously though, your research and contributions to our community have been amazing. Thanks for all your hard work.
This has been a long standing major issue.
My thanks do not go lightly! I really do appreciate your work on this!
IS there is a way I could rip the files from say the AOKP that has the auto-brightness and try it in another ROM I already have flashed. I could do a backup before in case it mucks something. I just like the look of Remic, the touchwiz, the dialer, all of it. I keep going back to it, but I like auto-brightness. lol.
getochkn said:
IS there is a way I could rip the files from say the AOKP that has the auto-brightness and try it in another ROM
Click to expand...
Click to collapse
Glad you find the auto-brightness changes working for you.
I'm not an expert on assembling a ROM from various bits and pieces, but the changes are detailed in the Team Acid repositories on github.
If I were to guess as to what to try, it would include:
boot.img for the kernel
/system/lib/modules/bcm4329.ko
/system/lib/libsensorservice.so
Changes to framework to provide the new auto-brightness levels in overlay/frameworks/base/core/res/res/values/config.xml
If the ROM in question doesn't use the same "layout" as CM9, then you might need to adjust other things, such as where the WiFi configuration information is found.
Thanks. way over my head. lol. Sure I could figure it out or wait till Remics gets updated.
Is anyone using custom levels? If so what values.
I find that the stock top level being set to 5000 is much to aggressive to be good for battery life.
Here are the values that I am testing now
What are yours?
Edit: these values seem to flicker a little between 3500 and 5000 lux (screen goes to dim before timeout and comes back up). Might need to edit a little or find values that are more exponential than linear
Also auto needs to be off for setting to stick and allow lights to decrease needs to be set to on or the levels will not come down from the highest levels
Note to trolls, this thread does not indicate that you can't post settings here. This feature is still "in development" and this type of feedback is welcome.
As a little help for those trying to come up with "midpoints" between things, if you have a level X and another level Y, the middle for perceived brightness is sqrt( X * Y)
For example, the "middle" of 600 and 5,000 is sqrt( 600 * 5,000 ) ~ 1,732
TrenchKato said:
Also auto needs to be off for setting to stick and brightness moving average filters needs to be set to on or the levels will not come down from the highest levels
Click to expand...
Click to collapse
Hmm, interesting. I don't have "Light Sensor Filter" enabled, but do have "Allow light decrease" set. I also have the "Decrease hysteresis" set to 0%.
I think that it might be the "Decrease hysteresis" setting that may be causing the effect you see. If there is 50% hysteresis on a level of 10240, I am guessing it won't "shift down" until you get to 5120. I haven't checked the code on that.
I'm hardly saying my settings are "optimal" -- I intentionally turned off filtering and hysteresis so that I could get rapid response to see how the various brightness levels "worked" (at least for me) in different lighting conditions.
Edit: Kato, what kind of light levels do you have in, for example, your office or home? Your breakpoints seem very high compared to what I would expect.
I'm running:
(0) - 1
50 - 32
75-45
150 - 64
600 - 128
1750 - 180
5000 - 255
I just realized that it its the light decrease setting that is causing the brightness to stay at high level... and it makes sense that a 50% hysteresis world cause flicker given that 50% world move thru 3 brightness.. I also have my dim set to 1...
I am actually outside... I didn't take that into account... however it is my preference to use the lowest values possible inside... so my values may be biased in that way.. especially when outside lux reads well above 10240 anyway (on AOKP)
That why I'm thinking using exponential set of values would work better in both conditions than just cutting values in half
Ya so thank to Jeffsf that we have Auto Brightness working now...so...not to hhijack this thread but for those who are a zip-jockey like me or who dont want to wait til your rom be updated (miui, remics, cna,...bla bla bla) and wanna do some experiment, here is what to do:
jeffsf said:
Glad you find the auto-brightness changes working for you.
I'm not an expert on assembling a ROM from various bits and pieces, but the changes are detailed in the Team Acid repositories on github.
If I were to guess as to what to try, it would include:
boot.img for the kernel (from AOKP build 5)
/system/lib/modules/bcm4329.ko (from AOKP build 5)
/system/lib/libsensorservice.so (from AOKP build 5)
If the ROM in question doesn't use the same "layout" as CM9, then you might need to adjust other things, such as where the WiFi configuration information is found.
Click to expand...
Click to collapse
Afterward, use apktool (recommend the latest 1.5.0 version) to decompile YOUR rom's framework-res:
Code:
$ apktool if framework-res.apk
$ apktool d framework-res.apk
and looke for the file: /res/values/arrays.xml
Scroll down to this:
Code:
<integer-array name="config_autoBrightnessLevels">
<integer-array name="config_autoBrightnessLcdBacklightValues">
<integer-array name="config_autoBrightnessButtonBacklightValues">
And change whatever values of those to this:
Code:
<integer-array name="config_autoBrightnessLevels">
<item>50</item>
<item>75</item>
<item>150</item>
<item>600</item>
<item>5000</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>1</item>
<item>32</item>
<item>45</item>
<item>64</item>
<item>128</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessButtonBacklightValues">
<item>255</item>
<item>255</item>
<item>255</item>
<item>0</item>
<item>0</item>
<item>0</item>
</integer-array>
After that, compile back the framework-res.apk
Code:
$ apktool b framework-res
And open the ORIGINAL framework-res and the /dist/framework-res by winrar in Windows or zip manager in ubuntu and copy the resource.arsc from /dist/framework-res to the ORIGINAL one and copy the modified original framework-res.apk back to the zip (that now contains boot.img, /lib/modules/* and /lib/libsensorservice.so) under the path: /framework and ya...flash it ^^ (you can use the hefe 0.8.1 for the package template and replace files under needs)
Hi Dao
Thanks. I tried that on MIUI.
I see the team acid kernel was updated but I don't think auto brightness is working. I see no change when choosing it on quick toggles.
How can I know that it really works?
10x
sent from me
itzik2sh said:
Hi Dao
Thanks. I tried that on MIUI.
I see the team acid kernel was updated but I don't think auto brightness is working. I see no change when choosing it on quick toggles.
How can I know that it really works?
10x
sent from me
Click to expand...
Click to collapse
It works in FB's latest AOKP release, I tried it and saw it work fine, so jeff's changes work. Exactly what needs to be used to bring it to another ROM though, ???
itzik2sh said:
How can I know that [auto-brightness] really works?
Click to expand...
Click to collapse
I don't see any logcat evidence in the version of CM9 I am currently running. Using ddms and watching frameworks/base/services/java/com/android/server/PowerManagerService.java (or its equivalent) would be my suggestion.
Thanks. I had some other non related FCs. Now that they're fixed I can see it is working. Ghanks guys!
Updating HebMIUI ROM.
sent from me
daothanhduy1996 said:
Ya so thank to Jeffsf that we have Auto Brightness working now...so...not to hhijack this thread but for those who are a zip-jockey like me or who dont want to wait til your rom be updated (miui, remics, cna,...bla bla bla) and wanna do some experiment, here is what to do:
Afterward, use apktool (recommend the latest 1.5.0 version) to decompile YOUR rom's framework-res:
Code:
$ apktool if framework-res.apk
$ apktool d framework-res.apk
and looke for the file: /res/values/arrays.xml
Click to expand...
Click to collapse
I tried to do this on your ROM and I get W: Cant find 9patch chunk in file: "drawable-hdpi/switch_thumb_pressed_holo_dark.9.png". Renaming it to *.png.
Not sure I want to continue if I get errors.

[REQ][DISCUSSION]Auto Brightness fix for Roms

Hello all!...As you know, Jeffsf fixed our Auto Brightness issue for the source codes of Team Acid's ICS roms, and I, based on his changes to write a guide for fixing it on some ports using Compile/decompile method for instant fixing...anw, as some of people don't know how to do it or can't wait blah blah for that feature fixed for ur rom...so, I can do that for you...
All I need is your Roms' /system/framework/framework-res.apk (with the Rom name) and testers for them (to know if it would boot fine or not - usually fine)...
We can also discuss bout what values are great for Auto Brightness (like for battery friendly or bla bla) BECAUSE I know some of the roms don't support Custom Auto Brightness values (MiUI for instance)...
And yeah, that's that, just upload the framework-res.apk, pm me w the rom's name and I will update it here...
Notice: I will include in the normal kernel (not KOD version) by default and you can always flash the KOD if u want ...
My suggestion default Values (read in the code block, not the picture, the pic is just for illustration):
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
​
Code:
<integer-array name="config_autoBrightnessLevels">
<item>500</item>
<item>1000</item>
<item>4000</item>
<item>7000</item>
<item>10000</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>1</item>
<item>30</item>
<item>60</item>
<item>90</item>
<item>150</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessButtonBacklightValues">
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
</integer-array>
"config_autoBrightnessLevels" are the left column (used for sensor filter values).
"config_autoBrightnessLcdBacklightValues" are the center column (for the screen brightness).
"config_autoBrightnessButtonBacklightValues" are the right column (used for buttons brightness).
As if your roms support custom values edit then u can make changes afterward...otherwise, I will use this 6 steps on Brightness changing.
P/s: If you found this thread nonsense, PLEASE REPORT IT RATHER THAN LEAVING BAD COMMENTS...thanks ...And I will spend the next 3 days for requests...otherwise (u pm me 3 days later), I will do it the next Mon, Wed and Fri til weekend...
Here is the package, not much work cause I am very busy w the mid-term tests...So, this package is no more than just AOKP's kernel plus sensor lib...so, this will make your rom has auto brightness with default settings...
For those who r on CM9 (already fixed), AOKP (already fixed), Unknown CM9, Resurrection Remix, Codename, RemICS, Paranoid Android, Audiophile, F4k, Provision, Slim, Gummy, Stock IMM76L, Galaxy beam, AOKPCB...you will have this fixed plus customizable settings via settings app...
for those who r on cMiUI...or properly MiUI. u will have this fix but NOT customizable settings, mean, it will work w default values and it may be negative to battery or whatever, if u like, pm me your ideal values (I repeat) lol...have fun
DOWNLOAD HERE
Sent from my SGH-T959V using xda premium
I'll test one for your Remics, do I need to upload that framework for you? lol. I tried doing it myself but got all kinds of errors with apktool about the "9" files not being right, etc, so I stepped away, slowly. lol.
I hope you know what you're getting into!
I think it would also be helpful when people post settings to also post some "reference" levels of brightness (from the configure auto-brightness settings page, shown in the first post), since it seems some people's settings have much, much higher levels than others. The sensor seems to be pretty directional; a range of values is fine. The ROM in use (and if it has an updated-for-auto-brightness libsensors) also would be valuable.
The touchkey backlight settings are really only "off" (0) and "on" (anything except zero) and the keyboard settings don't apply. For example, a touchkey backlight setting of "1" is no different to the hardware than "20" or "150" or "255"
I'm running self-built versions of CM9 and AOKP, with updated kernel and libsensors. My settings are
(0) -- 1
50 -- 32
75 -- 45
150 -- 64
600 -- 128
1750 -- 180
5000 -- 255
My reference brightness levels are
Home lighting -- 100-400
Diffuse office lighting -- 500-750
Overcast day or outside in the shadows ~ 2000
Other than finding the lowest level the phone will dim to still too bright for at-night use, the main place I have problems is when I'm in the car and it is reasonably bright outside, but the phone's face is in the shade. I get the 180 from the 1750-5000 lux band. I keep "0%" and "100%" as well as auto on my CM9 toggles for brightness levels. I seem to remember using the Brightness Level widget on AOKP, and certainly was very happy with it on GB.
jeffsf said:
I hope you know what you're getting into!
I think it would also be helpful when people post settings to also post some "reference" levels of brightness (from the configure auto-brightness settings page, shown in the first post), since it seems some people's settings have much, much higher levels than others. The sensor seems to be pretty directional; a range of values is fine. The ROM in use (and if it has an updated-for-auto-brightness libsensors) also would be valuable.
The touchkey backlight settings are really only "off" (0) and "on" (anything except zero) and the keyboard settings don't apply. For example, a touchkey backlight setting of "1" is no different to the hardware than "20" or "150" or "255"
Click to expand...
Click to collapse
Yup ...anw, I tested those settings and they were ideal for me but mayb not for others, so I think they should (if can, test, too) give their ideal values and I will compare the values, and compare to your ref for values and choose best match...and btw, that softkey values are just for joking hehe (like they can think it will turn off the softkey backlight at first lol) ^^...and thanks for your ref man
P/s: for others users (than CM9 and AOKP of team Acid of course -cause they were fixed lol), if u like/want the fix for your rom, just send that framework-res.apk to me...don't need to ask lol cause I'm serving you lmao
Or just wait for aries. We're hot on the trail of the SoD, and other then having to update the overrides for lux values, the rest should work fine.
Can you do one for Remics? Since you made it, you don't need the framework file do you? lol.
Link is in 2nd post...READ IT CARFULLY CAUSE I THINK U SHOULD THANK TEAM ACID FOR THEIR WORK THAT I JUST ZIP-ED IT FOR YO LOL
daothanhduy1996 said:
Link is in 2nd post...READ IT CARFULLY CAUSE I THINK U SHOULD THANK TEAM ACID FOR THEIR WORK THAT I JUST ZIP-ED IT FOR YO LOL
Click to expand...
Click to collapse
Killed wifi. lol.
getochkn said:
Killed wifi. lol.
Click to expand...
Click to collapse
Flash it again or mayb twice (cause I am using it w wifi on)
Sent from my SGH-T959V using xda premium
daothanhduy1996 said:
Flash it again or mayb twice (cause I am using it w wifi on)
Sent from my SGH-T959V using xda premium
Click to expand...
Click to collapse
Flashed again on Remics. Fixed Wifi but no customizable values. I enter a screen value and it doesn't even change, nevermind give me the option to save. I tried your instructions before on decompiliing the framwork, etc but got all kinds of errors with the "9" files and gave up at that point. lol.
EDIT:
I can set any value for the values except the first "SCREEN" value. I can set it to 20 but anything under 20 won't even register and stay saved. I like the one value from Jeff's defaults but it won't save that value for the first setting only for some reason. I can try setting the "10" for the first screen value to anything under 20 and it doesn't stay. Anything over 20 and it does no problem. I even tried adding a level from 0-1 and then trying to make one from 1-49 and set the screen value and it will not take any values under 20. I can set 20 and above no problem but nothing under 20 at all.
getochkn said:
Flashed again on Remics. Fixed Wifi but no customizable values. I enter a screen value and it doesn't even change.
EDIT:
I can set any value for the values except the first "SCREEN" value. I can set it to 20 but anything under 20 won't even register and stay saved. I like the one value from Jeff's defaults but it won't save that value for the first setting only for some reason. I can try setting the "10" for the first screen value to anything under 20 and it doesn't stay. Anything over 20 and it does no problem. I even tried adding a level from 0-1 and then trying to make one from 1-49 and set the screen value and it will not take any values under 20. I can set 20 and above no problem but nothing under 20 at all.
Click to expand...
Click to collapse
Ya, Ihave seen that bug in some roms and believe me, even in aokp that I had that...but somehow, try to modify it to 'n'(1, 2, 3,... that different frim default) level steps and apply and then re setting values again ^^
Sent from my SGH-T959V using xda premium
daothanhduy1996 said:
Ya, Ihave seen that bug in some roms and believe me, even in aokp that I had that...but somehow, try to modify it to 'n'(1, 2, 3,... that different frim default) level steps and apply and then re setting values again ^^
Sent from my SGH-T959V using xda premium
Click to expand...
Click to collapse
Ok, I'll try playing around adding/removing levels and see what happens. In FB's latest AOKP, it stays set at 1.
Thanks for the work though on this and the time. Hope mid-terms are going well.
EDIT:
Nope, I tried setting 16 levels, 2 levels, 5 levels, not one of them will let me set anything below 20. lol. Not sure what FB did to his framework or what.
Ah so its weird cause Icould use that trick anw, it wasnt fb or teamacid fault, just mine ^^ as jeffsf pointed me out, I will dig into it again later...btw, that 9.png error is nothig, just proceed to the next step I wrote
Sent from my SGH-T959V using xda premium
daothanhduy1996 said:
Ah so its weird cause Icould use that trick anw, it wasnt fb or teamacid fault, just mine ^^ as jeffsf pointed me out, I will dig into it again later...btw, that 9.png error is nothig, just proceed to the next step I wrote
Sent from my SGH-T959V using xda premium
Click to expand...
Click to collapse
apktool b framework-res gives me a ton of errors after decompiling the Remics and just changing the array values. Here's a pastebin.
http://pastebin.com/tizyvfyk
AFAIK, you can't set a value below that which is set for "Screen dim level" -- while I have mine set for "1" instead of the default "20" value, I can't tell a difference with my eyeballs between "1" and "20" (It makes me feel good, even if it doesn't do anything.)
I'll look at the pastebin in a bit. Edit -- looks like a single line (79) with a problem that is repeated in each language. Apparently their build chain is more forgiving than apktool is for unmatched XML tags.
jeffsf said:
AFAIK, you can't set a value below that which is set for "Screen dim level" -- while I have mine set for "1" instead of the default "20" value, I can't tell a difference with my eyeballs between "1" and "20"
I'll look at the pastebin in a bit. Edit -- looks like a single line (79) with a problem that is repeated in each language.
Click to expand...
Click to collapse
THANKS JEFF. Setting the dim level was the problem. Set that to 1, I can set it to 1 and set whatever levels I want now.
---------- Post added at 01:24 PM ---------- Previous post was at 01:14 PM ----------
daothanhduy1996: What Kernel is the one in your package based on? I was reading that Hefe's Kernel fixes the voodoo sound issue, and since Remics uses Voodoo, I would like to use that but I don't think Hefe's 0.81 has auto-brightness fixed.
getochkn said:
I don't think Hefe's 0.81 has auto-brightness fixed.
Click to expand...
Click to collapse
That's correct, v0.8.1 does not have the auto-brightness-related patches to the light-sensor driver.
I've got to get back to Herring and get some builds up, it seems
jeffsf said:
That's correct, v0.8.1 does not have the auto-brightness-related patches to the light-sensor driver.
I've got to get back to Herring and get some builds up, it seems
Click to expand...
Click to collapse
But KOD is based off Heff's with auto-brightness and the touchbutton light off feature right?
getochkn said:
But KOD is based off Heff's with auto-brightness and the touchbutton light off feature right?
Click to expand...
Click to collapse
Correct; it has the kernel changes for both the light sensor, as well as turning off the touchkey backlight when a touchkey is "released."

[Help Needed]Tweaking auto-brightness using framework-res.apk

Hi, I need a little help with customizing auto brightness values in framework-res.apk. I am using a Samsung Note N7000 (running cm11) and its default screen brightness is too high even at the lowest level. So, I de-compiled framework-res.apk and edited like below:
1. res\values\integers.xml
<integer name="config_screenBrightnessSettingMinimum">1</integer>
<integer name="config_screenBrightnessDim">1</integer>
2. res\values\arrays.xml
Code:
<integer-array name="config_autoBrightnessLevels">
<item>6</item>
<item>9</item>
<item>14</item>
<item>20</item>
<item>30</item>
<item>46</item>
<item>68</item>
<item>103</item>
<item>154</item>
<item>231</item>
<item>346</item>
<item>519</item>
<item>778</item>
<item>1168</item>
<item>1752</item>
<item>2627</item>
<item>3941</item>
<item>5912</item>
<item>8867</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>1</item>
<item>3</item>
<item>6</item>
<item>10</item>
<item>15</item>
<item>25</item>
<item>33</item>
<item>51</item>
<item>59</item>
<item>67</item>
<item>77</item>
<item>88</item>
<item>101</item>
<item>116</item>
<item>133</item>
<item>152</item>
<item>174</item>
<item>199</item>
<item>228</item>
<item>250</item>
The problem is that the lowest brightness is still very high and it hurts in the dark. What should I do now to even minimize the brightness. Can I put negative integers in above? I have used lux and it can set lowest brightness way below the system default but I don't want to use any app for this. I need a real dev's advice. Thanks!
I came across some app on playstore that fixes issues like this but cant recall the name
You should read my post again.
Sent from my GT-N7000 using XDA Free mobile app
Sent from my GT-N7000 using XDA Free mobile app
same on S4 Mini, thats why I bought Brightness app on google play and use it with Pie and llama
// and made app for button brightness http://forum.xda-developers.com/showthread.php?t=2949865

Categories

Resources