• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[APP][2.3+] Lux Auto Brightness

Search This thread

Cyb3rGlitch

Senior Member
Apr 12, 2011
599
663
2 Quick questions :
- GSam Battery Monitor reports that Lux makes wide use of gyroscope :confused:
How does gyroscope helps Lux?

- On Galaxy S2 the sensor reports 1lx while your eyes can still cleary see arround:D...
Could it be possible to add a fonction in Lux that would switch to camera reading when light sensor has reach its lower limit?

Thanks

1. I have no idea what's causing that. There's no reference to any Gyroscope within the code. :/
2. That was my original plan, but I'm still not happy with the experiments I've done. Maybe in a future update.
 
  • Like
Reactions: bleuxeon

bleuxeon

Senior Member
Jan 25, 2012
800
282
Near COGNAC (FR)
1. I have no idea what's causing that. There's no reference to any Gyroscope within the code. :/
2. That was my original plan, but I'm still not happy with the experiments I've done. Maybe in a future update.

ok thanks.

---------- Post added at 04:55 PM ---------- Previous post was at 04:34 PM ----------

Maybe I have an answer : I just tried to find GSam developper's adress in Google Play then I see that, in developper other apps, that he was ALSO the dev of Screen Dimmer :D:D:D...

So I wonder now if it's not an intentionaly introduced bug in GSam Battery Monitor...:cool:
 

Cyb3rGlitch

Senior Member
Apr 12, 2011
599
663
Sorry guys, just released another update (v0.72). I accidentally called the wrong method when resuming the Dashboard which broke subzero/night modes. >_<

New version includes updated RootTools library, so see if integrating into OS works (for those who were having trouble).
 
  • Like
Reactions: bleuxeon

WibblyW

Senior Member
May 24, 2011
661
107
Google Nexus 4
Moto X Play
Some points on latest version, using it on stock Nexus 7

  1. Can you give a little explanation on the difference between 'Dynamically' and 'Ascendingly' auto modes, please? What's the difference in the algorithm that causes a brightness update?
  2. On the N7 there is no widget available. Is this removed now?
  3. On the expanded notification, there is a "sleeping" mode. What does this do? It can be set even when Lux is in manual mode.
  4. On the main 'pop up' UI, Night mode and Astronomer mode seem to have no effect. But Night mode works from the notifications.
 

Cyb3rGlitch

Senior Member
Apr 12, 2011
599
663
Some points on latest version, using it on stock Nexus 7

  1. Can you give a little explanation on the difference between 'Dynamically' and 'Ascendingly' auto modes, please? What's the difference in the algorithm that causes a brightness update?
  2. On the N7 there is no widget available. Is this removed now?
  3. On the expanded notification, there is a "sleeping" mode. What does this do? It can be set even when Lux is in manual mode.
  4. On the main 'pop up' UI, Night mode and Astronomer mode seem to have no effect. But Night mode works from the notifications.

1. Dynamically will adjust the brightness up/down when lux values change significantly, whereas ascending mode will only adjust upward, then reset when the phone resumes from standby.

2. Widget is definitely there. Have you tried rebooting your N7?

3. Sleep mode removes Lux's overlays (sub-zero/night/astro modes), which is useful for taking screenshots or if you're using a secure app.

4. Yep, my bad. New update rolling out. Third time's a charm. >_<
 

Cyb3rGlitch

Senior Member
Apr 12, 2011
599
663
ok thanks.

---------- Post added at 04:55 PM ---------- Previous post was at 04:34 PM ----------

Maybe I have an answer : I just tried to find GSam developper's adress in Google Play then I see that, in developper other apps, that he was ALSO the dev of Screen Dimmer :D:D:D...

So I wonder now if it's not an intentionaly introduced bug in GSam Battery Monitor...:cool:

Heh, maybe. I prefer BetterBatteryStats anyway, seems a lot more accurate.
 

Cyb3rGlitch

Senior Member
Apr 12, 2011
599
663
I also have BetterBatteryStats (paid) :good:

---------- Post added at 05:22 PM ---------- Previous post was at 05:17 PM ----------

I just updated from Google Play but the "new" version is still 0.71 and "Integrate into Android" still failled :cyclops:

v0.72 has the update. Anyway, going to release v0.73 soon. It improves the performance of the lux readings on the Dashboard. Then hopefully everything is fixed for now. :/
 

bleuxeon

Senior Member
Jan 25, 2012
800
282
Near COGNAC (FR)
I have an idea that could be a workaround for adjusting screen level for very low light conditions :

