[Xposed] [Testers needed] Trying to solve Light sensor bug - Xiaomi Redmi Note 3 Themes, Apps, and Mods

Hi, may be some of you have experienced the bug when an auto-brightness is on and you're in the dark place or light sensor is covered by your hand or cardboard and you're trying to watch 360 video on youtube or other required gyroscope thing and there are lags. Watch them on video - https://www.youtube.com/watch?v=XYudbTzIdHU
May be it's already been discussed but I haven't found the solution except turning auto-brightness off which isn't like a perfect solution to me
On 4pda user GODKIMOVSK have shared some info regarding this problem. Here few things you should know:
1. There are two different kind of light sensor installed on our devices:
a) Liteon LTR55X ALSPRX
b) Sensortek stk3x1x alsprx
A lot of users with gyro bug have Liteon sensor but there are people with second one as well.
To check what sensor is installed on your device use Sensor Box application.
2) The limits of light sensor usually are 0 - 10000 lux and gyro lags exist only when the data from the sensor is less than 10 lux.
So, the solution is quite simple seems to me. When the sensor read value that is less than 10 lux it becomes 10 lux on the out of the sensor.
I found a xposed module http://repo.xposed.info/module/com.mrchandler.disableprox - which able to mock all sensor 's values on your device. But I haven't tried it yet cause my boot is still locked and I don't want to unlock it unofficially so I'm waiting for xiaomi to allow the unlocking.
The module doesn't able to change light sensor measurement limits but it can replace it with one number. And if it actually does that's almost the solution.
THE FIRST TASK.
I need people which have the described gyro bug to test the Sensor Disabler xposed module.
1. Install the module, activate it in xposed installer. Go to the module setting, find the light sensor and mock its values to 50-100 lux . Reboot.
2. Turn on auto-brightness. Install Sensor Box or any other application which can measure light sensor data. If it shows exactly the same value in lux that you set up in the module then it works.
3. Try to experience gyro lag. Go to youtube and try to watch any 360 video with your hand covering light sensor.
4 . Share your results in this thread. Does the module work or not? Does the lags are gone?
Share xposed log too (/data/data/de.robv..../log/ and the file is error.log or something like that) so if the module doesn't work we can identify what is the reason.
THE SECOND TASK.
I saw source code of Sensor Disabler module and built my own module (Light_Fix.apk) with following code which is aimed to solve the gyro bug.
Test my module as well and share log.
Steps are almost the same except 2nd step:
2. If the data can not go less then 10 lux then my module works.
PHP:
private void ChangeSensorValues(final LoadPackageParam lpparam) {
XC_MethodHook mockSensorHook = new XC_MethodHook() {
@SuppressWarnings("unchecked")
@Override
protected void beforeHookedMethod(MethodHookParam param)
throws Throwable {
int type=(Integer) param.args[0];
float[] sensor_values=(float[]) param.args[1];
if ((type==5 ) & (sensor_values[0]<=10)) //type 5 - LIGHT_SENSOR afaik
{
XposedBridge.log("SOMETHING WORKS!");
XposedBridge.log("type= "+ param.args[0]);
XposedBridge.log("values= "+ param.args[1]);
sensor_values[0]=(float) 10;
param.args[1]=sensor_values;
}
}
};
XposedHelpers.findAndHookMethod("android.hardware.SystemSensorManager$SensorEventQueue", lpparam.classLoader, "dispatchSensorEvent", int.class, float[].class, int.class, long.class, mockSensorHook);
}
I am also open for help from devs and other people. It's just sad that no one hasn't even tried somehow to solve the gyro bug despite so much people have the phone.
To mods: please move that thread if it is not in appropriate place​

another one to test

i will try and let u know .... thanks for trying to fix it ....

I know this bug from cm roms, never seen it on official. right now I'm on xiaomi.eu, the bug is there with automatic brightness turned on and off but the fix isn't working for me at all.
Edit: I noticed I need to turn off auto contrast aswell to get it to work with auto brightness off. I will test the module later again
Edit2: your module does nothing, it shows 10lux minimum when covered like without module. Can't find any logs. The other module causes extreme lags and auto reboots

