WEBVR often crashes on loading with iOS

  • I have webVR set up for mobile phones. It has a request to turn your phone into a landscape mode and when you do and it loads the full VR half the time it will crash. I don't have access to android at the moment, but I think this is more of an iPhone thing.

    One way to make it perform better is to close all the other apps. The problem with an intermittent fault like this this is very hard to see what might be triggering it.

    You can try it out on this link https://look-insite.de/site/TUV_Sud_A…raum/index.html

    I'm trying to work out if it is just that Mobile VR is unstable or is there something that I'm doing that is causing it?

  • Just an update on this point. I have the same problem this morning. Probably 10 other apps open on the iPhone. And the site would crash every time VR was launched in Safari. I closed all the other apps and then it launched properly. Then I launched the podcast app and launched it again successfully. But if I actually played a podcast and then try to launch it, it would crash.

    This actually doesn't happen in Firefox or Chrome on the iPhone so the issue is specifically with Safari. It would be helpful to be able to describe it and maybe create a ticket at Apple. Not something I've ever done before.

    I'm just wondering, is this a problem only for me or for other KR pano users?

  • nicoclark October 27, 2024 at 7:18 AM

    Changed the title of the thread from “WEBVR often crashes on loading with iPhone” to “WEBVR often crashes on loading with iPhone Safari”.
  • I appreciate your input index, although I'm not sure that could be the case.

    If it is a memory issue why is it that would only happen when you change into VR? The site doesn't crash when it's originally loaded. The memory you're loading is no greater when we start VR it's just the fact we are calling up a different functionality.

    You can see the example link I sent has got very little content in it apart from the panorama. 7.6 MB is loaded at the start and when you load VR it goes up by less than one megabyte.

  • Hi,

    iOS Safari is unfortunately very sensitive to GPU memory usage, when hitting some internal limit, the page will crash.

    For GPU memory usage the pixel-sizes matter, not the size of the compressed image files.

    E.g. a pixel typically needs 4byte, so an image with 1024x1024px needs 4*1024*1024 = 4 MB.
    And that size can quickly double or tripple because there might be more internal copies of the image in memory and features like mipmapping also need extra memory. And I'm not fully sure how non-power-of-two images are internally handled in iOS - they might get enlarged to the next power-of-two size or padded to some internal tile-size. That means a 2200x2200 image then might become a 4096x4096 or 2560x2560 (if tiled by 512) image.

    And your example uses a few large images and also each hotspot-textfield is basically an image. When the textfield was defined with renderer="auto" or renderer="css3d", then the textfields become first images when entering VR mode. And the VR mode itself also needs extra memory, because extra rendering buffers are required for the lens-distortion. That all together might be too much for the iOS limits...

    As solution - try using smaller image size, eventually only for iOS, and try using power-of-two-sized images.

    Additionally you can try lowering the memory.maxmem setting, although that is already very low for mobile devices:
    krpano.com - Documentation - XML Reference

    Best regards,
    Klaus

  • Thanks for the very detailed response, Klaus. I do really appreciate the fact that you've looked into the link and analysed what's going on.

    Is there a different approach for dealing with text fields so that it doesn't affect the GPU memory usage so much? Should I set the renderer as web GL?

    You said my example uses large images. Do you mean panoramic tiles because I can't see any other images that would be loaded there? So to set a smaller image size which images do I need to make smaller?

  • Oh I see! Sorry I forgot about those completely.
    I've been using these big imag files as a way of avoiding loading lots of separate images for the UI icons. Basically, we load one image and then we use crop to select an section of it. I kind of got the impression that that was the best way to work.
    Do you think I need to split these into more separate images and reduce the overall size that's loaded?

  • That's totally okay, but the 2200x2200 might be a bit too much for iOS...

    Try keeping it at 2048x2048, or maybe split it into UI and cursor - the cursor might not be needed for iOS/touch, or?

    The map images maybe could be also reduced for iOS, e.g. this way:

    Code
    url.no-ios="the-normal-image.png"
    url.ios="the-reduced-ios-image.png"

    or this way:

    Code
    url="calc:device.ios ? 'the-reduced-ios-image.png' : 'the-normal-image.png'"

    The black_Hole.png could be also much smaller (e.g. 256x256) without much affecting the result.

  • nicoclark November 2, 2024 at 8:44 AM

    Changed the title of the thread from “WEBVR often crashes on loading with iPhone Safari” to “WEBVR often crashes on loading with iOS”.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!