[Xiaomi Redmi Note 5 Pro ROMs, Kernels, Recoveries,] Desmanto:
Wifi deep sleep drain

So starting from RR 20180706 build, I have already experienced wifi deep sleep drain as I have posted here. I have done more tests and tried so many solutions during last week and still won't work. I wonder if other experienced the same as mine.

The preset condition as the baseline :

1. In MIUI 9.5.6.0 - 9.5.17.0 I can connected to wifi/LTE, all get only about 0,6%/hour idle drain.

2. After using RR 20180706 (to 20180724), connected to wifi, dual SIM active, will give idle drain about 2-2,5%/hour (thus I called wifi deep sleep drain).

3. Same RR, switch to LTE, dual SIM active, only 0,6-0,7%/hour

4. No LTE, only dual SIM, about 0,4%/hour

5. Airplane mode (no wireless at all), almost no drain in 5 hours

6. The sensor, either Google play services is there all the time and doesn't give any difference whether in wifi, LTE, or airplane. So sensor wakeup is not the culprit.

All wifi signal level are strong (most of the time within 1-2 metres from router). Most of the wifi AP/router are from Tp-link. And before we say it is the wifi AP, i don't experience the drain using the same wifi when in MIUI.

Since I have narrowed the problem to the wifi, I do more tests and tried so many possible solutions.

1. Found the culprit about wifi logging by cnss_diag. So I tried to disable the logging by editing the /data/misc/wifi/cnss_diag.conf using the tutorial how to disable the wifi logging. The log is not written anymore, but the drain still there. Result : Same

2. Try another solution by Aqq123 to edit the /vendor/etc/init/hw/init.qcom.rc. Commented out those lines. Reboot and confirmed the cnss_diag is not running anymore from ps -A. Result : Still same

3. Try in unmetered wifi 2,4 GHz, same

4. Try in metered wifi ac 5,0 or n 2,4 Ghz, same.

5. Try to connect to another separate wifi router 2,4 Ghz with no internet connection and only my RN5 as the sole wifi client (so no possible interference or broadcast from other devices), still the same.

6. backup the kernel, flash derp kernel, same. Restore back to stock kernel.

7. There is gapps update yesterday, so I reflash from micro to nano; still same

8. Disable wifi always scanning in the location setting, same

9. Disable location feature (completely off), still the same.

10. Reset wifi, mobile, bluetooth and reconnect again, still same

11. Change the static IP to DHCP, still the same.

12. Turn off Automagic services, since I have some remote server flow enabled when connected to wifi, same drain

13. Disable Wi-Fi calling (derived from VoLTE), same

14. Try something else not related, disable the network traffic indicator and seconds in the time. Same, no effect.

Despite I have test all above solutions, everytime my phone connected to wifi, there will always 2-2,5% drain per hour, whether I use it or not. That means from 100%, without touching the phone, my battery will be dead in 2 days, with 0 hour SOT. I don't mind using the battery for something useful. But losing too many percent when idling and doing nothing is not acceptable. Everytime I get to sleep, always lose about 15-25%; should be only 4-5%.

I am running out of option. All problem pointing out that there is a problem with the ROM, when handling the wifi connection. The only solution I haven't tried is to factory reset and restore my apps again. It takes more time and I am afraid to lose some data again as I did when I switch to RR. So I don't want to do it if possible.

===========================

Worth to mention possible problem, but seem not related. There are the same crashes every few seconds on logcat. I also have this in my logcat.