Seems the problem is deeper than I thought. May be even it is not possible to solve by xiaomi itself. But I will try to get some logs from both light and gyro sensors later when my boot will be unlocked. May be some solition will be found. If it will I will share it. Thanks all for tests.
I will be appreciated if someone will try Xposed module called gyroscope noize filter and tell me if the situation with lags gets better.

gohan456 said:
I know this bug from cm roms, never seen it on official. right now I'm on xiaomi.eu, the bug is there with automatic brightness turned on and off but the fix isn't working for me at all.
Edit: I noticed I need to turn off auto contrast aswell to get it to work with auto brightness off. I will test the module later again
Edit2: your module does nothing, it shows 10lux minimum when covered like without module. Can't find any logs. The other module causes extreme lags and auto reboots
Click to expand...
Click to collapse
If with my module it shows never 0 lux but 10 instead then it works. and it works as others testers reported

S0bes said:
If with my module it shows never 0 lux but 10 instead then it works. and it works as others testers reported
Click to expand...
Click to collapse
I noticed my finger is not enough to get 0 lux without the module. it shows 0 when covered with something dark. and it shows always 10 with your module.

alright. This is sad but I doubt that the problem could be fixed by users itself. May be it is kernel related thing but I doubt that too.
I think people with "the gyro problem" should massively report xiaomi about this bug. This is how I'd described it after I've done several tests: "When the phone reading simultaneously data from light sensor and gyroscope/accelerometer sensor and the data from light sensor less then 10 lux it causes sudden drop in FPS - from 50 down to 4-10 FPS. "

Related

[Q]Working Light Sensor

why every build claims to have light sensor works while it doesn't. I tried every build that says light sensor works. Well, that works only If I open an app call "Android Sensor Data", then I can see the light lux changes as well as the screen brightness, once close the app, the system just wont update the light sensor......
can anyone confirmed that it's actually working? like put the phone under a lamp and the screen will have full brightness?
No, it doesn't work properly... WiFi, data, G-sensor, battery, camera aren't good also. Bad luck...
Sent from my HTC Desire using XDA App
why every chef says it's working then? Really confused, I tried at least 4 builds tonight, frustrating.....
it does work, but not properly. U need to enable "Automatically Blacklight Adjustment" under WinMo before boot into Android. Light Sensor works on fresh reboot, but after using android for awhile, and light sensor not working anymore. To get Light Sensor works again, u need to fresh reboot android again
thanks, will try. I am using chucky droidrom and can't find auto brightness option.
Lets just be thankful that we got android running on our phone...if you must have auto light, use winmo...
waichai said:
it does work, but not properly. U need to enable "Automatically Blacklight Adjustment" under WinMo before boot into Android. Light Sensor works on fresh reboot, but after using android for awhile, and light sensor not working anymore. To get Light Sensor works again, u need to fresh reboot android again
Click to expand...
Click to collapse
Thank u so much. I finally managed to find the registry key that controls auto brightness in chuckydroidrom, and now auto brightness in android works (for now)
BTW, I am thankful to the developers, however, thought they should clear things out instead of just saying "it works" and omit the part "how".
I googled all night, read carefully every 1st post in every build, couldnot find anything related, that's why I asked
Thanks again to every contributor
macoy said:
Thank u so much. I finally managed to find the registry key that controls auto brightness in chuckydroidrom, and now auto brightness in android works (for now)
BTW, I am thankful to the developers, however, thought they should clear things out instead of just saying "it works" and omit the part "how".
I googled all night, read carefully every 1st post in every build, couldnot find anything related, that's why I asked
Thanks again to every contributor
Click to expand...
Click to collapse
Hi macoy,
Do you mind to post here how to set it in the registry?
Coz I also using chuckydroidrom.
funky81 said:
Hi macoy,
Do you mind to post here how to set it in the registry?
Coz I also using chuckydroidrom.
Click to expand...
Click to collapse
I open phm registry editor in winmo(included in "tools"), search "backlight" in the current user section, u will find "backlight" under "control panel", there are several keys in it. change "lightDetectOn" to 1 and the screen brightness will change immediately according to ambient light.
launch android
PS. after some time, auto backlight stops working..... and I think the sensors still works coz when I open android sensor data, it reads normally, the system just ignore it after a while.
Thanks for the enlightment. How about in the Android,do you change any settings?
didn't change anything, just enable auto brightness.

