connman/lipstick stuttering and battery drain with WLAN enabled
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
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 +0200 )editThe 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 +0200 )editJust commenting to say that's a very well researched report.
aerique ( 2019-11-08 13:21:56 +0200 )edit