[APP][2.3+] Lux Auto Brightness

Search This thread

jan.ringas

Senior Member
Feb 5, 2011
221
107
37
Münster
Xiaomi Poco X3 NFC
OnePlus 9 Pro
This never was fixed.

Could someone look into this? I'd be happy to provide additional data, if needed.

On my Nexus 4 it's working as intended: after a short loading time a list with my installed apps pops up where I can mark apps I want to add to the sleeping list. Maybe some Galaxy SIII related problem?

Edit: I'm not sure, but maybe you could have a look into your logcat after the failure you described happened? Maybe it contains some information why you don't get the list with the installed apps.

How many apps do you have installed? Maybe there are too many which causes the loading of the list to fail.
 
Last edited:

WibblyW

Senior Member
May 24, 2011
741
137
Google Nexus 4
Moto X Play
Is there a way to use the locale plugin to flip between screen on and dynamic modes refresh modes?

Also I have tried the force refresh locale plugin feature which does not save when using llama (nor locale) all other locale plugin I have tried so far with llama work fine.

Sent from my Nexus 4 using Tapatalk 2
 

Cyb3rGlitch

Senior Member
Apr 12, 2011
599
663
I've been using Lux for a bit now and I notice occasionally that it stops working. Upon further investigation, I open the app up and manually refresh it. The lux value would never seem to adjust. I could put my hand over the light sensor and nothing would happen, and vice versa. I went into the debug and it would show no reading for either the light or proximity sensor.

A restart would fix this ultimately.
But today I downloaded an app called sensor test, and immediately upon opening the app lux automatically went back to adjusting my screen brightness. A quick check of debug and it was indeed reading different values again.

Now, I would put this in the bug tracker, but I'm not quite sure if this is a bug with lux or if Cyanogenmod is causing it. Has anyone else encountered anything like this?
That does sound odd. I think that may be a weird ROM issue where it's deciding to stop outputting values until another listener is added. I can't explain why Lux would suddenly start working otherwise.

From Better Battery Stats and WLD. Overnight with the phone on my bed stand (screen off)

Plenty of wake locks though fortunately it's not figuring high up in the battery consumers.

From the feedback option (taken later this morning after the phone had been charged):

--- BELOW FOR DEVELOPER USE ---
Lux Version: 1.11
Manufacturer: LGE
Model: Nexus 4
Brand: google
Device: mako
Display: JDQ39
Hardware: mako
ID: JDQ39
Product: occam
Tags: release-keys
Type: user

Linked samples (lux):
0 1
35 3
100 12
10000 100

Linked samples (luma):
1 1
255 100

Preferences:
phonebright: 80
responseup: 550
enable: true
camIndexPref: 1
buttonBacklight: 1
minbright: 1
enablephone: false
brightness: 0.0298
pollrate2: 500000
offset: 1
widget: false
fade: true
notifpriority: 1
hasroot: false
maxbright: 100
responsedown: 5550
autoPeriods: 5
lastAutoMode: 2
cammodes: 0
ignorezero: false
persistent: true
autoModes: 2
ac: false
lightModes: 0
interpModes: 0
acra.lastVersionNr: 111
jitter: true

Hardware:
Light sensor name: LGE Light Sensor
Light sensor vendor: Avago
Light sensor version: 2
Light sensor resolution: 0.009994507
Light sensor power (mA): 0.175

Prox sensor name: LGE Proximity Sensor
Prox sensor vendor: Avago
Prox sensor version: 2
Prox sensor resolution: 0.10070801
Prox sensor power (mA): 12.675

I'm going to experiment with the AlarmManager and see if I can work out what's causing that. I was under the impression that alarms wouldn't trigger during sleep.

EDIT: This is the constant I use http://developer.android.com/reference/android/app/AlarmManager.html#ELAPSED_REALTIME
It says "This alarm does not wake the device up". So either that app includes 'wakelocks' that occur during normal use of the device, or the figure is incorrect.

This never was fixed.

Could someone look into this? I'd be happy to provide additional data, if needed.
Does it crash when this happens?

Is there a way to use the locale plugin to flip between screen on and dynamic modes refresh modes?

Also I have tried the force refresh locale plugin feature which does not save when using llama (nor locale) all other locale plugin I have tried so far with llama work fine.

Sent from my Nexus 4 using Tapatalk 2
There's no way to swap modes via Locale yet. I'll look into your other issue.
 
Last edited:

flash5000

Senior Member
Jul 11, 2009
264
172
As it says in the quote "Have to open the Lux pop-up control panel to get it to update the brightness."

I know, but this is not the way I want Lux to work - if I need to open the dashboard every second time I activate the display, there's not much comfort in using Lux...

Gesendet von meinem Nexus 7 mit Tapatalk 2
 

WibblyW

Senior Member
May 24, 2011
741
137
Google Nexus 4
Moto X Play

