MIUI Auto Brightness Fix (Magisk Mod) - Xiaomi Mi Mix 2S Themes, Apps, and Mods

Do you have problems with auto brightness in MIUI roms? Your screen brightness gets extremely dark in low light conditions, or the brightness spikes just with a few increase of light?
For low brightness problem, actually you can adjust the minimum autobrightness in slider bar, but sometimes it will reset back to default minimum brightness. For example if you turn off auto brightness in game, when you turn it on again, it won't resume your settings. As a result the screen will get darker than your adjustment.
I created magisk module to fix that. This will increase the minimum brightness in low light, and also reduce the over brightness in medium and high ambient light. The result will be smoother auto brightness step, and be more convenient for your eyes!
There are two modules, one for Miui 10 running Android Pie, and the other ones for Miui 10 running Android Oreo. Dont install wrong module, because there are much more brightness values in Android P than O.
The Oreo version may be not as good as Pie version, because i tested it in Redmi Note 5. My Mi Mix 2s currently running Miui 10 P beta 8.8.16 for Pie version testing. But it should give the same result. Oreo version works in Miui 9 too, but may results different.
So what this module do? It adds framework-res to the /system/media/theme/default. With a magisk module you can do it systemlessly! To install it, just download the module then browse it in Magisk Manager.
If you dont like my setting values, just unzip my module, find framework-res file, unzip it, then edit the theme_values.xml to any values you want under "config_autoBrightnessLcdBacklightValues", then zip all back.
Download links in attachment.
Guide:
V1 for lowest brightness (best battery)
V2 for a bit brighter in low light
V3 for brighter brightness (best for full edge cover tempered glass user)
V4 for more responsive and smoother auto brightness. Values are about similar to v3.
To check if this module works;
Tap the Kernel Version in About Phone 5 times, then you will enter CIT. Go to Light Sensor. Cover your phone light sensor on upper bezel (lower for Mi Mix 2s) with your palm till the light sensor value reach 0. If the backlight is not going under 100/130 (pie) or 7 (oreo), then this module works! My module limits the minimal auto brightness, which the original can reach to 20 which is ridiculously very dark.
This module may work on any MIUI-based rom phones with IPS display, not just Mi Mix 2s.
I also created this module for Mi 9 (amoled display). Visit my thread HERE
Notes:
- Only V4 has responsitivity adjustment. More responsive means it needs less light increments to trigger auto brightness adjustment.
- Editing the values can cause a mess. Add .disable_magisk file in cache partition if your phone cant boot then uninstall the module in manager.

Thanks have flashed this and will see how it goes over a day/night. Initially it's good though.
I find the auto bright annoying sometimes especially given how easy it is to cover the bottom chin sensors on this phone.
M.

mattman83 said:
Thanks have flashed this and will see how it goes over a day/night. Initially it's good though.
I find the auto bright annoying sometimes especially given how easy it is to cover the bottom chin sensors on this phone.
M.
Click to expand...
Click to collapse
Thanks for trying. I hope you get better auto brightness experience after a day..
Yeah the worst part is the light sensor in mix 2s located in bottom left where you could get the screen unseenable while using two/left hands. If its in center, it would be better.
My other mi phone with forehead light sensor often gets annoyingly too dark. I never satisfied with miui default auto brightness and always use this mod since miui 7. Fortunately, this method still works with some adjustment in value.

Ok so it's been a couple of days and this has helped a lot imo at least for indoors (haven't really had any major outdoors time...).
Still gets dark enough when it's really dark, but certainly for normal indoor conditions the default settings you have are much better. Xiaomi settings often got too dark, and you can adjust the slider, but then the slider goes back after while anyway :-\
M.

Just reporting back after a while with this and more miui updates, seems the later beta builds have changed something in the brightness in that I don't know if this mod works any more, or if it needs tweaking to provide the same brightness levels it used to.
I had a really quick play with values as suggested in the op but it's well outside my field of expertise and couldnt get it to do much different
M.

@arddy1
... where to find the default values ?
I'm on Poco F1 and want to compare to the default values and adjust theme_values.xml

