5,595,497 Members 47,125 Now Online
XDA Developers Android and Mobile Development Forum

[APP] LevelSight 1.1.0.2 2009.09.16 - backlight enhancement for Acer 900s and HTC

Tip us?
 
NuShrike
Old
(Last edited by NuShrike; 15th April 2010 at 12:12 AM.)
#1  
NuShrike's Avatar
Senior Recognized Developer - OP
Thanks Meter 9
Posts: 1,036
Join Date: Sep 2007
Lightbulb [APP] LevelSight 1.1.0.2 2009.09.16 - backlight enhancement for Acer 900s and HTC

Seriously consider donating something like $1 if you want software from me to continue, as johnpatcher had suggested.

This was originally built to flatten the brightness levels between AC and BATT on the Kaiser, but since lacking a workable front-camera API access, this works out better on devices with a light sensor.

/// new Acer m900 support
Since this device has only 3 auto-brightness settings, a full sensor-to-backlight curve is used -- configurable in HKCU/SOFTWARE/Creative 'Ware/LevelSight/0-a -- to map the 11 brightness settings actually available.

Brightness levels to about 4 have been hand-tuned and then it's a linear scale to max brightness.

Currently, the settings are loaded only on service startup, restart the service (through dotfred TaskMgr) if you want it to reload the registry settings
///

1.0.3.x: <HTC>Remember to CLICK OFF your auto-backlight setting.<HTC>
Uses HKCU\SOFTWARE\Creative 'Ware\LevelSight\offset to adjust the native backlight setting. It defaults to -1 so it'll pick a setting 1 less than what the system would've automatically set. If you set it to 0, it'll pick the same as auto, and so on. Behavior is the same as pre-1.0.3.x when backlevels fall below low_wm, but switches to offset mode when levels rise above high_wm.

More gui ability to adjust these settings is coming.

/// pre-1.0.3.x
<HTC>All this does is TURNS OFF the auto-backlight whenever reported light levels drop below low_wm using a custom 1st order low-pass algorithm. When turned off, the backlight falls back to whatever you have your AC/BATT light levels set to in your control panel. This solves the issue of the auto-backlight not dimming below backlight level 3.

When light levels rise above what the light sensor API thinks should be backlight level high_wm, it uses the auto-backlight settings again, and lets it auto-adjust as was usual.<HTC>
///

It is however not perfect due to the low accuracy of the sensor at low light levels, but does try to ignore the random unexplainable surges in the sensor readings when light levels are constant. It's probably a reason why ODMs don't bother to try to make auto-backlight work any lower.

Thanks originally to Koush for his LightSensor SDK reference as well as Scott Seligman for the C++ reference.

Advantages:
  • works with native OEM backlight without extra .NET layer
  • history-less sensor-data filtering
  • Native C++ and assembly, floating-point-less DSP/SIMD-accelerated math, and extra optimization analysis in Ida Pro.
    No CPU/power-sucking .NET, nor the standard/default software floating-point emulation used.
  • takes 1K of ram, 22K of storage
  • 0 process slots (runs as a service)
  • no notable power-draw (same amount of power ~53mA with service on/off on Fuze)
  • polls every ~2000 milliseconds
  • no HTCSensorSDK sensor-data lag (~200-300 ms) nor cpu load -- directly accesses the sensor driver
  • dll and supporting code are compressed independently of .cab and use cpu's smaller Thumb (16-bit) code when advantageous
  • mostly lockless multi-threading
HKCU/Software/Creative 'Ware/LevelSight:
offset: adjusts backlight levels positive or negative of oem-pick
low_wm: fuzzy point where it low-light auto-backlight (2 is default recommendation)
high_wm: fuzzy point where offset auto-backlight will turn on (5 is recommendation)

Tested with stock Fuze rom, and Acer m900 160-lite rom.

Release Notes:
-current(1.1.0.x series)
1.1.0.2: fix bug where max backlight was clamped to level 5. It now uses the full 1-10 (10 levels) range. Level 0 disabled because not useful.

1.1.0.1 2009.09.04: full-backlight enhancement for Acer m900 ONLY!! Backport to FUZE whenever.
Acer 900s version abandoned because of Clove Technology.

-stable(1.0.3.x series)
1.0.3.2 2008.02.19: full-backlight replacement

-obsolete(1.0.2.x series)
1.0.2.1 2008.12.03: reset hysteresis on backlight power-state edge
1.0.2.0 2008.12.03: hysteresis now using first-order low-pass filter with a medium α; math and power-state optimizations

obsolete (1.0.1.x series) LevelSightSvc.1.0.1.1.CAB (11.8 KB, 132 views)
1.0.1.1 2008.11.24: work-around for service not starting up when device is rebooted; tweaked hysteresis
1.0.1.0 2008.11.21: converted into a service with registry configurable water marks

1.0.0.3: better hysterisis
1.0.0.2 2008/11/16: Previous version tended to like it dark and resisted turning it up.

Adjusted dark/light sensitivity so it switches auto-off at light sensor 3::3, and switches it back on at 3::5. Still playing with this to get a better hysteresis.
Attached Files
File Type: cab LevelSightSvc.1.0.2.1.CAB - [Click for QR Code] (11.9 KB, 405 views)
File Type: cab LevelSightSvc.1.0.3.2.CAB - [Click for QR Code] (12.3 KB, 539 views)
File Type: cab LevelSightSvc.1.1.0.2.CAB - [Click for QR Code] (12.9 KB, 570 views)
active: HTC G2 -- B&N NookColor -- Nexus 7(2012) -- SG4 (M919 & GPE)
Support what I do and donate me a frankfurter.
 
DeepThought
Old
#2  
DeepThought's Avatar
Senior Member
Thanks Meter 1
Posts: 748
Join Date: Jul 2006
Location: Austria, Vienna
Thank you Sir! That's exactly the kind of app I was waiting for. From what it sounds like I much prefer your solution over G-Light! I will test it right away!

----------------------------------------------------------------------------------------------------
History: Wallaby > Himalaya > Blue Angel > Universal > Hermes > Palm Treo 750 > Kaiser > Raphael
My Apps: hTorch v3.2 | using camera LED as flashlight --> Last Updated: 2008-11-20
 
DeepThought
Old
#3  
DeepThought's Avatar
Senior Member
Thanks Meter 1
Posts: 748
Join Date: Jul 2006
Location: Austria, Vienna
NuShrike, the app doesn't seem to work for me. I've installed it and did a soft reset afterwards (just to make sure) but the backlight still never falls below level 3. In my AC/Batt settings I have the backlight auto configuration enabled and did also try to disable this with the same result.

Am I making some mistake?

I'm really looking forward to get this sorted out because I love the idea of your app!

----------------------------------------------------------------------------------------------------
History: Wallaby > Himalaya > Blue Angel > Universal > Hermes > Palm Treo 750 > Kaiser > Raphael
My Apps: hTorch v3.2 | using camera LED as flashlight --> Last Updated: 2008-11-20
 
itoYo
Old
#4  
Senior Member
Thanks Meter 0
Posts: 346
Join Date: Apr 2007
Location: ASDA
same here! tried it with duttys rom
 
lotion
Old
#5  
Senior Member
Thanks Meter 0
Posts: 129
Join Date: Jun 2006
Location: Boston, MA
Same issue with stock fuze rom. Definitely looking forward to this app.
 
DeepThought
Old
#6  
DeepThought's Avatar
Senior Member
Thanks Meter 1
Posts: 748
Join Date: Jul 2006
Location: Austria, Vienna
I just analyzed the running processes after soft reset and the app is not running even tough it is placed in startup. so I just tryed starting the process manually but even when it's running it is not working

----------------------------------------------------------------------------------------------------
History: Wallaby > Himalaya > Blue Angel > Universal > Hermes > Palm Treo 750 > Kaiser > Raphael
My Apps: hTorch v3.2 | using camera LED as flashlight --> Last Updated: 2008-11-20
 
TheMostToys
Old
#7  
Senior Member
Thanks Meter 13
Posts: 122
Join Date: Aug 2007
Location: Austin
Great idea, but does not work consistently. I've tried to narrow it down to a repeatable scenario, but have not been successful. I can see the LevelSight.exe process running (BTW, it takes approx 2.4% of my cpu every three seconds, then idle for three seconds.) LevelSight initially appears to work as designed, but after a few light cycles, it stops enabling the auto adjust setting.
 
TheMostToys
Old
#8  
Senior Member
Thanks Meter 13
Posts: 122
Join Date: Aug 2007
Location: Austin
Just did some more testing. If I go in and manually enable auto adjust (in Power settings) it will work as long as the light level is high. Then when light level is low, LevelSight will disable auto adjust (setting backlight level to what I have it set to) but never reenable auto adjust (no matter how bright the ambient light.) So it seems to half way work, it does consistently disable auto adjust but it never enables it.
 
TheMostToys
Old
#9  
Senior Member
Thanks Meter 13
Posts: 122
Join Date: Aug 2007
Location: Austin
More testing. Seems that if I let the phone dim the backlight all the way to dark setting (30 seconds) and hit it with bright light before it goes to sleep, LevelSight will enable the auto setting and the light will come up. This might cause a problem with the auto dim. Hmm, still playing.
 
NuShrike
Old
#10  
NuShrike's Avatar
Senior Recognized Developer - OP
Thanks Meter 9
Posts: 1,036
Join Date: Sep 2007
Okay, I've tried playing with the turn-on trigger a bit to see if that helps. It was programmed in the dark with a flash-light and now just tested in the sun today.

Version 1.0.0.2 is a little better at turning auto-back on, but may be still be not quite "right" in my experience.

Here's an interm version to get it more usable while I try to find the better "fuzzy" logic for the trigger.

TheMostToys: How are you measuring CPU usage? I'm using TaskManager and it's showing cpu in the range I described.

DeepThought: do you have HTCSensorSDK.dll in your \Windows? I assume a Raphael rom is built mostly the same as a Fuze's so I'm not sure why else it's not running for you. It will refuse to run more than one at a time also, and soft-reset may clear up the self-lock if that's the problem. If not, I'll post up a debug app to see what's going on.

My Fuze did get all app security turned off so I may not be properly triggering the needed security dialogs.

Tags
auto-backlight, backlight
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...