ubports / ubuntu-touch

Ubuntu Touch's issue inbox is now migrated to GitLab.
https://gitlab.com/ubports/ubuntu-touch
1.28k stars 110 forks source link

Bluetooth wakelock prevents the device from going deep sleep #676

Open duud opened 6 years ago

duud commented 6 years ago

Hammerhead doesn't go deep sleep because of msm_serial_hs_dma wake lock is held all the time, even with bluetooth disabled. You can check this by 'cat /sys/kernel/debug/wakeup_sources'.

Killing '/usr/bin/hciattach' releases the wakelock such that the device properly goes deep sleep which implies that bluetooth power-management isn't working properly currently.

Flohack74 commented 6 years ago

Are you sure this is specific to xenial, and it worked in vivid? Otherwise, please remove xenial tag in title.

duud commented 6 years ago

I've tested this on xenial only. So that's the most accurate description I can provide. Maybe someone who is using vivid is able to check if this issue appears there too.

mauricioduarte01 commented 6 years ago

This is HUGE, how can I help you with testing on vivid?

libermax commented 6 years ago

See the same on my N5 with vivid and 'cat /sys/kernel/debug/wakeup_sources | grep msm'. Will see in the night if battery behave better after killing hciattach process.

mauricioduarte01 commented 6 years ago

I am testing it now after sudo pkill -9 hciattach , I also did what @libermax said, but I am not sure what parameters should I look and how to read the output. N5 vivid

libermax commented 6 years ago

Killing '/usr/bin/hciattach' does'nt help for battery on my N5/vivid: -15% for 10 hours in flight mode ~ same without killing.

mauricioduarte01 commented 6 years ago

First tests for me, with N5/vivid, after sudo pkill -9 hciattach . 10:00 am 100% 17:30 pm 80% 20:30 pm 74%

-10hours30min

Test was made without using the phone, just locked state. +Wifi +Location serv. +4g +Weather indicator. First impressions: I can notice a huge battery improvement in my situation, the N5 is old and the battery doesn't last longer than 11-12 hours under normal use. I will try to test now without killing the hciattach process and compare the results. I think this issue needs a special attention.

photo_2018-06-16_20-48-50

kugiigi commented 6 years ago

I tested this on my Nexus 5 with vivid. Without killing it, it normally drops down by ~20% overnight (7-9hours). I tried killing the process 2 times. The first time, it only dropped 9% and the second time with just 3%. Not sure though if the battery percentage was just stuck similar to the known issur with bq devices.