yashsingh1/xdaforums huggingface dataset:
[HTC 10 Guides, News, & Discussion] ivanwong1989:
Hi

I hope that some folks here has seen this before.

My phone (huawei p9 lite), I've noticed that on Wifi it has much higher drain. As far as I can tell,

if I leave it overnight, in the battery stats page, I'll see numerous wakes over the night, although nothing much is going on with other apps.

Trough BBS, I am seeing kernel wakelock "wlan_sdio_lock". at maybe around 20 to 30%.

Top of the list...

Anybody knows what is it?

Phone: P9 Lite

OS: Marshmallow 6.0 running Stock EMUI 4.1

Rooted. Greenified. Tried using Amplify to solve, but doesn't seem to help. Wifi just stubbornly keeps waking up repeatedly although BBS say deep sleep is 90%.....

Any idea? :(....

Tq very much for any answers/comments... ran out of ideas/venues to ask....

---------- Post added at 11:51 PM ---------- Previous post was at 11:48 PM ----------

Hi.... latest google services have bad wakelocks? I see them in amplify too. *net_scheduler*. and also *alarm*/*launch*
[HTC 10 Guides, News, & Discussion] stefan1234566789:
Mate this is the htc 10 thread. I don't want to be rude to you, but this are different phones who have different kernels,different processors ,..etc. go and search in the right place : on the main p9 lite thread. I'm sure someone who knows a solution to your problem. Maybe it's a kernel fault, can't handle right the wi fi connection. I wish you luck :)

---------- Post added at 04:58 PM ---------- Previous post was at 04:56 PM ----------

Go to this thread for amplify: http://xdaforums.com/android/general/guide-extreme-battery-life-t3095884

Have a nice day :cowboy:
[HTC 10 Guides, News, & Discussion] ivanwong1989:
hmm... oh well...

u too..... :(
[HTC 10 Guides, News, & Discussion] Haldi4803:
So i'm currently running 1.96.709.5 with Magisk V8 and Xposed.

Thanks to the Power Nap module i've been keeping my Partial Wakelocks pretty much in Check.

I can say WiFi Batterydrain is acceptable here.... or at least that's what i would like to say. Because this counts only for my 5Ghz Network.

This is 5ghz Standby: 0.5% / Hour

And this is 2.4Ghz Standby: 2% / Hour

Now if you take a closer look at the Awake time, or even the Battery Historian... it shows the exact same behaviour!

Except 5Ghz keeps Battery stable while 2.4ghz drops it every 30 mins or faster.

WTF?
[HTC 10 Guides, News, & Discussion] devsk:
Zip for stock kernel (1.96.617.20) updated with my patch is attached. Getting some good results with it. If you have any issues, please let me know.
[HTC 10 Guides, News, & Discussion] DeeZZ_NuuZZ:
if noticed too, that 5ghz is much better, not just battery, but also Internet Speed is stable and muc hbetter than with 2.4ghz if you have lower Signal. with 5ghz it doesn't matter if you have 1 bar or more, same download Speed. very very nice
[HTC 10 Guides, News, & Discussion] DummyPLUG:
Can confirm 5G is much stable and my 10 idle with 0.6% per hour with wifi always on. May be just the 2.4G faulty?
[HTC 10 Guides, News, & Discussion] grega_slo:
I'm getting 0.4-0.5% per hour in standby with 2.4 Ghz..
[HTC 10 Guides, News, & Discussion] Aetos7:
There is already wifi constant suspend and resume issue? Because i don't buy the phone for this reason, thanks.
[HTC 10 Guides, News, & Discussion] elliehirschberg:
has anyone figured out a fix that is not htc10 specific? i'm also running into this issue on my Moto Z, which just recently got nougat and I didn't have this problem on marshmallow
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
I'll run full tests tomorrow but I forgot to turn off WiFi earlier and Nougat doesn't seem as bad as MM was.
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
Nougat certainly seems much better for me than Marshmallow. I'd be close to dead right now on Marshmallow.

I don't need my phone tomorrow so I'll leave it off the charger tonight and see what I end up with.
[HTC 10 Guides, News, & Discussion] matthewacbroad:
wifi drainage is just bad. with my data on and the phone is sitting idle for 8 hours (1 work shift) I loose about 8%-10% battery. With WiFi on over 8 hour sleep I loose 20-30% battery. I flashed 1.91 fix on my 1.90.666.4 version but it seems to help nothing, should I try flashing 1.96.617.2?
[HTC 10 Guides, News, & Discussion] gunnerbilal:
Mine seems fine. I get 0 counts on wc.
[HTC 10 Guides, News, & Discussion] Haldi4803:
Holy.....

Seems like cm14.1 is heavily affected by this....

Seriously... Even more drain than with Screen on^^

But I'm still on MM firmware and didn't have time for more testing....
[HTC 10 Guides, News, & Discussion] dwainew77:
Battery drain fix

I have a stock unlocked USA variant of HTC10.

I was an early adopter (pre-ordered) and my battery life was great - 2 days worth. The first camera patch still left me with great battery life. The Android 6.1 update made my battery drain 3% per hour whether I used the phone or not. It was always awake. Safe mode was the same. I have tried every suggestion I could find on the internet to no avail and patiently waited for Android 7.0. Nougat did not change my problems - still 3% per hour. Phone was always awake and would only doze via adb commands. No amount of cache clearing, Uncoupling google account, deleting apps, or factory resets would fix it.

--- MY FIX ---

Two days ago I disabled and force closed GooglePlayServices. My great battery life came back - 2% drain overnight. It is now even greater since the new aggressive doze is working, too. One day later I re-enabled PlayServices. PlayServices kept telling me it unfortunately closed unexpectedly - would relaunch and reclose. I rebooted phone and all the PlayServices problems went away.

Now been enjoying my great battery life coupled with Google services for 24 hours.

I hope this post helps someone.
[HTC 10 Guides, News, & Discussion] AggelosGR:
this worked for me! my wifi was appearing in battery stats even if i had it closed.

the thing i did was to force close google play services.after that problem solved.phone is up 2 hours and i did also a reboot and stats appearing ok!
[HTC 10 Guides, News, & Discussion] racingmatt1:
I have the HTC One m9 and all options are greyed out (force stop,uninstall updates,disable)
[HTC 10 Guides, News, & Discussion] AggelosGR:
Not in running services in developers options menu
[HTC 10 Guides, News, & Discussion] racingmatt1:
All I can do there is stop or report
[HTC 10 Guides, News, & Discussion] X10 Empty:
useful

thank you~~~~:):)
[HTC 10 Guides, News, & Discussion] andybones:
CM14.1(Linage OS) is much better for me. I left Wi-Fi on the entire time, however I have it set to turn off when sleeping. (same as I did on MM Sense ROM). Usually I turn Wi-Fi off at night but wanted to see these results and am quite happy with it.
[HTC 10 Guides, News, & Discussion] grega_slo:
I trully TRULLY hate wifi on this phone.

It's such crap that one couldn't even believe it without evidence...

https://www.youtube.com/watch?v=dxiPT2-0YEY
[HTC 10 Guides, News, & Discussion] donibrasco:
It looks very bad.. Have you tried the latest elementalx? Changelog says included some patches which i assume are related to wifi and a bit improoves my wifi..
[HTC 10 Guides, News, & Discussion] grega_slo:
Yep latest elex installed...

Maybe its hw issue for me I don't know

...
[HTC 10 Guides, News, & Discussion] grega_slo:
Flashing lineage now to test...
[HTC 10 Guides, News, & Discussion] °Dexter°:
I don't get how to stop and disable Google services as advised in post #847.

I checked in developer options but I can just stop service temporarily
[HTC 10 Guides, News, & Discussion] grega_slo:
Lineage worked without any issues. No more reconnecting, no more weird download spikes, video from remote storage is playing like it should.

So:

1. HTC has problems with ROM

2. HTC has problems with kernel

ENd of story for me and eginning of waiting game, :(
[HTC 10 Guides, News, & Discussion] wineds:
Htc are still in denial
[HTC 10 Guides, News, & Discussion] Brutale1090!:
Wich zip should I flash on 1.95.401.... FW?

Cleanslate includes it by default, does Elementalx the same?
[HTC 10 Guides, News, & Discussion] donibrasco:
Since that, discover and reading nebula kernel thread, i understand nebula is the only one custom kernel which is not based from htc kernel sources (am i correct?) especially v. 7.0.4.advanced. Now running nebula 7.04-advanced and "magically" don't experience drop/resume connection...

Could you run your tests and confirm my conclusion?
[HTC 10 Guides, News, & Discussion] grega_slo:
Sorry I`ve been away :D

Nice find will test it and report back.

P.S.

My coworker bought same phone and he has identical issues as me.
[HTC 10 Guides, News, & Discussion] grega_slo:
Nebula :(
[HTC 10 Guides, News, & Discussion] grega_slo:
After some more testing this happens only on networks which have both IPv4 and IPv6 enabled.

Man this phone WiFi really sucks...
[HTC 10 Guides, News, & Discussion] Haldi4803:
sorry, i don't get this graph at all, coud you elaborate?
[HTC 10 Guides, News, & Discussion] grega_slo:
Interruptions.

Tcp retransmissions and duplicate ack's

On phone seen as wifi downloading file at 2 Mb/s and in nex moment 0 Mb/s and then again at 2 Mb/s etc etc...

Happens only with 10 tried with 2 phones same crappy behavior...

Nexus 2012, samsung phones are ok. Windows and linux pcs ok too...

So its not wifi router...
[HTC 10 Guides, News, & Discussion] htctouchelfin:
yeah really bad wi fi.. so can we disable ipv4 or ipv6 on our routers?
[HTC 10 Guides, News, & Discussion] jhadsfi:
So I recently lowered my routers bandwidth from 40 MHz to 20 MHz. Now WiFi drain is under control ~1%/h. Used to be 7%. Maybe someone else can try and see if it has a similar effect.
[HTC 10 Guides, News, & Discussion] Ivanovic:
Thats what I did a month ago and reduced overnight drain from 20% to 4-5% :)
[HTC 10 Guides, News, & Discussion] jhadsfi:
Nice. I think 40 MHz causes too much interference which leads to drain and drops because it overlaps with twice as many channels than 20 MHz. I now have no drops or battery drain on WiFi. Really happy with this device now. Thanks for responding!
[HTC 10 Guides, News, & Discussion] Spegeli:
Since Months i'm searching for a good WiFi Solution, maybe the change from 40 to 20 Mhz will solve the problem for me too ;)
[HTC 10 Guides, News, & Discussion] naughty6t9:
Suddenly Wi-Fi doesn't transmit data, despite of full network. Even if I use DNS changer.

Until intern off n turn it back on, never happens on data..

Is anyone facing similar issue
[HTC 10 Guides, News, & Discussion] RogerF81:
Perhaps it's because of the DNS changer....had the same issue, disabled it and then I was fine again.
[HTC 10 Guides, News, & Discussion] naughty6t9:
I installed it cuz I used to have this issue.. But looks like it doesn't makes much of difference
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
Seriously cutting it to 20MHz is the only fix? That cuts my bandwidth down from over 200Mb/s to 95-100Mb/s :/
[HTC 10 Guides, News, & Discussion] jhadsfi:
Get a 5 GHz router perhaps? Maybe that'll fix it too.
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
It is a 5GHz router. 802.11ac. When do you ever hear of someone getting over 200Mbps on 2.4GHz?
[HTC 10 Guides, News, & Discussion] jhadsfi:
Depends if MIMO or not. I think 802.11n can handle upto 300Mbps. Also 802.11ac is capable of 1Gbps so when you say 200Mbps it sounds like you're using n at 2.4GHz.
[HTC 10 Guides, News, & Discussion] Haldi4803:
5ghz is supposed to be 80mhz. Only the older ones are 40mhz, wasnt even aware that you can use 20 mhz channel size.
[HTC 10 Guides, News, & Discussion] revealed:
AFAIK this is intended for high crowded areas. About WLAN coexistence. I would not know if this has effect on 5ghz because i read of it about 2.4 ghz WLAN. I have to use it here, because i live in a very very populated area. And here is also RADAR from a heliport of a hospital, weather station and so on. Meaning i have to deal with some limitations about channel usage. So when the weather station and radar decide to communicate my WLAN is going offline to free those Automated channels. And it goes into standby for a while. The only way to get around is using channels not affected by these. Silly, i have the 2.4 ghz additionally only working as fallback. And 5 ghz is the way to go.

Here is a explaination about by AVM; https://en.avm.de/service/fritzbox/...el-assignments-5-GHz-temporarily-unavailable/

Something very weird, since the forced wait starts from 0 every time you change a setting, you will have to play around a long time until it starts working again. Lol

Maybe check your router logfiles for similar DFS message.

Imagine: The DFS is triggered, your devices have to free the channel. So your router turns off the WLAN for 10 minutes. In this context, this means your phone can not connect and is trying everything reachable around. And the automatic scanning causes drain? Maybe this could be something plausible? Also maybe if the connection to something possibly reachable could be so bad, that it in turn would want to switch to LTE in this process and back since it detected something. Would let the flashing between WLAN and LTE logo sound plausible for me also.
[HTC 10 Guides, News, & Discussion] youngchaos:
Guyz, i got the device today. Off from package i've updated to 7.0, updates apps and yeah i can confirm wifi problem. I noticed it while using Whatsappweb a lot of times telling me "missing connection" and i can confirm not a single problem after setting my router to 20MHZ. Meh, i asked HTC for information tho. I'll probably go for refund.
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
You might be able to get 300Mbps if you live in the middle of nowhere but the 2.4GHz interference in the suburb I live in is ridiculous. My RT-AC68U can only manage 25Mbps in the same room because of how many 2.4GHz networks there are in my area. 5GHz is free and clear.

My router can do 600 on N, 1900 on AC. I haven't tested 5GHz throughput in N mode because everything we have is either AC-compliant or isn't dual band (*cough*Sony*cough*). If we didn't have so many Playstations, I would just shut 2.4GHz off altogether.

My battery drain on Nougat fluctuates... its between .5% per hour to 1.75% per hour on the latest ElementalX going by EXKM's built-in stats... On average if I charge my phone and go to bed, its at 94-95% 10 hours later when I decide to get up which is pretty acceptable to me. Certainly MUCH more acceptable than cutting bandwidth for the whole house with 20MHz on the 5GHz band.
[HTC 10 Guides, News, & Discussion] SiAmaze:
This problem has been addressed in newer updates
[HTC 10 Guides, News, & Discussion] Eiad Ajam:
Go to wifi settings

Wifi direct

And rename your device

The problem might be solved

At least for me
[HTC 10 Guides, News, & Discussion] gsw5700:
Also noticed on wifi analyser, my old lg g3 sees about 12 other routers, htc 10 only sees mine...
[HTC 10 Guides, News, & Discussion] devsk:
One thing I noticed was that while updating to 1.80, I was without root for some time because first I wanted to make sure that OTA was working fine. During this I did not see the constant suspend resume cycles of the pcie device, suggesting to me that there is something with root going on.

Edit: I was wrong. I restored the stock system image and boot, and I see repeated suspend/resume action, leading to the same battery discharge on wifi seen since 1.2x times.
[HTC 10 Guides, News, & Discussion] grega_slo:
There are actually 2 different problems with WiFi on this phone.

1. Wifi random reconnects

This only happens if you use DHCP. If you set static IP or make DHCP reservation for static IP on router/firewall then this issue does not occur.

In my OpenWrt router I can see LOADS of:

I also have 5 notebooks, 3 samsungs and HTC M8 and HTC OneX+ on same wifi router WITHOUT ANY ISSUES and all of them are on DHCP without static IP addresses.

Did wireshark and what happens is that HTC10 IS REQUESTING new lease even though lease is set to 24 hours. Every time it does so, wifi reconnects. This is driver problem and probably can be fixed via kernel.

NOTE:

Tried with:

WRT160NL with OpenWrt, DD-WRT and stock

Archer C5 Openwrt and stock

2. Wakelocks wlan_rx_wakelock

Here others have made good job in research, but it still remains unknown what causes it. It happened on 1.30 and now it happens on 1.80. Did extensive testing and behavior on both, 1.30 and 1.80 IS THE SAME.

NOTE:

Tried with:

WRT160NL with OpenWrt, DD-WRT and stock

Archer C5 Openwrt and stock

When 1.80 kernel sources drop, we can kindly ask [MENTION=4684315]flar2[/MENTION] if he is willing to take a look at those issues. I bet he could help us at least pinpoint the culprit :)

---------- Post added at 11:39 AM ---------- Previous post was at 11:06 AM ----------

Well I`m trying one more thing.

I flashed US radio (which is updated) on my 401 device. Flash went without trouble, I have LTE all working. Now testing WiFi :)
[HTC 10 Guides, News, & Discussion] hemirunner426:
Has anyone looked into location services wifi scanning? I don't see this issue so I can't test.
[HTC 10 Guides, News, & Discussion] grega_slo:
I have everything off...
[HTC 10 Guides, News, & Discussion] devsk:
Same here.

Although, I notice from time to time, google enables "High performance mode" of Location by itself, meaning it will scan wifi for location.
[HTC 10 Guides, News, & Discussion] tonnytech:
Unimpressed with my sot i delved into the "show your battery life" thread.

Upon visiting i was even more disappointed to realize that my average sot were being dwarfed by other users. My average screen time with stock and various roms tried averages out to 3 / 3.5 hours with wifi enabled.

I have seen other users complain of this also , anyhow EtherealRemnant mentioned in thread it was related to wlan_rx_wakelock. With this new information and after trying everything i thought i would disable wi fi and test data only usage.

The results i think are shocking 3.5 hours average sot with wi fi enabled 7.5 hours with wi fi disabled.

So Location of

Sync turned of for apps that request it

Brightness set to 60% auto brightness , power saver set to kick in around 10%

NFC of

Keep wi fi set to on during sleep

wi fi optimization set to of

These settings enabled 3.5 hours if im lucky with wi fi on , with it disabled 7.5 see here -

Wi Fi Enabled

Wi Fi Disabled
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
I've found the best balance for me is WiFi off with the screen off... I get 18 hours total with 5 hours of SoT with those settings and most of my SoT is from gaming.

I'm going to see about setting up a static IP for my phone and see what that does.

Interestingly when the phone is set with WiFi only on when the screen is on the wlan_rx_wake issue goes away but if you turn on the power saver it starts zapping wake locks again right away. And when I say it goes away, I mean that the wlan_rx_wake entry in kernel wake locks doesn't appear period. I get less battery with power saver than with it off if I use WiFi at all.

As for WiFi scanning? In the location settings, go into the menu and turn off scanning and it won't scan on any GPS mode. Something I don't remember being able to be disabled on my Note 5 but you can totally disable it on the 10 so it isn't constantly scanning WiFi, just when you have a location request outside of device only mode.

HTC needs to come up with a fix for this for real...
[HTC 10 Guides, News, & Discussion] grega_slo:
Well US radio does the same.

:(
[HTC 10 Guides, News, & Discussion] Haldi4803:
Anyone tried the Battery Historian thingy?

https://github.com/google/battery-historian/blob/master/README.md

I wonder what the WiFi stats would look like.

Or here;

https://m.reddit.com/r/nexus5x/comments/3y8144/guide_finding_battery_issues_with_googles_battery/
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
Okay so this is really weird. I set it to a static IP and now the phone stays awake basically half the time it's supposed to be asleep. However, the power consumption went down...

Did I need to do something on my router to change my phone to a static IP because I just set it to 192.168.10.200 on my phone and it seems to be working fine but the phone stays awake... Its rather odd...
[HTC 10 Guides, News, & Discussion] devsk:
I think the IP allocation and assignment by the router is only a small part of the problem on some phone/router combos, and distance from the router also plays role. Its definitely not an issue on my phone. The wifi drain from constant wake/sleep cycles is different and that's affecting many more phones and IMO, has nothing to do with router, but only the kernel drivers or userspace being too aggressive.
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
Yeah setting a static IP actually made it much worse. Throughout the day it's really dropped. Now I just forced it on to my 2.4GHz network and shut off 5GHz and I'm testing it. It's not a signal issue, logcat shows a consistent -47dB every time it polls when it's on the 5GHz network and my 2.4GHz is actually worse at -58dB despite them being the same router.

I've attached the battery log... It was down to 19% when I plugged it in... That's the worst SoT I've had yet. That's like M7 bad. So the static IP is going away after my 2.4GHz only test is done and I'm not even bothering with a static IP for the 2.4GHz test.
[HTC 10 Guides, News, & Discussion] devsk:
I think I know which components are racing but I have no source code to validate this. Have a look at this:

[ 5464.647466] c2 29017 [WLAN] CFG80211-LOG) wl_cfg80211_add_iw_ie : Previous IW IE is equals to current IE
[ 5464.647523] c2 29017 [WLAN] DHD Runtime PM Disabled
[ 5464.649745] c2 29017 [WLAN] CFG80211-LOG) wl_run_escan : LEGACY_SCAN sync ID: 4660, bssidx: 0
[ 5464.856051] c1 29015 [WLAN] CFG80211-LOG) wl_escan_handler : ESCAN COMPLETED
[ 5464.856100] c1 29015 [WLAN] CFG80211-LOG) wl_escan_handler : SCAN COMPLETED: scanned AP count=2
[ 5464.856247] c1 29015 [WLAN] DHD Runtime PM Enabled
[ 5464.882347] c3 29017 [WLAN] CFG80211-LOG) wl_cfg80211_add_iw_ie : Previous IW IE is equals to current IE
[ 5464.882418] c3 29017 [WLAN] DHD Runtime PM Disabled
[ 5464.884458] c3 29017 [WLAN] CFG80211-LOG) wl_run_escan : LEGACY_SCAN sync ID: 4660, bssidx: 0
[ 5466.280920] c0 0 {AFL}IN= OUT=wlan0 SRC=192.168.0.16 DST=192.168.0.6 LEN=72 TOS=0x00 PREC=0xC0 TTL=64 ID=21976 PROTO=ICMP TYPE=3 CODE=3 [SRC=192.168.0.6 DST=192.168.0.16 LEN=44 TOS=0x00 PREC=0x00 TTL=127 ID=41518 PROTO=UDP SPT=49914 DPT=8612 LEN=24 ] MARK=0x30066
[ 5466.842248] c1 14407 now=5166890, last=5161880, vsync=5161880
[ 5466.842372] c1 12 hw_vsync_handler: hw_vsync count = 15
[ 5467.852438] c3 14293 [BATT] chg_full_check_worker: vol:4077, curr=-201, is_full_count=0, is_full=0 at 5467900625723 (2016-06-18 23:35:05.396714637 UTC)
[ 5468.956828] c2 29015 [WLAN] CFG80211-LOG) wl_escan_handler : ESCAN COMPLETED
[ 5468.956888] c2 29015 [WLAN] CFG80211-LOG) wl_escan_handler : SCAN COMPLETED: scanned AP count=7
[ 5468.957146] c2 29015 [WLAN] DHD Runtime PM Enabled
[ 5469.048948] c1 14407 mmc0: mmc_set_auto_bkops: bkops_en: 0
[ 5469.317061] c1 356 mmc0: mmc_set_auto_bkops: bkops_en: 2
[ 5470.072733] c0 457 msm_pcie_pm_suspend: RC0: entry

Process 29017 is wpa_supplicant process in user space. Process 29015 is the kernel thread wl_event_handle.

These two entities are not able to negotiate whether the Wifi chip should have its runtime PM enabled or disabled. wpa_supplicant says runtime PM is disabled, meaning "keep the wifi chip on, don't let it sleep". 200ms later, wl_event_handle thread in kernel says runtime PM is enabled and hence the wifi chip can be put to standby. 1 second later, the chip is put to sleep...:) Only to be woken by wpa_supplicant again.

Someone at HTC really needs to do a detailed analysis of all pieces involved in this.
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
Yeah I was going through the log and noticed the conflicting processes as well. Maybe we should make a poll in the discussion section to see who's affected by poor battery with WiFi to gauge how widespread it is and then push HTC to fix it?