yashsingh1/xdaforums huggingface dataset:
[HTC 10 Guides, News, & Discussion] devsk:
Here is what I have:

$ md5sum ../stock_1.53.617.5/firmware/pmic-8996-1.img
1d29d323b673e02f444f00b3d5295230 ../stock_1.53.617.5/firmware/pmic-8996-1.img

$ md5sum ../stock_1.80.617.1/firmware/pmic-8996-1.img
9efe4971319f0cc7aea9aa20f793a35f ../stock_1.80.617.1/firmware/pmic-8996-1.img

$ md5sum ../stockTmo_1.81.531.1/firmware/pmic-8996-1.img
c53a2520595796ca3fbc62577762632b ../stockTmo_1.81.531.1/firmware/pmic-8996-1.img

From md5sum, it looks like your existing Verizon pmic version is from 1.53.617.5. You are jumping 2 versions. Here are the versions:

$ strings ../stock_1.53.617.5/firmware/pmic-8996-1.img | tail -1
hTCVer 1.0.1-r01201.1-g38f1b25.134

$ strings ../stock_1.80.617.1/firmware/pmic-8996-1.img | tail -1
hTCVer 1.0.1-r01201.1-g0985ffb.135

$ strings ../stockTmo_1.81.531.1/firmware/pmic-8996-1.img | tail -1
hTCVer 1.0.1-r01201.1-g661021f.136

PMIC was updated in every version. And US Unlocked firmware does NOT have the latest pmic. TMO firmware does.

Its also possible that the version 134 (in 1.53) did not have the issue (or it was not as severe), 135 (in 1.80) has the issue and 136 (in TMO one) does not.
[HTC 10 Guides, News, & Discussion] andybones:
Very interesting.

I appreciate you reading through all the logs. I will be getting one soon here before bed, and then in the morning.

I hope the logs prove to be helpful in someway.
[HTC 10 Guides, News, & Discussion] devsk:
The log before going to bed is a baseline just before you turn the screen off for the night. It will help me align the output to correct dmesg timeline comparable to the night ones. So, the sequence is "collect log, sleep, wake, collect log", no touching the phone in between.
[HTC 10 Guides, News, & Discussion] jollywhitefoot:
Here are some more logs. I took one with 1.80.617.1 pmic and then flashed 1.81.531.1 pmic. Both left to sleep for a little over 20 minutes with mobile data off.
[HTC 10 Guides, News, & Discussion] devsk:
Jolly: if you are still running 1.81.531.1, just collect another sample. The first is from the beginning of the boot of the phone and there is bunch of action there. Also, keep it idle for exact amount, whatever it is: 20 30 mins. Or take a sample before idle and one after waking it up after 30mins. That makes life easier while correlating data.
[HTC 10 Guides, News, & Discussion] grega_slo:
Does anyone have a link to latest pmic?
[HTC 10 Guides, News, & Discussion] Haldi4803:
http://xdaforums.com/showpost.php?p=67834863&postcount=493

Just few Pages back.
[HTC 10 Guides, News, & Discussion] grega_slo:
I`m SOFF.

Can I just modify CID and MID and flash this onto EU version?

---------- Post added at 12:27 PM ---------- Previous post was at 12:19 PM ----------

Eh I just flashed it...

Now let`s see :)
[HTC 10 Guides, News, & Discussion] jollywhitefoot:
Here you go. New 1.81.531.1 logs. Idle time should be about the same as yesterday's 1.80.617.1 logs.
[HTC 10 Guides, News, & Discussion] devsk:
your 1.81.531 data is better than 1.80.617.1 but not like EtherealRemnant's "wow, its so much different". So, its not conclusive if 1.81.531 pmic alone is making the difference...:(

Hopefully, anybones' overnight data helps.
[HTC 10 Guides, News, & Discussion] andybones:
[MENTION=1416236]devsk[/MENTION]

alright new logs here. Which hopefully look promising. I went to sleep at about 2am (day off) with 98% battery and awoke with just 2% drain to 96% when I woke up at 11, and got the log around 11:15 after walking my dogs (didn't touch phone though until right after the dog walk and before i even turned on the screen plugged it in and ran the commands). There was going to be numerous screenshots in BBS so I just made a quick screen record instead.

https://dl.dropboxusercontent.com/u/26383143/HTC/HTC 10/SCR_20160721.mp4
[HTC 10 Guides, News, & Discussion] devsk:
Thanks for doing this. The zip file is good because it opens straight into my browser, .log file I have to save first. The video was a good idea too.

Your output is very good. Your suspend aborts are few and expected. You resume wakes are RTC timers and OOB packets arriving to the phone, expected. Only 62 DHD wakes in the whole night. These typically run into 100s, if not 1000s for affected phones (again, we are comparing idle, not active use). So, your current setup is how the phone should behave during idle.

Now, looking back at your original output, I am not sure how it was collected. Its possible that it was active collection and DHD wakes showed a large number for a smaller period of time. Basically, it is possible that you were not affected to begin with and the data point you collected was not really representative of idle. Would you be kind enough to repeat this experiment with 1.80.617.1 pmic overnight tonight? Exact same thing. If not, I will totally understand it. And you are pretty much set, you don't need to touch anything. This log becomes your baseline. If you ever feel some ROM or app broke your battery life, you can run the same test and compare against this data set.
[HTC 10 Guides, News, & Discussion] andybones:
Awesome! Very welcome and thank you, I honestly can't express my gratitude for not just finding this issue and bringing it to our attention, but also continuously helping and supporting.

I don't mind at all, it's the least I can do. I may have to wait until Saturday or Monday latest, however, if that is alright?

My first log (affected on VZW pmic.img) I let it sit for 20 min and then copy and pasted the commands into terminux app from play store.

Every other time since I let device sit and then plugged into PC and immediately copy and pasted the commands.

I can get a log doing the method using terminux on device again with tmo pmic.img, if you feel it's worth your time reading the log.
[HTC 10 Guides, News, & Discussion] devsk:
I think its best to flash the old pmic, boot into it, take a log and let it sleep overnight and collect again in the morning. Its alright to do it just once whenever you can afford to do it. We have been going at it for a while, so a couple of days is not going to hurt...:)
[HTC 10 Guides, News, & Discussion] andybones:
This is why you're the man!

When you say old, do you want me to do overnight test with my Verizon (134) pmic.img or 1.80.617.1 (135) pmic.img?
[HTC 10 Guides, News, & Discussion] devsk:
The one from 1.80.617.1 would be better. It will provide a comparison against my 1.80.517.1. Its possible that 134 was good, 135 had the bug, 136 is again good. But let's go with what we suspect is the buggy one, which is 1.80.617.1.
[HTC 10 Guides, News, & Discussion] andybones:
Perfect. When I have some time I will flash that pmic.img and get the logs posted as soon as possible. Thanks again.
[HTC 10 Guides, News, & Discussion] devsk:
andybones, my man...:) You couldn't resist, could you!! :D Thank you so much for doing this. The problem with smaller data set is that lot of local noise can make it into the data. With longer period, noise all gets averaged out and real pieces show themselves. So, you still owe me that overnight run with 1.80.617.1...;)

Having said that, here is the analysis of the data you attached:

Full system wakesups: TMO = 10, UL = 20, VZW = 20

Full sytstem suspend aborts: TMO = 6, UL = 15, VZW = 9

Time Spent in kernel while supposed to be idle: TMO = 27 secs, UL = 55 secs, VZW = 58 seconds

