VolcanoMobile/fluidsynth-android

The Android app uses all the battery even when not running

Closed this issue · 5 comments

FluidSynth version

Not sure how to check in android, but it's the one last deployed on Sept 22 2021. It had the exact same problem even on the previous few releases (probably since the UI change).

Describe the bug

I use FluidSynthMIDI to play my keyboard controller and it works great. I stop the app (details below) when battery is at (say) 80%. After (say) 12 hours the battery is drained at 20%
See below why I claim it's a FluidSynthMIDI bug rather than some other app.

Expected behavior

The app should not drain any battery when not in use

Steps to reproduce

  1. Add FluidSynthMIDI to the list of "Deep Sleeping App" in the Android settings trying to avoid it running when in background.
  2. Use FluidSynthMIDI to play a MIDI keyboard controller, attached via USB
  3. Finish playing, close FluidSynthMIDI and detach the USB cable (and the speaker cable if one was used).
  4. Make sure the app is "really" [1] closed by clicking the three-line button on the Android device and swiping FluidSynthMIDI away.
  5. Wait 12 hours, see the battery greatly depleted
  6. Go into Android's Battery and device care, click on the battery plot to show details and the list of the battery usage by app
  7. See most apps topped at max 1-2% battery utilization, whereas FluidSynthMIDI have drained 40-70% of the battery while being in background and doing absolutely nothing (despite 1 which should have prevented it, so again, Android is to blame too)

Additional context

This is on a Samsung Galaxy A50 running Android 11.

[1]: Android is also to blame here, since apps are never "really" closed, but that is the most we can do.

should be fixed in 2.0.25 can you report your results with this version here
Thanks for bringing this issue to my attention

Thank you for acting on it so quickly. I would definitely test it out and let you know asap.
Should I also test when the app is not in the deep sleeping list or the just sleeping list or is that a moot point?

Since that deep sleeping list seems to be specific to your device / brand, I have no clues on what it does.

Regardless because even when the app is in foreground, it shouldn't eat your battery when the input port is not connected.
When the input port is connected the Audio thread is started and runs fluidsynth.

Normally the apps run in background to allow, e.g. notifications even when they are not in foreground.

The "sleeping" list limits the time/power that apps can use in background (and hence make them possibly slower in such situation). The "deep sleeping" list allegedly make it impossible for the apps to run in background in the first place, so they should draw no power whatsoever when in background (and possibly break them, e.g. if they are a messaging app). Not sure how FluidSynthMIDI was able to circumvent that limitation, but it did. FWIW, my device is a Samsung A50 running Android 11.

In any case, with the newer version the problem is gone, so I am closing this ticket. Thanks!

Thanks for the feedback