WibblyW

Senior Member
May 24, 2011
741
137
Google Nexus 4
Moto X Play
EDIT: This is the constant I use http://developer.android.com/reference/android/app/AlarmManager.html#ELAPSED_REALTIME
It says "This alarm does not wake the device up". So either that app includes 'wakelocks' that occur during normal use of the device, or the figure is incorrect.

Two wakelock monitoring apps report this. WLD and BBS. Both got it wrong? Maybe there's a bug where the alarm DOES wake the device? I don't know how Android works, but could some other process app be waking the device up (partial wakelock) and then this alarm is registered?

Sent from my Nexus 4 using Tapatalk 2[
 
Last edited:

WibblyW

Senior Member
May 24, 2011
741
137
Google Nexus 4
Moto X Play
flash5000, I agree with you - I replied because I misunderstood you comment. I think there's a bug somewhere causing this Lux behavior :(

Deleted post

---------- Post added at 07:28 AM ---------- Previous post was at 07:18 AM ----------



Getting this on Nexus 7 as well as Nexus 4. Both stock, unrooted, locked.

Sent from my Nexus 4 using Tapatalk 2

EDIT: I'm now thinking this may be the jitter control working. At low ambient light levels I think, for me, it gets in the way as 5% change in lux level seems more significant and I'm expecting to see a screen brightness change. I have unticked it and will see how I get on...
 

elite_gamer04

Senior Member
Oct 30, 2006
678
118
Running the latest 1.12 Lux on my Nexus 4 - for the life of me (and I think I might be going made, but though I'd report it nonetheless), with Auto - On Wake it seems to be choosing higher brightness values then previous versions for the same situations, its weird...

I know 'translations/locales' was only change - but thought I would make the Dev aware. On a side-note if I adjust the 'samples' to so that both values are lower on each end of the scale, it SHOULD effectively choose lower values and save more battery no?

For example in stead of 0-100%, doing -25 to 75% would result in lower values chosen?
 

habylab

Senior Member
Dec 3, 2010
6,228
1,200
Hey, is there anyway this can take advantage of AndreiLux's new brightness increase in his Perseus kernel for the galaxy s3? Thank you.

Sent from my Galaxy S3. Long live the original Galaxy S :)
 

ikjadoon

Senior Member
Jul 4, 2012
867
437
Lenovo P11
I'm going to experiment with the AlarmManager and see if I can work out what's causing that. I was under the impression that alarms wouldn't trigger during sleep.

EDIT: This is the constant I use http://developer.android.com/reference/android/app/AlarmManager.html#ELAPSED_REALTIME
It says "This alarm does not wake the device up". So either that app includes 'wakelocks' that occur during normal use of the device, or the figure is incorrect.

Something about Lux is definitely triggering a wakelock. I had over 6000 wakelocks seen by Wakelock Detector for Lux when I ran it overnight. It's not an error: it's actually Lux. :(

How I know: my Wi-Fi sleep policy is to turn off during sleep. If something holds a wakelock, though, it will be awake and Wi-Fi will constantly be on. See the attached picture. I force stopped Lux and my Wi-Fi finally turned off; see where the Wi-Fi turns off finally after being constantly on? That's exactly when I force stopped Lux.

Let me know if you need any more information or anything; very willing to help! :)
 

Attachments

  • uploadfromtaptalk1367283289047.jpg
    uploadfromtaptalk1367283289047.jpg
    63.8 KB · Views: 455
Last edited:

WibblyW

Senior Member
May 24, 2011
741
137
Google Nexus 4
Moto X Play
EDIT: I'm now thinking this may be the jitter control working. At low ambient light levels I think, for me, it gets in the way as 5% change in lux level seems more significant and I'm expecting to see a screen brightness change. I have unticked it and will see how I get on...

I found brightness was still getting stuck until I opened the popup settings, then it refeshes.

Now I've switched to Periodic instead of Dynamic updates and it's ok so far, so maybe the problem is only with the Periodic settings.
 

nurps

Senior Member
Dec 8, 2008
902
79
I'm getting a lot of Alarm Manager partial wakelocks from Lux on my Xperia Z. Why, it shouldn't do anything if the device is off? I'm running it with the dynamic setting.

Also Lux was using my sensor for almost 5 hours, my screen was only on half that time.
 
Last edited:
T

toastgodsupreme

Guest
Constant calls from the alarm manager even though I have it set to adjust brightness only on screen wake. No location services have been enabled for the device and it's on slowest poll rate yet it's doing them pretty frequently in debugs (every 6 seconds).

Questions now...
If brightness adjust is set to happen on screen wake, why is it still constantly being called from AlarmManager?
Wouldn't it make sense to use android.intent.action.SCREEN_ON?
Why is it checking when the screen is off?

Definitely can't recommend or buy this until these are answered/resolved.
 

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.