Now, assuming that all runs were for close to 30 minutes (about the same time), its easy to see that TMO pmic is doing all the right things in terms of sleeping more and staying asleep. VZW wins out against UL on aborted suspends, which is an extremely expensive operation because you basically were trying to suspend every chip in the phone, had put all but 1 CPU to sleep, and now you have to abort the suspend and wake every device back up and all the CPUs back up. It chews up CPU cycles and battery like crazy. So, my suspicion is that you were already doing decent with VZW firmware compared to UL. But TMO is going to give you the best result.
[HTC 10 Guides, News, & Discussion] devsk:
Although, I did not say it above after the analysis of latest logs from andybones, I am more confident (like 99.9%) now that the TMO pmic is the workaround to fix this issue. If you are S-Off and feel a little bit comfortable about flashing stuff, please contribute by flashing the TMO pmic and attaching the overnight idle logs like andybones did. A double set of before and after data would certainly help a great deal.
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
I just wanted to check in. I'm glad to see that it seems to have been narrowed down to mostly the pmic causing problems. I have been very pleased with it other than some issues with the 0.9 kernel. I think I'll go back to the stock T-Mobile kernel for now. This one has some weird issues. It has locked itself a few times where it pegged the small cluster to Max frequency even in sleep which drained the battery and when I am playing games and I get notifications, my sound is gone until I restart the game which is obnoxious. With that said, other than the locked CPU and sound issues it's working great and I had problems with 0.9 unmodified anyway. I'm definitely willing to test 0.10 as well although with how hot it's been here my computer is running a bit too hot for my liking so I have to find a cooler day to do it.
[HTC 10 Guides, News, & Discussion] Haldi4803:
Another question. Anyone that flashed the T-Mobile pmic did have problems with bad wireless signal strenght before? Did that change after flashing the T-Mobile pmic?
[HTC 10 Guides, News, & Discussion] grega_slo:
pmic I flashed doesn`t make a difference for me... (in post few pages back).
[HTC 10 Guides, News, & Discussion] andybones:
I never noticed any issues before or after.
[HTC 10 Guides, News, & Discussion] jollywhitefoot:
mine is awful with both
[HTC 10 Guides, News, & Discussion] devsk:
I don't recall looking at your logs. Can you re-post them all in one post? Also, what firmware and pmic are you running right now and before?
[HTC 10 Guides, News, & Discussion] grega_slo:
I don't have them as I just read them and discard them after. But it showed same behaviour as previous pmic.

I flashed that one attached to a post few pages back...
[HTC 10 Guides, News, & Discussion] andybones:
[MENTION=1416236]devsk[/MENTION]

I hope to get a before bed, and overnight log of v135 pmic.img to post up tomorrow.

I will include the logs in a .zip along with my before bed and overnight logs I previously posted of v136 pmic.img.

This way to have everything in one place.'

I will also try and keep an eye out on what my battery % is before I go to bed and when I awake to compare against the 2% drop I received from v136 pmic.img during that test. I'll be in same location, so hopefully this should prove to be helpful. :cool:
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
I get more signal fluctuations with the T-Mobile firmware than I did with the US unlocked for sure. Sitting in the same place I'll go from 4 bars to 1 or 2 and back again but it doesn't appear to actually affect call quality or increase dropped calls so I'll take it.
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
Maybe I won't change the kernel... Still going great. I can deal with the losing sound.
[HTC 10 Guides, News, & Discussion] devsk:
I have not run into any issues with Ex kernel. I am surprised you are running into issues with it. Is anyone else facing those same issues?
[HTC 10 Guides, News, & Discussion] grega_slo:
Nope.

Tonight was a good night ?
[HTC 10 Guides, News, & Discussion] devsk:
What ROM, kernel, pmic are these screenshots from?
[HTC 10 Guides, News, & Discussion] grega_slo:
Viper, elementalx and any pmic I tested behaves exactly like this.

In particular screenshot pmic used is: http://xdaforums.com/showpost.php?p=67834863&postcount=493

But I must be very clear, original pmic produces exactly the same output for me on this particular network..
[HTC 10 Guides, News, & Discussion] andybones:
[MENTION=1416236]devsk[/MENTION]

new logs

flashed the pmic.img you wanted (v135) and ran a 2+ hour test, then a 30+ min test before bed, and then an overnight log. The alarm I forgot was set and woke me up for work, and i grabbed the log still, I hope it didn't ruin the overnight test, and if so hopefully the 2 hour one shows more.

Let me know. Attached is also my logs from Tmo (v136) for comparison.
[HTC 10 Guides, News, & Discussion] devsk:
So, 489 DHD wakes in this overnight run compared to 62 of TMO one, and this was shorter run compared to TMO one.

Kernel was active for 46mins in this run compared to 27mins in TMO run, which was longer in duration by an hour. So, effectively the kernel was active twice the time compared to TMO run.

Now, looking at the report itself, one of the things I realized just now is that the generated report only looks at 'dmesg' output, which gets truncated. So, a flood of kernel logging can wipe the previous history of suspend aborts and resumes, which seems to have happened in your latest run. So, although you have 8 times more DHD wakes, and almost twice the time spent by kernel in UL pmic with less overall idle time, the report log does not show this action in the last 230KB of the kernel log. Its a collection error. Darn!

How much battery did it lose overnight? Based on the collected data, my guess is about 1 to 1.5% per hour.

Basically, we still have this mystery of why it varies so much. Why some phones are not affected? Your phone is certainly not affected by the issue I and others are seeing. My DHD wakes overnight run into 1000-1500 range, with kernel spending 2-3 times active compared to andybones e.g. And if I run stock Ex kernel, my idle drain is 2 to 2.5% per hour. With my modified kernel, I get it down to 1.3%. Turn wifi off, it goes down to 0.4 to 0.5%.
[HTC 10 Guides, News, & Discussion] grega_slo:
My phone IS affected.

I told you twice already what I did ?

Why nobody capture wireshark log on their devices or gateways?

Check for noises...

Im 100% positive that radio firmware is super sensitive for ra messages and broadcasts (in ipv4).

EVEN if ipv6 is disabled on phone it is not disabled in radio firmware...

I think that we have to look more wide on this issue.

Not just device but all things like router os (openwrt,ddwrt) and gateways if any. Like pfsense, opnsense, cisco, smoothwall etc....

I have 2 identical setups, 2 pfsense and 2 openwrt and on one network phone sleeps on second doesn't and I know exactly why it doesn't (ipv6 ra's are confed differently)...
[HTC 10 Guides, News, & Discussion] jollywhitefoot:
This mirrors my thoughts exactly
[HTC 10 Guides, News, & Discussion] andybones:
Very interesting, would you like me to grab another overnight log when I have the time?

I forgot to mention, yea, the battery was putrid compared to Tmo, I went to sleep with 81% and awoke with just 69%. so about 12% loss over the 6 hour sleep compared to tmo 2% loss over about 8-9 hour sleep.
[HTC 10 Guides, News, & Discussion] grega_slo:
Is tmo pmic that one in flashable zip in this thread?
[HTC 10 Guides, News, & Discussion] devsk:
Your phone is showing 0.4%/hr drain with wifi ON. How is that affected? May be I missed something that you did to your phone to get 0.4%/hr drain.

I know it varies a lot from phone to phone, wifi router to router. But compare your drain with "real" affected phones. Affected phones see more than 2% drain every hour. I get 0.8% with wifi off compared to your 0.4% with wifi on, for crying out loud!

PS: I have tested RA theory multiple times. Its definitely not IPv6.
[HTC 10 Guides, News, & Discussion] grega_slo:
For me ipv6 settings make 2%/hour difference.

With wrong settings I get 2% per hour easy...
[HTC 10 Guides, News, & Discussion] andybones:
here is the one that's helped me.

(same as one uploaded previously by [MENTION=5957136]jollywhitefoot[/MENTION]

MD5:

C53A2520595796CA3FBC62577762632B
[HTC 10 Guides, News, & Discussion] grega_slo:
Yeah this is what I flashed as well...
[HTC 10 Guides, News, & Discussion] andybones:
You asked, I answered.. :)
[HTC 10 Guides, News, & Discussion] grega_slo:
Sure, thanks this is what I needed ?
[HTC 10 Guides, News, & Discussion] andybones:
:D

Sorry, I get goofy from time to time.
[HTC 10 Guides, News, & Discussion] Haldi4803:
I wanted to. Didn't find time :(

Setup VPN Server on Computer, Wireshark. And then Connect phone to von and let it Idle.

Sadly I don't have time this WE... Amsterdam, liquicity :)
[HTC 10 Guides, News, & Discussion] devsk:
That's way more than 0.4% you saw with TMO. I would say that is proof enough for me that given some conditions during idle, (and the same conditions every time), pmic is making the difference in terms of battery life.

So, we have 2 clear cut proof points for this theory.

Now, apart from this, we can definitely make the battery worse by having settings on routers which can adversely affect phone. But note that we generally don't have much control on many of the routers we interact with and defaults are mostly sane. I know of 3 such router settings that do this:

1. DTIM : lower settings generally mean more battery usage on the phone. Its 1 by default. Trying 3 instead helps.

2. Beacon interval: 100ms. Making it 500ms helps.

3. RAs: If the router advertisements are being flooded by your router, and by default the setting is quite high on most sane routers I have seen and hence not an issue, it may wake the phone very often. Tuning this interval higher (meaning less frequent RA), if your router lets you, would help as well.

Note that apart from decreasing traffic to the phone, 1. and 2. combined will make the ARP resolution slower, meaning making your router find your phone harder. 3 and 500ms are still very very safe values without any adverse effects. Just don't go ballistic on these...:D

You can disable RA completely by echo 0 > /proc/sys/net/ipv6/conf/wlan0/accept_ra ; echo 0 > /proc/sys/net/ipv6/conf/all/accept_ra ; echo 0 > /proc/sys/net/ipv6/conf/default/accept_ra . This will not harm any functionality for your day to day phone wifi usage.
[HTC 10 Guides, News, & Discussion] devsk:
This is your local settings issue. Default RA settings do not generate that much traffic. I have not met any router so far which is generating RAs more often than 30 or 60 seconds. And I have said it, aggressive settings here can be a constant source of wakeups in the phone, leading to drain.
[HTC 10 Guides, News, & Discussion] devsk:
I have attached the Ex 0.10 kernel modified to optimize wlan wakeups to the first post. I have restored the DHD OOB wakes in this release to avoid missing some of the async updates over wifi which were seen by someone in the earlier build.

I have been running this build for a few days. Its working stable.
[HTC 10 Guides, News, & Discussion] andybones:
Possible to make a kernel with your fixes for VZW base ex kernel 0.06?

https://www.androidfilehost.com/?fid=24580941124993156

Latest kernel isn't compatible with VZW old base.

If not no worries.
[HTC 10 Guides, News, & Discussion] devsk:
I will see if I can tomorrow.
[HTC 10 Guides, News, & Discussion] Genetic517:
After I said I wasn't seeing any delay in push notifications for email on wifi I started having them this week..of course, lol.... So this modified kernel may fix that?
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
So I have a huge problem that is going to force me back to T-Mo kernel. The phone is sleeping so deeply that my alarm clock isn't going off. Yesterday it didn't go off at all and today it only went off when I picked my phone up and turned it on - 5 minutes after it was supposed to go off. I can't risk missing my alarm, it's set around my medication schedule for my anxiety. Yesterday my meds were three hours late which put me in an anxious hell until my Valium kicked in an hour later. :/

App is Simple Alarm Clock and it was specifically made for Marshmallow because old apps would doze right on through but now this one is too.
[HTC 10 Guides, News, & Discussion] tkoreaper:
Have you tried the stock clock/alarm? I haven't had an issue like that since the Froyo/Gingerbread days.
[HTC 10 Guides, News, & Discussion] devsk:
Alarm clock firing should not be tied with wifi chip at all. All my kernel changes are in the DHD module which controls wifi chip only. I can say with 100% certainty that your problem is not tied with my changes or Ex kernel.

Your problem is because of something else. Are you using Greenify or some other apps which may be altering Doze behavior?
[HTC 10 Guides, News, & Discussion] devsk:
If that was with my kernel, this new ZIP using 0.10 Ex may help.
[HTC 10 Guides, News, & Discussion] Genetic517:
Nope. This was with stock.
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
Stock alarm doesn't work for me because it allows me to shut it off and not wake up. This app makes me solve a math problem in order to turn it off so I actually have to wake up.

No other apps installed that touch doze.

I went into doze settings and turned off optimization for that app but it's never had an issue before.

Either way I'm going to flash 0.10 now. I'll report back.
[HTC 10 Guides, News, & Discussion] tkoreaper:
Are you positive that you set an alarm and it was configured to go off on that particular day?
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
100% positive. In fact this morning I woke up on my own and didn't touch my phone until the alarm was 5 minutes late and as soon as I woke it up, the alarm went off, math problem and all. It's a daily recurring alarm at 7:55AM. My Valium is pretty sensitive to its schedule, I space dosing 12 hours apart which is pushing it with how rapidly my liver metabolizes it but taking it three times a day just makes me drag all day long.

Hopefully taking it out of optimization will fix it. It worked fine on the stock kernel though. If it comes down to it I have a spare LG Leon I can just use as my alarm because I'm enjoying my battery life and finding a replacement alarm clock that works in a similar manner just isn't going to happen.
[HTC 10 Guides, News, & Discussion] andybones:
OT, sorry guys, but dang, needing to solve a math problem! genius...

Just may have to give this a try
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
Pair that with the alarm sound "extreme alarm" from Zedge, this massive cacophony of alarms and sirens all going off at once... No way you're sleeping lol
[HTC 10 Guides, News, & Discussion] andybones:
For real!

P.S. (I also suffer from the nasty thing called anxiety, klonopin + xanax for me)
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
Sorry to hear that. Not something I wish on anyone. Was on that combo myself until the Klonopin just stopped working entirely one day. Explains why you need an alarm like I have though. I certainly never needed one like this before meds.

Anyway, massive derail. Sorry devsk. I'll report back on 0.10 :)
[HTC 10 Guides, News, & Discussion] tkoreaper:
How do I flash the TMO pmic? Tried flashing the zip and I get an error. I'm S-OFF.
[HTC 10 Guides, News, & Discussion] andybones:
what variant device?

you need to edit the android.info.txt accordingly.

this is mine on Verizon:

modelid: 2PS650000cidnum: VZW__001mainver: 1.19.605.22

Also it's not flashed in TWRP, but in fastboot oem rebootRUU

I uploaded mine so you can see what it looks like.

the cmd to flash are:

adb reboot bootloader

fastboot oem rebootRUU

fastboot flash zip NameOfFile.zip

fastboot reboot
[HTC 10 Guides, News, & Discussion] Allesa:
something wonderful happened...

trying to figure out what random thing i did :eek::eek::eek:

[IMG="magic"]http://i274.photobucket.com/albums/jj259/all3sa/Mobile%20Uploads/Screenshot_20160610-081252.png[/IMG]
[HTC 10 Guides, News, & Discussion] devsk:
hmm...interesting! So, no more suspend/resume in 'dmesg' output then? Can you please quickly check?
[HTC 10 Guides, News, & Discussion] EtherealRemnant:
I decided to shut off Wi-Fi... Guess what part of the image is without Wi-Fi...

This is totally unacceptable.