proximity sensor issue(?) on stock rom

the issue in this thread applies to the case where gravitybox xposed module is installed on stock rom. also, all the call vibration tweaks of gb are enabled.
i'm running the cwm-flashable zip rom from here. and i have gravitybox v2.5.7 installed. the "vibrate every 45th second" feature of gravitybox is erratic with the screen off (when the phone is held to the ear / proximity sensor covered). but, if the screen is 'on', it works correctly at every 45 secs. (i moved the phone away from the ear around the 40 sec mark of every minute and checked.) the call connect/waiting/end vibrations are ok.
anyone else face this issue? folks getting the "vibrate every 45th second" feature to work properly are requested to post the name of their rom and the custom build version (from settings -> about phone) here. thanks.
m0han said:
the issue in this thread applies to the case where gravitybox xposed module is installed on stock rom. also, all the call vibration tweaks of gb are enabled.
i'm running the cwm-flashable zip rom from here. and i have gravitybox v2.5.7 installed. the "vibrate every 45th second" feature of gravitybox is erratic with the screen off (when the phone is held to the ear / proximity sensor covered). but, if the screen is 'on', it works correctly at every 45 secs. (i moved the phone away from the ear around the 40 sec mark of every minute and checked.) the call connect/waiting/end vibrations are ok.
anyone else face this issue? folks getting the "vibrate every 45th second" feature to work properly are requested to post the name of their rom and the custom build version (from settings -> about phone) here. thanks.
Click to expand...
Click to collapse
hi
u can try the below rom it did solve the proximiy sensor problem for me
link : http://forum.xda-developers.com/showthread.php?t=2471648

[Q] Galaxy S4 Proximity Sensor disable

