Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
nickpittom's avatar
nickpittom
Protege
10 years ago

GearVR - VERY long initial loading time. REALLY long.

Unity 5.1.2f - Note 4 and S6 both tested.

This has been an issue since moving the project from Unity 4 to Unity 5. I tried Unity 5.2 but it didn't help and indeed wouldn't even LAUNCH the files on the phones.

Loading times in Editor are practically instant, but on both phones it's over 3mins. I've tried to see if it's something in the project, but no luck. Deleting anything that DOES anything - scripts etc - helps, but not a lot, and I need scripts to run it :D

File size is around 130mb fully built, so I wouldn't think it was the size of the project. Could it be an individual asset?

Are there any known scripts, settings, audio compression, anything that will increase load times to this level? Anyway I can see what's causing such an issue?

Currently I am changing settings at random hoping for the best...

EDIT: Ok, so stripping out all audio appears to drop file size from 130mb to 83mb and takes load times to 50seconds... It would appear to be something, but not really practical...

8 Replies

Replies have been turned off for this discussion
  • How long are we talking here, 10 minutes? an hour? Can you send the full logcat from a run with the issue (run "adb logcat > log.txt" and attach it here)? Are you using compressed textures and GLES2? Does the issue occur if you use GLES3 and force ASTC compression?
  • "vrdaveb" wrote:
    How long are we talking here, 10 minutes? an hour? Can you send the full logcat from a run with the issue (run "adb logcat > log.txt" and attach it here)? Are you using compressed textures and GLES2? Does the issue occur if you use GLES3 and force ASTC compression?

    Not 10mins, but over 3mins.

    I just deleted all the audio and script related assets from the scene and tested and it loaded quickly - it's not textures at all, but something in the scripts I think... perhaps the audio as well.

    This doesn't happen in the Unity 4 build, but we were having audio problems with the 4 build, so had to upgrade.
  • Thanks. Logcat from one of the slow runs would help us narrow down the issue.
  • "vrdaveb" wrote:
    Thanks. Logcat from one of the slow runs would help us narrow down the issue.


    Ok - seems I figured it out - will get back with info...
  • Hmm, so to sum up the issues...

    Unity 4 has an audio latency bug. Builds for S6 will work first time after install, but then the audio goes 'crunchy' and to relaunch it again you have to REINSTALL it - and it works once more. Not ideal.

    Unity 5.1.2f works, but introduces LONG load times, due in part to a bug in 'Resources.Load' which is fixed in 5.1.3

    Unity 5.1.3 and 5.2 will NOT build to GearVR and crash out during build with the following errors:

    http://i.imgur.com/Pc9Bx9H.png

    The primary one not seen in the above is:

    UnityException: Plugin Bundle ID conflict detected!
    Package com.oculus.Integration has conflicts with other plugins. See the Console for details.
    UnityEditor.Android.PostProcessAndroidPlayer.ShowErrDlgAndThrow (System.String title, System.String message, System.Exception ex)
    UnityEditor.Android.PostProcessAndroidPlayer.ShowErrDlgAndThrow (System.String title, System.String message)
    UnityEditor.Android.PostProcessAndroidPlayer.CheckPluginsBundleIdForConflicts (System.String stagingArea, UnityEditor.Android.AndroidLibraries androidLibraries)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args)
    UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316)
    UnityEditor.HostView:OnGUI()

    So it seems I am currently stuck until GearVR will build on a newer version than 5.1.3
  • I'll keep looking at the log, but the first thing I notice is:
    D/Unity   ( 6781): Fragment shader compilation failed.

    D/Unity ( 6781): ERROR: 0:26: ':' : wrong operand types no operation ':' exists that takes a left-hand operand of type '3-component vector of float' and a right operand of type 'const float' (or there is no acceptable conversion)

    D/Unity ( 6781): ERROR: 0:26: '=' : cannot convert from 'const float' to '3-component vector of float'

    D/Unity ( 6781): ERROR: 2 compilation errors. No code generated.

    The full shader is also dumped in the log to help you narrow down the issue.

    "nickpittom" wrote:
    Unity 4 has an audio latency bug.

    Are you using 4.6.8? There was a known bug like you described with Gear VR audio in older builds.

    "nickpittom" wrote:
    bug in 'Resources.Load' which is fixed in 5.1.3

    Are you sure this isn't actually the above shader compilation error? I've used Resources.Load with 5.1.2f1 and earlier without problems. If Unity actually fixed a bug here, this is the first time I've heard and it would be great to get more detail about it.

    "nickpittom" wrote:
    UnityException: Plugin Bundle ID conflict detected!

    Try changing the case of the O in oculus in the bundle ID.
  • So the bundle ID was a weird thing - it shouldn't have reset to the default, but it did. I changed that and that error went away.

    The only issue with 5 now appears to be V long load times still :)

    In any case I MAY have gotten Unity 4 working with the latest build! :D Just testing thoroughly.

    Yup! Appears to work well in 4, so I'll stick with that for now :)