[One (M8) Q&A, Help & Troubleshooting] M4rketSqueezer:
Sudden power off when battery is less than 50 percent

Hi community,

I would be very glad to get some help for the problem below. Or maybe you can guide me how to provide more information to investigate it.

Problem

The phone sometimes powers itself off abruptly which can lead to database corruption. So it is very annoying...

However, it only seems to occur in some cases:

It happens as soon as battery is below 50% (this is not exact, but pretty close)

It only happens when the screen is off. May happen after 30 sec to 5 min.

It never happens when a USB cable is connected (power-only or computer)

It does not seem to happen when a "background task" is running

In some rare cases, it does not happen at all, or maybe just has not happened for a longer period of time. I could not determine what is different about the state of the phone then. When I turn the screen on once, and off again, the chances are high that it will power off very soon!

By "background task" I mean something like playing music, but I can not exactly define it. It can stay on like for one hour without any problems (screen turned off). It also stays on when, for instance, the timer is running and the screen is on.

So it does not seem to be a problem of the battery...

ROMs

I tried the following ROMs, all with the same issue. When switching ROMs, I always wiped system, data, cache, dalvik-cache. Never flashed another Zip on top (like Gapps). The device is unlocked using the official procedure by HTC.

Two official versions of cm12.1

A BlissPop v3.9 earlier build than below

BlissPop-v3.9-m8-OFFICIAL-20150827-0154 (currently running)

SkyBliss-v3.2.1-m8 (fantastic ROM, btw!)

Stock v4.19.111.2 + OTA to v4.19.111.3

More details of stock:

Relocked and flashed the Firmware v4.19.111.2 (Android File Host fid=95916177934521492)

Unlocked, flashed TWRP, then Stock v4.19.111.2 (Android File Host fid=95916177934527598)

Relocked and receive OTA v4.19.111.3

Debug

Below is a Logcat session. The numbers are line numbers. Of cource, they are not relevant, but they put things into perspective.

1163: I/PowerManagerService: Going to sleep due to screen timeout (uid 1000)...

1371: I/PowerManagerService: Dozing...

1389-1466, 5 times occured: E/libsuspend: Error writing to /sys/power/state: Device or resource busy

1467: I/PowerManagerService: Waking up from dozing (uid 1000)... (I pressed the power button to see, if it is still alive)

...

2743: I/PowerManagerService: Going to sleep due to screen timeout (uid 1000)...

2931: I/PowerManagerService: Dozing...

2942, once: E/libsuspend: Error writing to /sys/power/state: Device or resource busy

2959: The phone is dead

There are also a log of those lines when the screen is off:

I/qdhwcomposer: handle_blank_event: dpy:1 panel power state: 0

(dpy:0/1 changing a lot)

Troubleshooting

I changed the CPU governor in my current BlissPop ROM: was Lionheart, tried Ondemand, Intellidemand, and Interactive. Subjectively, it slightly reduced the amount of battery percentage when the problem begins to occur. However, the problem persists and I did not take note of the battery charge.

Left default setting for "power safer".

???

What can I do about it?

Are there any tools to investigate the problem in more detail?

Does anyone have the same problem?

Thanks a lot,

Adi