CM7 bluetooth stack for Optimus One/p500/p509 is a battery drainer

I have been fighting massive battery drain in official CM7.2, as in “40% battery consumption while sitting on the bedstand overnight.”  Stock ROM minus the bloatware would use less than 10% overnight.

Then I remembered a problem I had with Mik’s unofficial CM7.

A2DP bluetooth (stereo/media) worked early on.  SCO (regular phone audio) did not, and it was relatively late in the game when it got added in Mik’s unofficial 7.1.

It worked fine, but clobbered the battery.  The phone just would. not. sleep.  100% kernel wakelocks on msm_serial_hs_dma.   Arggghhhh.

Got around it in Mik’s thusly:  use  Tasker or manually turn off that radio when not used.  Via tasker:

1.   turn on BT when launching any app where BT might be required.  Since app-driven tasker profiles exit when the app goes to  the background, I also set an exit task to turn on BT.  This is fine because there’s a task that will …

2.  automagically turn off BT if unpaired for N minutes.

I overnight tested CM7 with BT off and it went back to the normal ~8% drop overnight.  Re-instituted the BT tasker profiles and all is well.  This will bandaid it until CM7 BT stack gets debugged.


7 responses to “CM7 bluetooth stack for Optimus One/p500/p509 is a battery drainer

  1. Did the problem start when SCO was added or did you just never have bluetooth turned on before that and so never noticed?

  2. {edited to add: I used A2DP before SCO was functional. Since I used SCO extensively on the stock ROM I was in the habit of leaving BT on. Having it on made no appreciable difference in batt life on the stock ROM.}

    I didn’t remember it offhand, but I googled around and found this post I made which seems to nail it down:

    It appears I had the BT battery drain problem /before/ SCO was working. Thanks for asking; it’s helped clarify my understanding of the order of events.

    The msm wakelock thing mentioned above shows up in some UART-related android sourcecode, so maybe it’s BT file transfer stuff?

  3. I have an optimus S and was using a CM7 port for it (tried two different ones actually) and had the same massive battery drain issue with bluetooth on so it must be something will all CM7 roms and this phone type. I was messing around with some .conf files in system/etc/bluetooth trying to find a way to fix it and couldn’t really get anything to work. I am not anywhere near a developer or anything so I don’t really know what I am doing. Maybe there is some way to turn off whatever bluetooth profile/feature is causing the battery drain? For example in system/etc/bluetooth/main.conf there is a line that is commented out that says #DisablePlugins = network,input. Maybe something can be disabled here? I couldn’t really find any documentation of this, plus its annoying when it takes hours to see it it has had any effect on the battery.

  4. I mounted /system rw and uncommented the
    #DisablePlugins = network,input
    line and rebooted. This should make the network and input plugins disabled. I think these refer to DUN-style networking over BT and things like mouse/keyboard. Rebooted and BT still connected fine to SCO.

    msm_serial_hs_dma wakelocks continue to keep the phone awake so it appears the network/input plugins aren’t the culprit (or maybe that line does not really disable them).

  5. hmm found more info:

    “I figured out what is causing the lock to stay in place, though: The UART clock is never disabled.”
    I am not going to pretend I know what this means…

  6. Pingback: CyanogenMod apostacy | mindful omnivore

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s