We have moved to a new Sailfish OS Forum. Please start new discussions there.
10

connman/lipstick stuttering and battery drain with WLAN enabled

Tracked by Jolla (In release)

asked 2019-11-01 13:44:46 +0300

mia gravatar image

updated 2019-11-02 12:28:09 +0300

Connman does something periodically (scanning WLANs?) that causes lipstick to stutter every few seconds, network I/O to stall and constant background CPU usage when WLAN is enabled. This also drains the battery very quickly, to the point where an Xperia X with no running apps and the display off won’t last even one day.

This happens whether or not the device is connected to a network, but the effect is much worse when no known networks are nearby.

Disabling WLAN makes these problems go away.

Edit: I just checked dbus-monitor and indeed it looks like connman is scanning wifi networks every 3 seconds or so, and then dumps all the info, which is very slow. This explains the above observations.

Edit 2: Setting breakpoints in connman with gdb points to connman/plugins/sailfish_wifi.c as the source of the problem. The autoscan timer appears to get registered too many times, which causes it to get triggered way too frequently. I have not tried to confirm this though.

Edit 3: Found the offender, at least for the case where there’s an active connection: https://git.sailfishos.org/mer-core/connman/blob/master/connman/plugins/sailfish_wifi.c#L2645-2648

Commenting these lines fixes the problem but I have no idea why they’re there in the first place.

Edit 4: Found what’s causing problems when not associated with a network: https://git.sailfishos.org/mer-core/connman/blob/master/connman/plugins/sailfish_wifi.c#L2859-2868

IMO this is completely unnecessary.

tl;dr connman has never been tested in densely populated areas with lots of wifi networks, and scans way too frequently, which drains the battery and makes the system less responsive

edit retag flag offensive close delete

Comments

my xperia x has much better battery life with 3.2.0.11 and my Wlan stays always on. But it's still way less compared with android.

danfin ( 2019-11-01 17:59:17 +0300 )edit

The WLAN activity also interferes with BT music streaming, causing the music to stutter regularly. For this reason I have WLAN turned off at all times unless I actually need it.

Your explanation sounds like the root cause of this issue as well.

I have not had to to verify whether the problem still exists in 3.2.0.12 yet (I have an X).

DrDweeb ( 2019-11-02 05:44:16 +0300 )edit
1

Just commenting to say that's a very well researched report.

aerique ( 2019-11-08 13:21:56 +0300 )edit

1 Answer

Sort by » oldest newest most voted
5

answered 2019-11-02 13:05:17 +0300

spiiroin gravatar image

FYI: I created an internal ticket about this.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2019-11-01 13:44:46 +0300

Seen: 410 times

Last updated: Nov 02 '19