So I'm using the CM11 4.4 Kitkat on my Galaxy S4 and recently found out that my proximity sensor isn't working (when I dial the screen goes black and won't turn on until the call is over). I've read many threads about fixing it but I think it's broken. So all I want now is to disable it but there isn't such option in the Cyanogenmod. Is there anyway to disable it, like with a terminal or something?
bump
bump!
with root explorer go to system/lib/hw and go all the way to the bottom to the last sensors file. its an so file. long press on it and open in text editor. somewhere in the page almost at the bottom you will see where it says ProximitySensor then on one of those line it should say mEnabled. just rename it to mDisabled, then reboot and the proximity sensor is fixed.
qman66 said:
with root explorer go to system/lib/hw and go all the way to the bottom to the last sensors file. its an so file. long press on it and open in text editor. somewhere in the page almost at the bottom you will see where it says ProximitySensor then on one of those line it should say mEnabled. just rename it to mDisabled, then reboot and the proximity sensor is fixed.
Click to expand...
Click to collapse
I know this is an old thread but qman66 you are AWESOME! Was going nuts trying to fix the proximity sensor problem. Ran the commands in terminal emulator that recalibrates the sensor, didn't work for me. Blasted the speaker with compressed air, also didn't work for me. But this method allowed me to disable the proximity sensor while still using an AOSP rom. I will send the phone in for warranty eventually, but I thought I was going to have to use a touchwiz rom until then (touchwiz has the option of disabling the proximity sensor in the call menu).
And I read like 5 or 6 different threads dealing with the Galaxy S4 proximity sensor issue and no one else posted this method before.
kg2128 said:
I know this is an old thread but qman66 you are AWESOME! Was going nuts trying to fix the proximity sensor problem. Ran the commands in terminal emulator that recalibrates the sensor, didn't work for me. Blasted the speaker with compressed air, also didn't work for me. But this method allowed me to disable the proximity sensor while still using an AOSP rom. I will send the phone in for warranty eventually, but I thought I was going to have to use a touchwiz rom until then (touchwiz has the option of disabling the proximity sensor in the call menu).
And I read like 5 or 6 different threads dealing with the Galaxy S4 proximity sensor issue and no one else posted this method before.
Click to expand...
Click to collapse
glad someone found this useful.
While this fixed the call locking problem, it also disables a lot of other hardware sensors. The only one I'd care about is the gyroscope for rotating the camera and watching videos full screen. Any solutions?
sjschoo said:
While this fixed the call locking problem, it also disables a lot of other hardware sensors. The only one I'd care about is the gyroscope for rotating the camera and watching videos full screen. Any solutions?
Click to expand...
Click to collapse
Yeah I noticed that, the best solution is to get the proximity sensor fixed in the end. Then you don't have to disable anything. If your lucky it doesn't even need to be replaced, just cleaned. For me I can live with no rotation, because the screen off during calls is a ridiculous PITA by comparison. Also apps can force landscape mode even with the gyroscope not working. I use force landscape for videos through mx player, and mango reader for manga.
I finally broke down and took the phone apart. There were no warranty stickers to break so assuming you don't mess up royally, it shouldn't effect your resale value. All it took was an eye glass screw driver and a q-tip. Once I was inside I tried the can of air first, but didn't help. Swabbed the back of the glass with the q-tip and that finally provided lasting relief.
i9100 proximity sensor doesn't work
Hi to all!
I have the issue with proximity sensor and didn't manage to find a solution in other similar threads!
The matter is that it is always stay as Released.
In the same time in test screen (*#0*#) there are changing reading for PROXIMITY parameter from 2 up to 240 with no ADC parameter at all. Please look for screenshots. PROXIMITY parameter changes its value when I move my finger in front of the sensor, but as I can understand Android doesn't recognize it because of ADC absence.
Moreover I tried to change proximity sensor for working one (from another phone), but it shows the same as mine (with no ADC readings).
After all I think it is software problem, but I don't know how to solve it. I flashed different firmwares (now it is XWMSE NeatROM v.6.4), but nothing helped.
Please assist! Thanks!
khudko83 said:
Hi to all!
I have the issue with proximity sensor and didn't manage to find a solution in other similar threads!
The matter is that it is always stay as Released.
In the same time in test screen (*#0*#) there are changing reading for PROXIMITY parameter from 2 up to 240 with no ADC parameter at all. Please look for screenshots. PROXIMITY parameter changes its value when I move my finger in front of the sensor, but as I can understand Android doesn't recognize it because of ADC absence.
Moreover I tried to change proximity sensor for working one (from another phone), but it shows the same as mine (with no ADC readings).
After all I think it is software problem, but I don't know how to solve it. I flashed different firmwares (now it is XWMSE NeatROM v.6.4), but nothing helped.
Please assist! Thanks!
Click to expand...
Click to collapse
Changing the rom isn't going to do anything, even factory roms (I've tried it). If a replacement sensor doesn't fix it for you, then it's going to be hard to fix it yourself. All the posts I've seen so far have cleaned the sensor or replaced the sensor and fixed the problem. Otherwise people like me just turn the sensor off.
You were right, proximity software fix didn't help! But how is it possible to work in this (the same wrong) way with changed sensor? Can it be some main board hardware problem? But it doesn't look like this...
Sent from my GT-I9500 using XDA Premium 4 mobile app
Maybe somebody knows how to fix the issue???
Finally fixed
Thanks so much qman66 I have had problems with my proximity sensor on my JFLTEXX pretty much since I got it. Had been using the xposed disable proximity sensor module but xposed doesn't work with CM12. Your simple system tweak has given me use of my phone know call options again
qman66 said:
with root explorer go to system/lib/hw and go all the way to the bottom to the last sensors file. its an so file. long press on it and open in text editor. somewhere in the page almost at the bottom you will see where it says ProximitySensor then on one of those line it should say mEnabled. just rename it to mDisabled, then reboot and the proximity sensor is fixed.
Click to expand...
Click to collapse
Hi, I tied to do this but it says I can't save the changed so file... Can you let me know which root explorer and text editor you are using?
Thanks massively
Not a text file
qman66 said:
with root explorer go to system/lib/hw and go all the way to the bottom to the last sensors file. its an so file. long press on it and open in text editor. somewhere in the page almost at the bottom you will see where it says ProximitySensor then on one of those line it should say mEnabled. just rename it to mDisabled, then reboot and the proximity sensor is fixed.
Click to expand...
Click to collapse
I found sensors.msm8960.so with many references to proximity sensor but it is not a text file!!
Samsung S4 Active w LOS 15.1 (a&Droid 8.1) - how to disable HW sensor(s).
Hi All
Hope some here will help me stay afloat long enough to learn to surf by myself; bit of a noob in this wild ocean here (more of a 'fresh water/indoor pool' kinda dude I guess) - but trying to break out of tis little pond and learn to 'surf'. Anyway, to the point:
1. HW spec
Samsung Galaxy S4 Active
GT - i9295
TWRP 3.3.0-0
Lineage 15.1 20180227 jactivelte
(sometimes with opengapps pico and addonsu15.1 but mostly just LOS and addonsu nothing else)
2. Have the sensors on phone covered up with black electrical tape - all but the notification light are covered and it's gonna stay that way - NOT negotiable!
Obvious Issue: Have the blank screen during phone call problem. Can end calls using power button but I need to use the keypad quite often so need the screen to stay on. How? Ideally want to (SW) disable most if not all hardware sensors - how?
Tried a few fixes but no luck, e.g.:
(a) adding 'the' fix/control many sensors apk no good as not suported under 8.1 (plus want to find out how to do manually myself not use 'hand outs').
(b) edit selected sensor etc ".so" (eg in system hw) files - so far not resulting in the disabled ProximitySensor.
So, I really want to hack this myself at cmd line level, am ok with that (many years IT ops/admin experience in 'fresh water commercial space'). Can mount system using TWRP then adb shell to connect and find and grep for stuff in files but cannot find setttings I need to change to disable sensors for good. Where to look/find more info?
What do I want to achive:
Make calls and have keypad stay on all the time or give me manual option to turn screen on/off with a hw button during call.
How:
I am happy to disable pretty much all sensors (proximity, gyro, compass etc) in system or firmware memory so that I am free from the overlords and really want to be able to use the keypad during calls - and have option to manually turn screen off/on during call would be cool.
Constraint:
Really want to do this from (a) cmd line or (b) edit code/recompile (learning curve) the LOS 15.1 or whatever to disable sensors for good. I will be using this old thing mostly for just call and txt not much else - and cannot be asked to buy an old Nokia handset.
Thanks,
iHAL8999.999... (hi dave...)

Problem!!!! Proximity sensor is always on!!

The proximity sensor produces infrared light even when the screen is turned off. I have also tried turning off options like Pocket Mode, Adaptive Brightness and more. Notably, the light is not visible to the naked eyes. You need to use a camera in order to see the light glowing. Also, this is draining my battery quite faster. Please fix the issue ASAP as I am worried right now.
Same issue here
I also tested it using another mobile's camera. I was also able to reproduce the same problem. I think it is also leading to quick battery drain.
On what rom?
Miui stable with custom kernel has that problem. Pixel experience with same custom kernel does not.
aroradevesh said:
The proximity sensor produces infrared light even when the screen is turned off. I have also tried turning off options like Pocket Mode, Adaptive Brightness and more. Notably, the light is not visible to the naked eyes. You need to use a camera in order to see the light glowing. Also, this is draining my battery quite faster. Please fix the issue ASAP as I am worried right now.
Click to expand...
Click to collapse
How do you know that it is draining your battery?
Did you use BetterBatteryStats or what is the base for comparison?
I have 128Gb version (global) without this issue. Infra is on when display is on and is off when display is off. Bought in Czech Republic.
Correct me if i am wrong, but proximity sensor should be in on state when you are in a call, in order to turn the display off when the phone is close to ear, or when an app is requesting its measurements to proceed to a specified action. Have it in operating state when the screen is off, or when it is not called to do something is bad behaviour and it consumes energy no matter how much it is.
I'm on MIUI Pie Stable 10.1.3.0 with Stock Kernel.
Apart from call purpose, it is used in Pocket mode, Adaptive brightness(for its proper working), etc.
Edit:
I found a solution to this, Go to Settings>Battery>Scenes and turn off Non-interactive mode.
I turned off that option, I will further update if it increases or decreases my SOT.
aroradevesh said:
I'm on MIUI Pie Stable 10.1.3.0 with Stock Kernel.
Apart from call purpose, it is used in Pocket mode, Adaptive brightness(for its proper working), etc.
Edit:
I found a solution to this, Go to Settings>Battery>Scenes and turn off Non-interactive mode.
I turned off that option, I will further update if it increases or decreases my SOT.
Click to expand...
Click to collapse
Still on for me, I'm on latest public beta
Why not to calibrate the poximity sensor by setting, about phone and taping the kernel version, it will turned on engineering mode, choose poximity sensor and test it. Good luck.
Sent from my Redmi 3S using Tapatalk
Same problem on my poco in latest stable 10.1.3.0. So far I have not found a solution. The suggestions made above don't work.
Lets hope the next build will revert it.
Solved: auto brightness off
Switch off auto brightness and the IR will stop

Adaptive brightness

I turned off adaptive brightness, but while manual brightness is set to maximum I noticed the screen also increases/decreases brightness depending on the outdoor conditions. Sometimes seems it gets even brighter that max manual setting.
Anyone else experienced this?
Hi @mejgs
I too had this annoying issue. Apparently this is caused by an app called "Device Health Services". Disabling it solved the issue for me. Do give it a try & let us know your observation
I noticed it too. Did u experience any issue when disabling it? I am rooting, thinking of uninstalling it altogether. Google has some unwanted apps bundled with Android one.
paq1170 said:
I noticed it too. Did u experience any issue when disabling it? I am rooting, thinking of uninstalling it altogether. Google has some unwanted apps bundled with Android one.
Click to expand...
Click to collapse
I've uninstalled that app. No issues so far
I don't have that app, I'm having that issue too
lima002 said:
I don't have that app, I'm having that issue too
Click to expand...
Click to collapse
Look carefully. You are supposed to have that app pre-installed. The app package is named com.google.android.apps.turbo
Thanks All. Disabling DEVICE HEALTH SERVICES fixes the auto brightness issue.
evanB70 said:
Hi @mejgs
I too had this annoying issue. Apparently this is caused by an app called "Device Health Services". Disabling it solved the issue for me. Do give it a try & let us know your observation
Click to expand...
Click to collapse
Disabled it, still the same issue. So far tried:
- Turned off adaptive brightness, rebooted
- Turned off adaptive battery, rebooted
- Disabled Device Health check, rebooted
- A combination of above
Still nothing!
It's getting beyond irritating now. Everytime I need to read any message or do anything on the phone need to manually lower the brightness and increase it again. That normalizes it for a like half a minute and then goes dim again.
Same issue with my Mi A3 and adaptive auto brightness.
I keep adaptive brightness on all time and when I unlock directly with fingerprint sensor half of the times if not more phone wakes up with high brightness...and doesn't go down...slider is on the dark side and not showing the real brightness...and to change the brightness I have to move around the slider...
It is quite annoying..I disabled device health and seems slightly better but the bug is still there...am I the only one with this problem?
I don't think its a bug but rather a way for the optical in-display fingerprint to properly recognize our fingerprints.
airon11 said:
I keep adaptive brightness on all time and when I unlock directly with fingerprint sensor half of the times if not more phone wakes up with high brightness...and doesn't go down...slider is on the dark side and not showing the real brightness...and to change the brightness I have to move around the slider...
Click to expand...
Click to collapse
I had the same bug, december update fixed it on my device (EU)

Categories

Resources