Oculus Connect 4 will feature more than 30 sessions across four tracks: Develop, Design, Distribute, and Future.

We kick things off with a keynote address on October 11!
New To The Forum? Click Here To Read The How To Guide. -- Developers Click Here.

Unity 5.6.1 - Gear VR: Choppy movements in an almost empty scene

stevehinanstevehinan Posts: 17
Virtual Boy (or Girl)
Problem:  Unity 5.6.1 - Gear VR:  Choppy movements in an almost empty scene.  Samsung Galaxy 8+

If I create a new Unity project and add a simple moving sphere or a default particle emitter and publish to Gear VR, the resulting movement is choppy regardless of frame rate.
Has anyone else experienced this problem.

I will provide details if this is not already a known issue, as I have performed lots of troubleshooting tests already.
I'm hoping the solution is something simple like turning on a setting.  I have setup my project as per the Oculus and Unity documentation.
What I would love is a bare bones, empty, pre-made unity project with all the correct settings for Gear VR set, TimeManager settings, etc.

Thanks,
Steve
Tagged:
«1

Comments

  • imperativityimperativity Posts: 1,338 Oculus Staff
    edited May 23
    Hi,

    Welcome to the Oculus Developer Forums.

    Thanks for bringing this to our attention. We are receiving similar reports from other users of Samsung Galaxy S8+ phones. Please check the other forum post here and see if this sounds similar:

    https://forums.oculus.com/developer/discussion/52675/horribly-slow-fps-on-galaxy-s8

    Would you be able to provide us with unity profiler data of your application to see where your time is being spent each cycle? 
  • stevehinanstevehinan Posts: 17
    Virtual Boy (or Girl)
    Hi and thank you for your fast response.

    The bug link you shared with me sounds like what I am experiencing.  The solution is to wait for a Unity patch that solves the issue.  If you know of a different solution I would love to hear it.

    I have attached a profile image of my Samsung Galaxy 8+ running an almost empty unity scene.  Just 1 moving default sphere, 1 default particle emitter and a directional light. All 3 game object settings are optimized.



  • imperativityimperativity Posts: 1,338 Oculus Staff
    @stevehinan

    Yes, this looks like exactly what I would expect to see here for what you have described. 'waitForGPU' is using 23.87 ms of each cycle of 16 ms. The fact that your scene is a nearly empty one is an easy way to see that this is being caused by that exact same issue in the other thread. Unfortunately there is no workaround at this time while we wait for Unity to address this issue. Thanks for providing this!
  • stevehinanstevehinan Posts: 17
    Virtual Boy (or Girl)
    Profiler capture Unity 5.6.1p4
    Problem still exists.
    Is there an option in unity, that needs to be set by me to solve this WaitForGPU issue?

  • sfaoksfaok Posts: 193
    Art3mis
    edited July 3
    I think I have the same problem. Using Unity 5.6.1p4 my app works perfectly smoothly using an S6 phone, but on S7 performance is choppy even in modest scenes. Unfortunately I don't have an S8 to test.

    There were no issues in Unity 5.4.5, performance was smooth across both S6 and S7.
    Developer of Ocean Rift.
    Follow me on Twitter @sfaok
  • sfaoksfaok Posts: 193
    Art3mis
    edited July 10
    Updating Android on my S7 appears to have fixed my issue, things are much smoother now. Apologies, probably unrelated to your problem.

    Edit : Sorry issue is still there, not sure why performance appeared smoother after update but it was short lived.
    Developer of Ocean Rift.
    Follow me on Twitter @sfaok
  • imperativityimperativity Posts: 1,338 Oculus Staff
    @sfaok

    Could you perchance send me a dropbox link with a copy of your project for our review? Thanks!
  • stevehinanstevehinan Posts: 17
    Virtual Boy (or Girl)
    Hi Imperativity,

    Yes, I have a dropbox link to my Unity project.  I'll send this link to you privately and not publicly on this forum thread.  Please tell me what email address to send the link to.
    Project details:  Unity 2017.1, Publish to Gear VR, Test device = Galaxy 8+ (US version) with latest update as of July 16 2017.

    Thanks,
    Steve
  • imperativityimperativity Posts: 1,338 Oculus Staff
    @stevehinan

    Is there any chance you could send me a dropbox link with your project via private message? Thanks in advance!
  • JianZJianZ Posts: 57 Oculus Staff
    edited July 25
    hey @stevehinan

    I'm trying to profile your app, however, from what I saw,  the scene is much more than "simple",  there are some quite big particle sprites covering a big area of the phone screen.  those are super expensive. which could be where the waitForGPU from,  however, I don't see the big spikes like what shows in your screen shot ( at the menu stage ).  

    Can you give more information?
    *  which scene and which stage the problem shows up?
    *  have you ever tried to delete the particle effects and see the impacts?
    *  is it possible to repro it in a static scene instead of the full game ( hard to locate profiling point otherwise )

    Also for the issue itself,  just want to confirm again,  on the same app, S8+ US performs much worse than S7 US?

    The good news is we do found a few GPU issues on Unity 5.5.2p1 up and pushed the suggesting fix to Unity, we can expect a big gpu improvement after they are integrated, especially on Qualcomm devices,  I'll update it here.   

    Thanks

  • stevehinanstevehinan Posts: 17
    Virtual Boy (or Girl)

    Thank you for your quick response.

    2 items I am troubleshooting:

    1 - (RESOLVED) The previous framerate issue this thread is based on has now been resolved by upgrading to Unity 2017.1, updating my Samsung Galaxy S8+ (USA), updating the Oculus app and rebuilding the Gear VR game.  The framerate has greatly improved.

    2 - When testing my Unity game in Gear VR and I press the Gear VR back button, and then return to the game, the framerate is slower.  The profiler screenshot shows before and after the back button is pressed, and the large spike is the actual transition of using the back button, dividing the before and the after. 


    Thanks,
    Steve
  • JianZJianZ Posts: 57 Oculus Staff
    @stevehinan

    1. Great

    2.  this is interesting, just want to confirm, for the back button slow down issue,  does it still exist in the project you send to us?  some user report the opposite behavior ( press back button and come back will increasing FPS ),  but we never got a good repro case,  can you provide more information for this, like when this will happen ? menu stage?  which unity version?  which model (still on S8+(USA ) ?

    Thank you
  • stevehinanstevehinan Posts: 17
    Virtual Boy (or Girl)
    @JianZ

    Yes,
    The project you have reproduces this behavior every time.

    Answers to your questions:

    - When will this happen? - Repro steps on phone:  Close all apps, launch game on phone, insert phone to Gear VR headset, play game (good framerate), press back button and return to game, slow and choppy framerate forever, until game is shut down and restarted.  This reproduces every time.

    - menu stage?  - This game has no menu stage, this behavior reproduces any time in the game.
    - Unity version 2017.1
    - Samsung Galaxy S8+

    Note: I am using the OVRPlatformMenu script provided in the Oculus Utilities to enable the Gear VR back button.

    I am in San Francisco and can bring the Samsung S8+ to you for testing.


    Thanks,
    Steve
  • JianZJianZ Posts: 57 Oculus Staff
    @stevehinan  thank you, I'll test

  • appl044appl044 Posts: 11
    Virtual Boy (or Girl)
    Sounds like memory or proceses are not released properly with the exit.  Maybe check your exit process. Also, this might confirm if processes are still running and allocated.  
    http://www.easycodeway.com/2016/07/monitor-apps-ram-usage-in-android.html?m=1
  • stevehinanstevehinan Posts: 17
    Virtual Boy (or Girl)
    Thank you for your comment.  I have not created an exit process.  

    My Gear VR back button implementation is as follows:
    1 - OVRPlatformMenu script attached to an empty gameobject in Unity scene. (script provided by Oculus)
    2 - Build & run game

    Is custom code required to manage this memory?


    Thanks,
    Steve
  • appl044appl044 Posts: 11
    Virtual Boy (or Girl)
    well, you should use this to quit.  
    Application.Quit();
    Note, Quit is ignored in the editor. 
    https://docs.unity3d.com/ScriptReference/Application.Quit.html

    You can also try and add 
    public static AsyncOperation UnloadUnusedAssets();
    if this still shows issues, but it should be cleared up without this. 
    https://docs.unity3d.com/ScriptReference/Resources.UnloadUnusedAssets.html

    I think the standard quit would be a short press, which you can attach to an event in the OVRManager 
  • palii90palii90 Posts: 3
    Virtual Boy (or Girl)
    Hi,

    Has any progress been made on this issue? Because I have similar problem with my project.
    My game running fine with 60 fps while (I press the back button) the confirm quit menu not show up, when I
    go back (I select the cancel option) to the game it run much slower (35-40 fps).
    The same thing happening when I put down the headset and wait while the device go to the idle mode, then
    I put on it. The game return to the normal state, but it run with very poor performance.
    Both cases VR.WaitForGPU spikes appears regularly in the Unity profiler.

    I tried to reproduce this with a clean project and a really simple scene. I got the same
    result, the performance drop wasn't too drastic in this case (but it was a very simple scene)
    and similar VR.WaitForGPU spikes appeared again.

    My test device: Galaxy S7 (SM-G930F) EU model, Android 7.0
    Unity: 2017.1f3 and 2017.1p3

    Thanks
    Pali
  • JianZJianZ Posts: 57 Oculus Staff
    @palii90
    Thanks for the info,  we are still on this.   you  mentioned you have a very simple project which repro the issue, can you share the repro for us to testing?   "simple" is good for debugging, which reduced the variables we need track.
  • palii90palii90 Posts: 3
    Virtual Boy (or Girl)
    Yes, I can share the test project.
    The Oculus confirm quit menu trigger the bug for me every time with this project.

  • sfaoksfaok Posts: 193
    Art3mis
    edited August 18
    I have this exact issue (same phone - Galaxy S7 Exynos, Android 7.0). When you press back button and come back, performance is much worse. The same build on S6 is fine. Unity 5.6+
    Developer of Ocean Rift.
    Follow me on Twitter @sfaok
  • stevehinanstevehinan Posts: 17
    Virtual Boy (or Girl)
    Just in case this is related, below are the Unity - Build warnings I get when building to Android - Samsung Galaxy S8+ (USA)



    Assets/OculusPlatform/Scripts/Message.cs(13,26): warning CS0108: `Oculus.Platform.Message<T>.Callback' hides inherited member `Oculus.Platform.Message.Callback'. Use the new keyword if hiding was intended


    Assets/OSPNative/scripts/ONSPAudioSource.cs(35,16): warning CS0414: The private field `ONSPAudioSource.readOnly_GlobalRelectionOn' is assigned but its value is never used


    Assets/OSPNative/scripts/ONSPAudioSource.cs(36,16): warning CS0414: The private field `ONSPAudioSource.readOnly_NumberOfUsedSpatializedVoices' is assigned but its value is never used


    Assets/VRStandardAssets/Scripts/VRDeviceManager.cs(11,40): warning CS0414: The private field `VRStandardAssets.Utils.VRDeviceManager.m_RenderScale' is assigned but its value is never used


    Unknown cpu architecture for .so library (Assets/OculusPlatform/libovrplatformloader.so)
    UnityEditor.HostView:OnGUI()


    Missing Gear VR OSIG at Assets/Plugins/Android/assets. Please see https://dashboard.oculus.com/tools/osig-generator
    UnityEngine.Debug:LogWarning(Object)
    OVRMoonlightLoader:EnforceOSIG() (at Assets/OVR/Editor/OVRMoonlightLoader.cs:161)
    UnityEditor.EditorApplication:Internal_CallDelayFunctions()
  • stevehinanstevehinan Posts: 17
    Virtual Boy (or Girl)
    @JianZ

    This might be cause of some problems:

    I am using the Unity Asset Store to import and update the Oculus Integration package.
    During the import process, multiple files do not copy over and I get an error:  Copying Temp/Export - Package/.../Assets/Plugins/x86_64/AudioPluginOculusSpatializer.dll: Access is denied.

    This is preventing me from completing a clean update of the Oculus Integration package and might be the cause of the warnings and back button memory issue.
    I need advice as how to update the Oculus Integration, deleting and reinstalling the AudioPluginOculusSpatializer.dll has not worked.
  • JianZJianZ Posts: 57 Oculus Staff
    looks like the dll is in use ( by editor ) when you are importing, so it is unable to overwrite,  can you try to backup/delete the dll when editor is off, then try to import the package again?  then restart your editor to test .

    I'll try to ping my colleague to ask what is the normal steps for updating AudioPluginOculusSpatializer.dll.
  • stevehinanstevehinan Posts: 17
    Virtual Boy (or Girl)
    @JianZ

    I want to share my Unity Oculus Integration package installation experience with you as there are issues.

    I created a new unity project and imported the Oculus Integration package from the Asset store, a fresh start:

    Unity 2017.1.0p4, Windows, Oculus Integration 1.15 from Asset Store within Unity

    1 - Create new empty Unity project
    2 - Import Oculus Integration 1.15 from Asset Store within Unity
    3 - When import completed - save project, restart Unity, reopen project, Asset Store - Oculus Integration - re-import, to verify all items installed via the import window feedback icons:

    Items still requesting update, after fresh import
    - OculusPlatformSettingsEditor.cs 
    - OVRPlugin.aar (Andriod)
    - OVRPlugin.dll (win)
    - OVRPlugin.dll (win64)
    - OVRColorRampAlpha.shader
    - Unlit Crosshair.shader

    - Select Import to re-import the files that require updating

    Error:
    Multiple plugins with the same name 'ovrplugin' (found at 'Assets/OVR/Plugins/1.14.1/Win/OVRPlugin.dll' and 'Assets/OVR/Plugins/1.14.1/Win64/OVRPlugin.dll'). That means one or more plugins are set to be compatible with Editor. Only one plugin at the time can be used by Editor.

    - Save Project
    - Quit & Restart Unity (To ensure correct results)
    - Rename Assets/OVR/Plugins/1.14.1/Win/OVRPlugin.dll to OLD_OVRPlugin.dll, to resolve conflict.  (I am on 64 bit Windows)
    - Error now resolved  (Won't this keep coming back to bite me every time I update the Oculus Integration package?)

    Warnings: There are warnings but I did not record them here, but I did record them the next time encountered.

    Asset Store - Oculus Integration Package - Import (performing this step again to verify all package items are current)

    Items requesting update, after fresh import and 2nd Import
    - OculusPlatformSettingsEditor.cs
    - OVRPlugin.aar (Andriod)
    - OLD OVRPlugin.dll (win) (it wants to update my renamed plugin!)
    - OVRPlugin.dll (win64)
    - OVRColorRampAlpha.shader
    - Unlit Crosshair.shader
    - AvatarSurfaceShader.shader
    - AvatarMaterialEditor.cs

    - Select Import to re-import the files that require updating

    Warnings:
    1 - There are inconsistent line endings in the 'Assets/OvrAvatar/Content/Materials/AvatarSurfaceShaderPBS.shader' script. Some are Mac OS X (UNIX) and some are Windows.
    This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.
    2 - There are inconsistent line endings in the 'Assets/OVR/Shaders/OVRColorRampAlpha.shader' script. Some are Mac OS X (UNIX) and some are Windows.
    This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.
    3 - There are inconsistent line endings in the 'Assets/OVR/Shaders/Unlit Crosshair.shader' script. Some are Mac OS X (UNIX) and some are Windows.
    This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.

    Asset Store - Oculus Integration Package - Import (performing this step again to verify all items are current)
    Items requesting update, after 3rd Import
    - OculusPlatformSettingsEditor.cs
    - OVRPlugin.aar (Andriod)
    - OLD OVRPlugin.dll (win) (it wants to update my renamed plugin!)
    - OVRPlugin.dll (win64)
    - OVRColorRampAlpha.shader
    - Unlit Crosshair.shader
    - AvatarSurfaceShader.shader
    - AvatarMaterialEditor.cs

    This concludes my installation.  I am unsure if this is considered a successful installation and have no way to verify.

    Thanks,
    Steve
  • stevehinanstevehinan Posts: 17
    Virtual Boy (or Girl)
    @palii90
    Did you find a solution to the back button framerate issue?  I have not.
  • stevehinanstevehinan Posts: 17
    Virtual Boy (or Girl)
    @sfaok
    Did you find a solution to the back button framerate issue?  I have not.
  • sfaoksfaok Posts: 193
    Art3mis
    edited September 1
    @stevehinan no luck, tried pretty much everything. Submitted a sample project to Unity that replicates the issue (via this thread). Hopefully they (or Oculus) can fix it. 
    Developer of Ocean Rift.
    Follow me on Twitter @sfaok
  • palii90palii90 Posts: 3
    Virtual Boy (or Girl)
    I have no luck also, but I think something really wrong with their system because the performance of my game is worse when I start it from the Oculus Home. And some other games of their store (not my games) have framerate issues on my device too. This has not been the case so far and it started one or two Oculus updates ago. I tried restart my phone but it did not help.
«1
Sign In or Register to comment.