The bluetooth crazy CPU usage creates battery drain [solved]

SailFish OS version: 4.5.0.19
Android Support: licensed but usually not running
Hardware: Xperia 10 II


During and after the bluetooth use the CPU is kept running high:

in my case, for days systemd-udev was using a lot of CPU time until I did:

systemctl restart systemd-udev

Unless and until a solution will be found, I suggest to add the execution of this command each time the bluetooth is disable by the top-menu (or from everywhere else).


UPDATE #1

The problem is not only related to bluetooth. The full restarting line is here below:

systemctl restart systemd-udevd systemd-udevd-kernel.socket \
                   systemd-udevd-control.socket

Moreover, this command helps to debug the problem with the service:

/usr/lib/systemd/systemd-udevd -D


UPDATE #2

I created a patch to fix some rules for udev and now does not complains anymore about errors, at least. I released the patch in ALPHA state because I did not tested extensively it.


UPDATE #3

I wrote a script that collect data about the amount of the current that the smartphone (Xperia 10 II) sucks form the battery and this is an example:

Battery status: discharging
log: /root/.batt_curr_stats.log
data set: 1965 items

now:  -337 mA
min:   -59 mA
max:  -801 mA

avg:  -232 mA ( 1 minute)
avg:  -252 mA ( 2 minute)
avg:  -234 mA ( 5 minute)
avg:  -248 mA (10 minute)
avg:  -235 mA (15 minute)

Unfortunately I discovered that sleep 1 is not as reliable as much as in other GNU/Linux systems. In fact, its time jittering is quite HUGE and it lasts between 1s and 2.6s.


UPDATE #4

After this modding:

Listening music from 4G mobile date streaming with a bluetooth headphones will raise the battery drain from 6%/h (daylight power save mode) to 8%/h which is acceptable (12h of music listening). Therefore, the issue can be considered having a solution.

2 Likes

The others two candidates for an optimizations are d-bus daemon and lipstick daemon. For the first the hopes are in better shape that the proprietary 2nd one. Using htop and ordering for time spent in CPU their are the two winners. However, at the moment with the patch above applied and with this power management configuration:

the CPU usage did not impact anymore with the battery which discharge rate with 4G and WiFi tethering active is around 6%/h which means that with the battery fully charged are about 16h of working as 4G-Wifi router plus some user interactions.