-everyday's life, you would probably never stay in a very low light environement for more....mmmhhh...lets say 10 min (unless hiding from your mistress's husband in a wardrobe :D...) , so its not very important to try to reduce screen power during those 10 mins.

BUT

At full night (without any artificials lights) it could be very usefull (while night, in a Cinema etc...) to deem much more the screen.

The idea is when the light sensor read 1 or 0 lux for more than 10 mins or x sensor readings, then Lux would decrease screen brithness to a lower level than the lowest linked sample.

I don't know if I m clear...
 

Cyb3rGlitch

Senior Member
Apr 12, 2011
599
663
I have an idea that could be a workaround for adjusting screen level for very low light conditions :

-everyday's life, you would probably never stay in a very low light environement for more....mmmhhh...lets say 10 min (unless hiding from your mistress's husband in a wardrobe :D...) , so its not very important to try to reduce screen power during those 10 mins.

BUT

At full night (without any artificials lights) it could be very usefull (while night, in a Cinema etc...) to deem much more the screen.

The idea is when the light sensor read 1 or 0 lux for more than 10 mins or x sensor readings, then Lux would decrease screen brithness to a lower level than the lowest linked sample.

I don't know if I m clear...

I think I get what you're saying. I did consider something like this, but I still need to experiment. I think it's better to use the camera to confirm than to try and guess. I have other more reliable ways of checking too, but they're still experimental. I can't say what, because I have competitors who will jump at the chance to implement it "first", even if it's just hacked in quickly to claim the title.
 

chantoine

Senior Member
May 10, 2011
437
113
www.cabinet-antoine.fr
At full night (without any artificials lights) it could be very usefull (while night, in a Cinema etc...) to deem much more the screen.

The idea is when the light sensor read 1 or 0 lux for more than 10 mins or x sensor readings, then Lux would decrease screen brithness to a lower level than the lowest linked sample.

I don't know if I m clear...

I'd like this behavior too... i often read my Note in the bed, and have to manually adjust brightness...
 

bleuxeon

Senior Member
Jan 25, 2012
800
282
Near COGNAC (FR)
I miss to explain that the idea is to bring a diffent screen brightness behavior ONLY after 10 mins, because after 10 mins there is a good chance for ambient light to be very dark.

After this condition is true for 10 mins (light sensor = 1lx), then Lux could to a much lower screen brightness, but also double (or triple) the delay between 2 sensor measurments.

The result should be a nice battery saving since
1) the sensor would be 3 time less solicited
2) the screen brightness would be much lower during 6-10 hours (depending on how long you are in bed or cinema:D)
 

Cyb3rGlitch

Senior Member
Apr 12, 2011
599
663
I miss to explain that the idea is to bring a diffent screen brightness behavior ONLY after 10 mins, because after 10 mins there is a good chance for ambient light to be very dark.

After this condition is true for 10 mins (light sensor = 1lx), then Lux could to a much lower screen brightness, but also double (or triple) the delay between 2 sensor measurments.

The result should be a nice battery saving since
1) the sensor would be 3 time less solicited
2) the screen brightness would be much lower during 6-10 hours (depending on how long you are in bed or cinema:D)

Well, the way sensor reads work on Android is different to you think. I don't poll the sensor when I want a reading, I need to pass it a listener. Android will trigger that listener whenever a new lux reading occurs. I have control over the rate that this trigger happens, but I can't poll the sensor directly. So in a dark room, chances are it'll never get triggered more than once anyway.

I'll still play around with the idea though, because it does sound reasonable. My main concern is that dodgy sensors will report 1 lux often, so it may accidentally trigger. Also, 10 minutes is a lot of time to wait for an adjustment.
 
  • Like
Reactions: bleuxeon

bleuxeon

Senior Member
Jan 25, 2012
800
282
Near COGNAC (FR)
Well, the way sensor reads work on Android is different to you think. I don't poll the sensor when I want a reading, I need to pass it a listener. Android will trigger that listener whenever a new lux reading occurs. I have control over the rate that this trigger happens, but I can't poll the sensor directly. So in a dark room, chances are it'll never get triggered more than once anyway.

I'll still play around with the idea though, because it does sound reasonable. My main concern is that dodgy sensors will report 1 lux often, so it may accidentally trigger. Also, 10 minutes is a lot of time to wait for an adjustment.

I agree that 10 min is high before going lower brightness, but actualy, as I m writting this post in my office, I can tell you that sensor reads 1 to 6 lux but the screen of my Galaxy S2 needs at least 12% in Lux, while tonight, when I would be in bed, then it would only require something like -60%!

Those 10 mins should be something that user could set according to his usage.:good:

Thanks again for trying to anderstand my poor english:D
 

SirBrettrick

Member
Jul 9, 2010
35
10
Fort Worth, TX
Yeah, I just updated to 0.73 but the app still identifies itself as 0.71 (assuming that's just a minor oversight) and the root integration still isn't working on CM10.

Sent from my Captivate
 

Top Liked Posts

  • There are no posts matching your filters.
  • 160
    unnamed.png


    Lux - The Original Android Auto-Brightness App

    So I thought I should make an XDA thread for Lux, over a year after releasing it to the Play Store!

    FULL or FREE


    Issues/Suggestions

    If you have any issues or suggestions, please add them to the public issue tracker found here. Be sure to search first, duplicated issues will not work in your favour.


    News
    • Update to 1.51 released to Play Store!
      - Profiles. Have different behaviour for day and night!
      - Root plug-ins. Custom kernel with RGB control? Make a plug-in to utilise it!
      - Improved notification
      - Low pass filter
      - Cubic interpolation
      - Polish/French/Russian/German/Italian translation
      - Manual sunrise location input
      - Control Dashboard slider with vol. keys
      - Fade duration/step
      - Reduced battery usage
      - Fixes

    • Update to 1.06 released to Play Store!
      - Automatic night mode (uses location for sunset/sunrise).
      - Notification priority
      - Enhanced dashboard and notification UI
      - Enable/disable and refresh Lux via Tasker
      - Bug fixes

    • Update to 0.76 released to Play Store!
      - Fixed brightness issues after call

    • Update to 0.74 released to Play Store!
      - Fixed max/phone brightness preferences swapped
      - Added ignore 0 lux option
      - Made static phone brightness optional

    • Update to 0.70 released to Play Store!
      - New 'ascending' automatic mode for zero jitter!
      - Expandable notification for added control (Android 4.1+)
      - Improved efficiency
      - Install to OS functionality
      - Set min/max brightness bounds
      - Adjustable night mode
      - Improved persistence (Android won't kill it!)
      - Fixed Nexus 7 255 luma bug
      - Fixed Tasker 'on wake' revert bug
      - Compat. mode is now known as 'sleep mode'
      - Night Mode now default Dashboard action (hold for Astro. mode)
      - Misc. tweaks and fixes.

    App Description

    Lux isn't your ordinary brightness app. It intelligently adjusts the brightness of your display based on the environment you're in. If, for example, you step into a dimly lit room, Lux will automatically lower the brightness of your display to make it not only comfortable to read, but to also preserve battery power.
    Lux provides the option to automatically adjust the backlight at fixed intervals (periodic mode), when a change in environment is detected (dynamic mode), or when the phone wakes from sleep. It's also possible to adjust the backlight manually. Simply disable automatic mode and you can use it like a traditional brightness tool!
    Perhaps the best thing about Lux is that you can teach it how to behave. If the backlight is too bright or dim for your liking, simply open the provided Dashboard, adjust the brightness slider to the level you desire, then hold the link button. Lux will use this new 'link' as a reference in future.

    Give it a go! I want you to test Lux for more than the 15 minute refund period offered by Google. I understand that some devices may not have the best quality light sensor, and that you may need more time to play around with settings. If you find that Lux doesn't suit you after the 15 minutes is up, you can request a refund at any time via e-mail - no questions asked.

    ★FEATURES★
    ■ Custom auto brightness.
    ■ Sub-zero brightness to make reading in the dark significantly less irritating.
    ■ Battery efficient
    ■ Handy brightness widget
    ■ Option to use the camera to read in ambient light.
    ■ Power-user settings such as choice of interpolation, sensor debugging, and linked sample editing.
    ■ Backup to SD.
    ■ 'Ascending' auto mode for phones with inaccurate light sensors.
    ■ Gradual fade for backlight adjustments.
    ■ Astronomer mode adds a red filter to the screen to preserve the eyesight of stargazers.
    ■ Jitter control to prevent constant small changes to the backlight.
    ■ Automatic night mode, to change the colour temperature of the display for comfortable night time viewing.
    ■ Add app specific exceptions via sleep mode
    ■ No ads, or other nuisances.
    ■ Tasker and Locale support!
    Note: Please disable other brightness apps before using Lux. The author is not liable for any issues caused when using this app.

    ★PERMISSIONS★
    TAKE PICTURES AND VIDEOS: Used to read in luma values, if camera input is selected.
    DRAW OVER OTHER APPS: Required for night/astro mode.
    READ PHONE STATE: Required to prevent Lux from interfering with phone controls in Android 4.1.
    MODIFY SYSTEM SETTINGS: Brightness is a system setting, as is toggling the default auto brightness.
    RETRIEVE RUNNING APPS: Required to make the 'sleep list' functionality work, so Lux can disable itself when certain apps are in the foreground.
    COARSE LOCATION: Required to automatically calculate sunrise/sunset times.
    IN APP BILLING: Required for purchasing future device specific root only plug-ins, to enhance functionality.
    14
    Lux Low-Level Plug-ins

    Soon Lux will support plug-ins to bypass Android API limitations. These plug-ins serve to replace the overlay system Lux uses to make adjustments for Night/Astronomer modes and brightness in general. The plug-in library is free to use for non-commercial development, and can be found here:

    Lux Plug-in Library | Nexus 4 Sample Plug-in Code

    How to make a plug-in

    There are two approaches to making a plug-in for Lux. The passive and the active method. The former is as easy as providing a set of superuser commands for Lux to interpret and apply. These command correlate to functions such as setting pixel RGB or brightness levels. This is the type of plug-in the Nexus 4 sample linked above takes.
    The active method requires you produce your own code to perform RGB/brightness adjustments. This might include importing a device specific library to do the heavy lifting, and then returning empty superuser commands back to Lux.


    Getting Started

    Simply import the Lux Plug-in Library source into your IDE as an Android Library Project, and then create a new Android app which extends PassiveDisplay.java.

    PassiveDisplay provides hooks into Lux's plug-in framework, which you can use to provide superuser commands for Lux to execute. These commands correlate to functions such as setting RGB values. Take a look at the sample Nexus 4 project to see how it's all done.
    Finally, in your new project's AndroidManifest.xml file, add the following:

    Code:
        <activity
            android:name="com.vitocassisi.lux.plugin.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    
        <receiver
            android:name="com.vitocassisi.lux.plugin.LuxBroadcastReceiver"
            android:exported="true" >
            <intent-filter>
                <action android:name="com.vitocassisi.lux.plugin.search" />
            </intent-filter>
        </receiver>
    
        <service
            android:name=".[B]MY_PLUGIN[/B]"
            android:exported="true" >
            <intent-filter>
                <action android:name="[B]YOUR_PACKAGE_NAME_HERE[/B]" />
            </intent-filter>
        </service>

    Be sure to replace YOUR_PACKAGE_NAME_HERE with the name of your plug-in's package, and MY_PLUGIN with your extended PassiveDisplay class.

    And that's it! Now you're ready to test!


    Enabling Plug-In support within Lux

    To enable plug-in support, you must check 'Enable plug-in support' in the Advanced section of Lux settings. Enabling this option forfeits all responsibility of mine for any issues caused while using Lux. Plug-in's can cause very real damage to your device if they're written incorrectly - don't use plug-ins from sources you don't trust!
    Testing your plug-in
    Testing is critical for creating a good plug-in. You are dealing directly with system files, and can easily cause damage if you do not know what you're doing.

    DO NOT RELEASE A PLUG-IN WITHOUT TESTING IT ON THE TARGET DEVICE FIRST!

    Ensure that the following work with your plug-in installed:
    • Astronomer Mode
    • Night Mode
    • General brightness adjustment
    • Lux readings functional

    BE METICULOUS WITH YOUR IMPLEMENTATION OF isSupportedDevice()!
    Modifying system files on the wrong model/kernel may cause irreversible issues!


    Licence
    Code:
    Copyright © 2013 Vito Cassisi
    
    You may not use this library except in compliance with the following:
        - It cannot be used for commercial purposes under any circumstances, unless explicit permission is granted in writing from the author.
        - Modifications to this library may not be distributed.
    
    Unless required by applicable law or agreed to in writing, software
    distributed under this licence is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    11
    Lux v1.99.8 released (staged rollout)

    - Added CF.lumen support (don't need CF.lumen active, just install the driver). Acts as a plug-in for all Android 4.4+ devices. Please buy the pro version to support his work.
    - System autobrightness enabled during calls
    - Option to shake at lockscreen to increase brightness
    - Option to prevent drop in brightness in landscape
    - Enforced persistent notification, added system removal method
    - Fixed dashboard width issue
    - Fixed notification priority resetting at boot
    - Misc. fixes
    11
    Hey everyone. Sorry to hear that people are having issues with the paid version. I'm working on hotfixes at the moment. A lot of these bugs don't appear on my test devices, which is why regressions happen seemingly randomly. I'm working hard on finding a reliable way to reproduce and test these issues to prevent this happening again.
    9
    Apologies to everyone for not being around lately. I've been answering support via email.

    A new release is rolling out on the market to 5% of users. Please use the 'Send Feedback' button in Lux preferences if you experience issues. Also, feel free to email me with any questions or concerns.