#452 Android: slow unlocking from screensaver

open
Alex Wulms
5
2013-11-04
2012-12-03
No

<Quibus> when openMSX is running and the 'screensaver' kicked in (so I have to unlock the device again), this unlocking goes very slowly. Is openMSX using CPU power or is it a memory issue?
<awulms> it might be that openmsx keeps running on the background
<awulms> I must investigate
<Quibus> awulms: well, sound is stopped, at least

Discussion

  • Alex Wulms
    Alex Wulms
    2012-12-15

    Updated openMSX to go into 'blocked' mode when an SDL_ACTIVEVENT 'de-activete' is recieved and to return to 'running' mode when en SDL_ACTIVEVENT 'activate' is received.

    It has significantly improved the situation.

    However, openMSX is still using up to 12% CPU when in background, which is more then expected and a drain on the battery. Needs to be further investigated.

     
  • Alex Wulms
    Alex Wulms
    2013-11-03

    Tested today with app "CPU Monitor" and according to "CPU Monitor" app, openMSX uses 0% CPU when it is in background. I tested it on a Samsung Galaxy Nexus with Android 4.3

    It would be good if somebody can also test again on a device with an older version of Android.

    Test scenario:
    -Install app "CPU Monitor" from google-play
    -Start recording CPU usage with CPU monitor
    -Start openMSX and start a game or demo that uses CPU, VDP and Sound chips
    -Send openMSX to background (e.g. by returning to the launcher)
    -Wait a minute
    -Return to CPU Monitor app
    -Stop recording
    -View the graph for "openMSX" in CPU Monitor app. On my nexus it drops to 0% as soon as openMSX goes to the background

    I don't remember by heart which improvements I did since last year to decrease CPU usage when openMSX is in background.

     
  • Trying a run of Vampire Killer on my Samsung Galaxy Gio and pressing the button to go to the main menu and forcing openMSX in the background.

    <Quibus> awulms: my 'Active applications' display says: 21.58MB RAM usage and 3.14% CPU
    <Quibus> it varies a bit between 2 and 4%

     
  • Perhaps the whole initial issue isn't relevant anymore, because when I test now, my phone does not get into the screensaver mode when I run a game :)