mattman83 said:
Just reporting back after a while with this and more miui updates, seems the later beta builds have changed something in the brightness in that I don't know if this mod works any more, or if it needs tweaking to provide the same brightness levels it used to.
I had a really quick play with values as suggested in the op but it's well outside my field of expertise and couldnt get it to do much different
M.
Click to expand...
Click to collapse
Sorry for late reply. This mod still works in miui 8.10.11 global. Here are the screenshots of screen light value in lowest brightness. The lower one is the original. Mine still brighter in lowest light.

der_Kief said:
@arddy1
... where to find the default values ?
I'm on Poco F1 and want to compare to the default values and adjust theme_values.xml
Click to expand...
Click to collapse
Here's the screenshot from framework_res in rom 8.10.11 global

So it only works on miui

Yes since it's a miui issue. Stock android roms don't reset brightness like miui.
Stock roms just set the brightness bar where you want, some will have the ability adjust the total curve even. Miui if you raise brightness it will change itself back after 5 mins or so, so it's needed to change the system default values
M.

mattman83 said:
Yes since it's a miui issue. Stock android roms don't reset brightness like miui.
Stock roms just set the brightness bar where you want, some will have the ability adjust the total curve even. Miui if you raise brightness it will change itself back after 5 mins or so, so it's needed to change the system default values
M.
Click to expand...
Click to collapse
To me it happens on the treble roms. Exactly as in miui.. might be a vendor thing idk

Can I use this on Vince running Resurrection Remix 6.2.1 Android Oreo? I am having auto brightness issue in custom ROMs too.

Shubhambora said:
Can I use this on Vince running Resurrection Remix 6.2.1 Android Oreo? I am having auto brightness issue in custom ROMs too.
Click to expand...
Click to collapse
No, its for miui only. Even using it on miui other than i specified in first post may not work

Can you check with the latest miui 8.11.15?
I'm currently using this but sometimes the brightness still jumps from dim to bright

Thanks for this fix!
Can you make flashable zip version via TWRP recovery? I don't use Magisk and I don't want to be rooted
Sent from my MIX 2S using Tapatalk

Max auto brightness level can be increased from current value?
From 4095 to 4500
It would better in sunlight
Sent from my MIX 2S using Tapatalk

hi any chance to have it without root?

graw2 said:
Max auto brightness level can be increased from current value?
From 4095 to 4500
It would better in sunlight
Sent from my MIX 2S using Tapatalk
Click to expand...
Click to collapse
No. 4095 is the max value.
H0unter said:
hi any chance to have it without root?
Click to expand...
Click to collapse
Yes you can. As long as you unlock bootloader and place the framework-res file in system path i mentioned in first post with twrp

I tried your auto brightness fix. And surprisingly it seems to work on the Mi Max 3 with xiaomi.eu 8.12.6v2 as well.

palmdude said:
I tried your auto brightness fix. And surprisingly it seems to work on the Mi Max 3 with xiaomi.eu 8.12.6v2 as well.
Click to expand...
Click to collapse
Agreed, on 8.12.13 xiaomi.eu (pie) Mi Max 3 it works very well. Thank you for your efforts OP.

Related

[Q] How to lower minimum screen brightness?

I know this is possible in CM9's display settings, but I'm currently running AOKP. Is there any other way to lower the minimum screen brightness?
I've given Tasker root permissions, approved it as a device administrator, and approved it as an accessibility service. Still, when I use a task to lower the brightness to very low levels, the brightness will only hold for a fraction of a second before it ramps up to the factory minimum.
So is there some system component I can modify to allow lower brightness, or is this only available as a ROM control like in CM9?
byrong said:
So is there some system component I can modify to allow lower brightness, or is this only available as a ROM control like in CM9?
Click to expand...
Click to collapse
FWIW the lowest possible brightness setting can't be altered via the CM9 settings, only the auto brightness levels, both sensor input levels ("bins") and the brightness level associated with that input/bin. The minimum value of 19 for the lowest slot can't be lowered further. There are other display parameters (related to brightness) that can also be altered in the CM9 settings, but it won't accept a value less than 19.
Edit: I see from a link in your sig that you're familiar with the custom levels
Yes we can do it in the frameworks to go lower than 19. I did it on other phones. I'm not sure why it hasnt been done yet for nexus, and ive been too lazy myself.
But we can even take it down to zero or 4-5 etc so its much dimmer at night. Its on my to do list.
Also i posted some kernel code in a similar thread where this question was already asked. But mod the framework is much quicker.
RogerPodacter said:
Yes we can do it in the frameworks to go lower than 19. I did it on other phones. I'm not sure why it hasnt been done yet for nexus, and ive been too lazy myself.
But we can even take it down to zero or 4-5 etc so its much dimmer at night. Its on my to do list.
Also i posted some kernel code in a similar thread where this question was already asked. But mod the framework is much quicker.
Click to expand...
Click to collapse
I should have clarified more clearly that my post above was regarding doing it via the CM settings.
I'll mod mine...at some point...but like you, too lazy for something that won't blow me away.
You want this app, works great https://play.google.com/store/apps/...yZy5wcm9qZWN0dm9vZG9vLmRpc3BsYXlmaWx0ZXIiXQ..
Sent from my Galaxy Nexus GSM using Tapatalk expect possible typos
I'm an idiot; I just found it in AOKP. It's in the custom backlight settings.
My experience does not mirror you guys. When I decrease the "screen dim level" in the custom brightness settings, it applies globally. I just did it in AOKP the same way I used to in CM9 and now with Tasker I've taken the screen all the way down to 1
Is there any way to decrease the minimum brightness on stock?
aidanbree said:
Is there any way to decrease the minimum brightness on stock?
Click to expand...
Click to collapse
Yes with above linked app. I confirm it works on stock
Sent from my Galaxy Nexus using Tapatalk
I've used a similar app called Screen Filter. My only problem with these types of apps is that I find the black/gray filter they use greatly decreases contrast at low brightness levels (more so than a "true" brightness level at an equivalent setting). Still, if you are running a setup in which they are your only option, they certainly beat having nothing.
The problem with using a screen filter is that it limits the maximum brightness when in sunlight.
I only want to affect the minimum as it is too bright.
Has anyone been able to do this on a stock rom? I too think that the minimum brightness is too high, but I don't want to use the above linked program because it also affects the maximum brightness too. I would like to be able to set custom light levels as per cm9/cm10 and pretty much any custom ROM right now, albeit with my stock ROM. Any flashable zips out there?
Cheers,
Dan

[Q] Z1compact: getting minimum brightness LOWER

