Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background issue #29

Closed
raltscn opened this issue Jul 16, 2019 · 7 comments
Closed

Background issue #29

raltscn opened this issue Jul 16, 2019 · 7 comments

Comments

@raltscn
Copy link

raltscn commented Jul 16, 2019

Once I lock the smartphone when in the middle of battle,
for a while, when I unlock the srceen and I find the battle animation was stopped in many cases.

@antest1
Copy link
Owner

antest1 commented Jul 21, 2019

I'll check about the issue.
Maybe due to the timer does not resumed?

It would be help to know me what devices and android version are you using.

@raltscn
Copy link
Author

raltscn commented Jul 21, 2019

Thank you for replying me, and both of my two devices also has this issue:

  1. SUMSUNG NOTE9(SM-N9600) with android 9
  2. Nokia 5.1 plus(X5) with android 8.1

@NoxArt
Copy link
Contributor

NoxArt commented Jul 27, 2019

I had this happen to me too: Samsung Note 8 Android 9
I think it also happened when I switched from the app to home screen and back

@raltscn
Copy link
Author

raltscn commented Jul 27, 2019

Yes, swith other app for a while and back also cause it.(sometimes)

@NoxArt NoxArt mentioned this issue Aug 13, 2019
@laplamgor
Copy link
Collaborator

laplamgor commented Oct 24, 2019

This is related to system webview (chromium) throttling.

The default behavior of Chromium (at least for version >57) is to throttle both timer tick interval and the CPU time budget. Therefore, timer-based animation (most animation in KC) will end later than it should. Using up all the budget (e.g. loading a Chuha screen during a battle) will cause it to pause completely.
https://developers.google.com/web/updates/2017/03/background_tabs

One possible solution is to use crosswalk (based on chromium 53) instead of webview. It will solve most system-level throttling of webview (also the FPS issue in issue #17). The behavior of crosswalk in background is running same x1.0 timer speed, but lowered to 30fps. CPU limit seems to be application-level.

@laplamgor
Copy link
Collaborator

Just a random thought.
The background CPU throttling limit can be worked around by implementing a "PictureInPicture" mode. Launching a PiP window will theoretically remove the background CPU time limit even if the main app is still minimized.

If you like this approach, I will try to work on it in Feb.

@raltscn
Copy link
Author

raltscn commented Mar 18, 2020

thq for picture-in-picture mode
it‘s seems working good right now

@raltscn raltscn closed this as completed Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants