Search Unity

LoadAssetAsync causes freeze on Quest/Android

Discussion in 'Addressables' started by AzurySimon, Aug 3, 2020.

  1. AzurySimon

    AzurySimon

    Joined:
    Jul 16, 2018
    Posts:
    34
    Hey,


    We added addressables to our Oculus Quest (Android) app and are experiencing a weird issue when loading our assets using LoadAssetAsync.

    In a first prototype we just had 2 ScriptableObject in our default local group. These two objects referenced a bunch of other assets including a list of very large 8k images. This worked fine (besides pretty long loading times), the app kept running fine while loading these addressables.

    We are now trying to switch to loading the assets separately. I.e. creating an addressable for each image and load it instead of loading the ScriptableObject holding references to them. For standalone win64 this works totally fine. For Andoid on the other hand it comes with a large freeze for each image we load. The duration of the freeze scales with the size of the image, up to multiple seconds per asset. Sometimes the app freezes for the whole duration of loading the addressables, not even unfreezing for a single frame in between.

    We tried out a lot of things to fix this, including putting wrappers around our images and load these. Putting a wrapper around each object results in lower time freeze, creating a wrapper that holds a list of images and load that list has again a better performance. (ScriptableObject as addressable, with a (non-addressable) reference to a single image or with a list/array of images). Using more layers of wrapping around these assets seems to further improve performance, which is really weird.

    Either way these freezes are completely unacceptable for a VR app. Additionally on the quest this apparently leads to the OS killing the app after a certain time of unresponsiveness.

    Some additional facts:
    The groups that hold our addressables hold around 50 assets
    We load by address (string) using Addressables.LoadAssetAsync<Type>(address);
    We are using Unity 2019.3.12f1 and Addressables 1.12.0

    Has anyone experienced something similar?
    Is this an issue with loading textures or other assets directly vs loading them as "dependencies" of custom ScriptableObjects?
     
unityunity