Hello Everyone,
I have a problem with my amami and I doubt I am the only one but for some reason people do hardly complain: the brightness even at lowest possible setting is still too bright.
I had this back when I had original FW and I am having the same issue with CM11 (latest nightlies). Using manual control or auto-brightness doesn't make much difference, i.e. in a totally dark room the ambient light sensor reports 0Lux and the screen is still too bright.
I found a workaround already (the ScreenFilter app that people recommend all over the internet) but it sucks because it heavily reduces the picture quality, i.e. visibly reduces contrast and especially the gray color resolution. And it also doesn't reduce power consumption like real brightness value change would do.
I looked around for possible solutions and there is a trick with writting a new value of current limit to Linux settings (some mA value between 0 and 20 to some max_current file in procfs). And this really helps but also impacts the maximum brightness, the screen is hardly ready in sun light with reduced current.
Is there a silver bullet? I am thinking about writing an app for that but it would require SU permissions and is kinda dirty to implement. Can anyone recommend a better solution?
have you tried the xposed Modul "minimum brightness" ?
Install Lux Brightness. from play store.
You can overboost it or make the screen so dark that you can't even see it.
Another great screen mod is Twilight which basically dims the screen red based on clock so it helps fall sleep faster when using phone before bed.
New Folder said:
Install Lux Brightness. from play store.
Click to expand...
Click to collapse
Yes, another vote for Lux. It lets you set brightness to negative levels, mine is usually around -50%. https://play.google.com/store/apps/details?id=com.vito.lux&hl=en
Vote for Lux here too.
Nothing comes close
camaro322hp said:
Yes, another vote for Lux. It lets you set brightness to negative levels, mine is usually around -50%. https://play.google.com/store/apps/details?id=com.vito.lux&hl=en
Click to expand...
Click to collapse
Thanks for the hint. I tried the Lite version and AFAICS it simply uses the same trick as ScreenFilter and other "sub-zero" regulators, putting an alpha overlay on top of the image stack.
You can identify this kludge easily by looking at the button areas, they don't get darker anymore. And you can see the black level not getting real black, i.e. the power consumption is not reduced.
However, Lux seems to be one of the better toys because of the plugin interface. Unfortunately there is no HW plugin for Sony devices but judging by the quick look at the Nexus-4 plugin (it's open source!!) it should be possible to adopt this method to Z1 as well. So, maybe when someone could eventually implement that.
xposed Modul "minimum brightness" works, i tested it for you. you can make the screen dim to complete black with your normal display brightness slider without grey or black overlay. it just sets down the minimum brightness level to 1 or 0 (default is 10 or 20), so it should also work with enabled auto brightness
chertVdetali said:
I looked around for possible solutions and there is a trick with writting a new value of current limit to Linux settings (some mA value between 0 and 20 to some max_current file in procfs). And this really helps but also impacts the maximum brightness, the screen is hardly ready in sun light with reduced current.
Click to expand...
Click to collapse
As far as i remember, /proc is only used to call upon information, not to set specific values. What you are looking for is placed within /sys.
To be precise in /sys/devices/leds-qpnp-ee125e00/leds/wled:backlight/. There you will find a file called max_current with which you can easily control the brightness and set it to a very low level. Note that this actually dims the screen and not just applies a filter like most apps do...
One drawback is that the value will change again after you restarted the device. I set up a little flow with Automate β that takes care of this for me. I find this solution a lot better than all the screen filter apps.
This is true for CyanogenMod 11 and GreatDevs Kernel. It might be different on Stock. I know that the path for my Nexus 7 is sys/class/leds/lcd-backlight.
I hope this helps you a little bit.
rob rich said:
xposed Modul "minimum brightness" works, i tested it for you. you can make the screen dim to complete black with your normal display brightness slider without grey or black overlay. it just sets down the minimum brightness level to 1 or 0 (default is 10 or 20), so it should also work with enabled auto brightness
Click to expand...
Click to collapse
I am wondering how you can claim that the result is complete black. Calling this black is like saying "TN monitors have good black values" (I know such people, they change their mind quickly when they see my Eizo with a VA panel at night).
No, seriously, the default was already 10 (see config.xml in cm11 repo) and the difference between 1 and 10 is hardly visible. It's still way too bright for work without eye strain in the darkness.
@Wooaarr: thanks, this is apparently the way to go, I just need to find time to configure it. And yes, of course, the file is in sysfs and not procfs (automated typing, when I grew up with Linux there was no sysfs out there ).
chertVdetali said:
I am wondering how you can claim that the result is complete black. Calling this black is like saying "TN monitors have good black values" (I know such people, they change their mind quickly when they see my Eizo with a VA panel at night).
No, seriously, the default was already 10 (see config.xml in cm11 repo) and the difference between 1 and 10 is hardly visible. It's still way too bright for work without eye strain in the darkness.
@Wooaarr: thanks, this is apparently the way to go, I just need to find time to configure it. And yes, of course, the file is in sysfs and not procfs (automated typing, when I grew up with Linux there was no sysfs out there ).
Click to expand...
Click to collapse
when i disable autobrightness and push the slider to the left my screen goes completely off, so you wanna say that screen off isnt black? funny
chertVdetali said:
Thanks for the hint. I tried the Lite version and AFAICS it simply uses the same trick as ScreenFilter and other "sub-zero" regulators, putting an alpha overlay on top of the image stack.
You can identify this kludge easily by looking at the button areas, they don't get darker anymore. And you can see the black level not getting real black, i.e. the power consumption is not reduced.
However, Lux seems to be one of the better toys because of the plugin interface. Unfortunately there is no HW plugin for Sony devices but judging by the quick look at the Nexus-4 plugin (it's open source!!) it should be possible to adopt this method to Z1 as well. So, maybe when someone could eventually implement that.
Click to expand...
Click to collapse
Interesting information, I did not know that. You are correct, the navigation buttons are brighter than the rest of the screen at negative values. I had noticed that before but didn't know why. Works well enough for me though.
rob rich said:
when i disable autobrightness and push the slider to the left my screen goes completely off, so you wanna say that screen off isnt black? funny
Click to expand...
Click to collapse
Well, you claim that it works for me because you tested it on your device. So... yeah, why not, I could say what you mentioned above just following the same logics. :silly:

Colour change at min brightness.

MY issue with the stock Rom, which has been bugging me for a while is that when I reduce the brightness to the minimum, the Contrast changes, or something of the sorts, this really annoys me and I would like to disable it. Can someone help me out? I really don't want to flash a custom ROM.
I think that's normal because of AMOLED display, I also noticed it on CM14.1
This is simply the way this particular screen works, can't be fixed with software.
You can only avoid it by not reducing brightness as much. According to "Lux" the color shift starts under 4% brightness.
Sent from my OnePlus 3 using Tapatalk
But why does the min brightness in mxplayer not have this issue?
Zeryth said:
But why does the min brightness in mxplayer not have this issue?
Click to expand...
Click to collapse
Because mx player doesn't set the brightness as low as you can set it manually using the brightness slider.
Select menu - display - settings - screen - untick "brightness". Now you can set your brightness manually to even lower using the brightness slider.
Other apps seem to work similarly (for example an third party brightness widget)... Not setting it to minimum... Like they don't recognize the "real" minimum brightness - which is lower. I don't have this "issue" on my tablet. Haven't looked much into it though.

Any pie rom with boosted brightness???

My current daily driver is mokee 8.1.0 rom, i finally wanna switch to pie, i tried a few pie roms but i noticed low brightness outdoors and screen was too dim on pie, where as on mokee oreo it is bright enough outdoors. At 50 percent brightness oreo is way brighter than pie rom.
If there is any pie rom with proper brightness do let me know?????
Auto brightness or adaptive brightness i prefer to keep off and use manual slider for brightness..
Brightness is the same it's just that Google changed the values in the sliding bar, so you need to turn it up in order to achieve similar brightness to oreo. Battery consumption will be the same tho
alexmason90 said:
Brightness is the same it's just that Google changed the values in the sliding bar, so you need to turn it up in order to achieve similar brightness to oreo. Battery consumption will be the same tho
Click to expand...
Click to collapse
I guess you are right i will flash pie rom again and see the results.

Brightness on Android Q

Hi!
Does anyone know if brightness settings will change on Android Q? For me, they were ok on Android Oreo. I know that the 2 xl hasn't a superb display, but Pie did a total mess!
I wish I could set the brightness at 45 - 50% as I did before (the screen didn't suck) instead of reaching the 90%! I haven't installed any Q Beta version yet.
Thanks in advance
livkellner said:
Hi!
Does anyone know if brightness settings will change on Android Q? For me, they were ok on Android Oreo. I know that the 2 xl hasn't a superb display, but Pie did a total mess!
I wish I could set the brightness at 45 - 50% as I did before (the screen didn't suck) instead of reaching the 90%! I haven't installed any Q Beta version yet.
Thanks in advance
Click to expand...
Click to collapse
The Pie brightness was overhauled and had different locations for the same brightness compared to Oreo. But in my opinion auto brightness on pie and Q is much better than Oreo. You can also train it to adjust to your liking.
lil_ith said:
The Pie brightness was overhauled and had different locations for the same brightness compared to Oreo. But in my opinion auto brightness on pie and Q is much better than Oreo. You can also train it to adjust to your liking.
Click to expand...
Click to collapse
Thanks for your answer
Starting with Pie, they made the brightness slider linear. So 50% before Pie was definitely not 50% nits output for the screen which, with a rated max 403 by anandtech, would be only 201.5 nits. And that was before the November update that lowered the max by 50 nits. That's why you're needing it to be 90% and higher in bright ambient light.
Sent from my Pixel 2 XL using Tapatalk

Categories

Resources