Three.js: ios sleep mode bug

Created on 20 Jan 2017  路  14Comments  路  Source: mrdoob/three.js

(* This section is for bug reports and feature requests only. This is NOT a help site. Do not ask help questions here. If you need help, please use stackoverflow. *)

Description of the problem

There is a problem when ipad move to sleep mode. When ipad come out of sleep mode engine stops screen updating and I can see only static image. In this time all my code works, all events works fine, but screen image don`t change. If I press "home" button and click on safari again, engine will work fine and I will see all changed on the screen.
Demo projects from https://threejs.org/ have this problem too. For example I checked http://www.playkeepout.com/ and it has such problem with ipad sleep mode.

Three.js version
  • [ ] Dev
  • [ ] r82
  • [x] "0.83.0"
Browser
  • [ ] All of them
  • [ ] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
  • [x] Safari
OS
  • [ ] All of them
  • [ ] Windows
  • [ ] Linux
  • [ ] Android
  • [x] IOS
Hardware Requirements (graphics card, VR Device, ...)

iPad Air iOS 10.1.1,
iPad Air 2 iOS 10.2

All 14 comments

Do you also see this behavior with a non three.js application? What happens with e.g. this WebGL demo http://webglsamples.org/dynamic-cubemap/dynamic-cubemap.html

If it's a general problem, you should maybe file a bug here https://bugs.webkit.org/ or here https://bugreport.apple.com

Thanks for assumption. I have checked this WebGL demo and a couple of other(non three.js). They have not such problem.

I've tested this with an iPad 2 (iOS 9.3.5). When i open an example, press the power button, press it again and unlock the screen, the rendering actually works. What kind of iPad and iOS version are you using?

You should wait until ipad goes into sleep mode(by itself) to see the problem. If I press the power button and press it again, the rendering will work fine on my device too. I tested on ipad air2, ios 10.0.x and ipad air (unfortunately I can`t say exact version because I won't appear at office the next 2 days)

Is there a way how i can manually trigger the sleep mode for testing?

Sry for this dumb question, but i'm not familiar with iOS :sweat_smile:

I am not ipad expert too =) and I don`t know how to do it manually. You can set time here:
Setting>General>Auto-Lock>Set time. Unfortunately the minimal time equals 2 minutes.
Have you reproduced the bug yet?

The examples are still working even if i wait two minutes until the screen locks automatically. Um....maybe this problem does not occur in older iOS version.

I'm actually not able to update my iPad 2 to a higher iOS version than 9.3.5. Maybe we need somebody else with a newer device who can test this...

I have tested on all devices available to me:

iPad 2, iOS 8.4 - no problem
iPad 3, iOS 9.3.5 - no problem
iPad Air, iOS 10.1.1 - bug
iPad Air 2, iOS 10.2 - bug

Just a thought: Do you also have this problem with Firefox? Maybe it's Safari only...

I too ran into this problem, any updates how to solve it?

I managed to solve it by delaying the resize event. Added debounce on the event and it worked to return from sleep each time. Maybe something in Safari on iOS iPad Air that prevents the canvas from being set as active if not actively setting the viewport or canvas size after page resume. I also noticed two events when going to sleep-mode, as reported in this bug report: https://bugs.webkit.org/show_bug.cgi?id=154819 If that has something to do with it. For example if a resize event is called on a inactive canvas, messing up the attached gl-viewport.

@inear Have you also tested with Firefox? It would be interesting to know if this problem is Safari only.

@Mugen87 It's the same browser under the hood, so I would guess it's just the same. Tried it on Firefox though and it works.

Closing since it's not a three.js issue. Safari related problems should be reported and monitored here: https://bugs.webkit.org

Was this page helpful?
0 / 5 - 0 ratings