/ Forums
New To The Forum? Click Here To Read The How To Guide. -- Developers Click Here.

Cannot play in editor while developing for GearVR. (Failed to initialize libOVR CAPI Error:)

boblaublawboblaublaw Posts: 23
Lawnmower Man (or Woman)
I am developing on a system which USED to have a Rift attached and the Oculus runtime installed.  However, I recently uninstalled the Oculus runtime and detached the Rift.

Now, when I try to work on my GearVR project in Unity, I find I am unable to press play in the editor. When I press play, a popup appears with the title "Failed to initialize LibOVR".  The popup body says "CAPI Error:" and nothing else.

I can build for my device and run it on the Gear just fine, however it is very inefficient to only be able to test by building to a device. How can I configure Unity/Oculus to not attempt to connect to an HMD which is not there?  Surely I do not require a Rift to develop for GearVR?

i am also seeing a warning which may or may not be related: 
VR rendering requires one of the following device types: (Direct3D11, Direct3D12). Your graphics device: OpenGLES3


Tagged:

Comments

  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    Also note that when the error pops up, I am presented with two choices "QUIT" and "OK" - pressing either button causes Unity to exit.
  • imperativityimperativity Posts: 684 Oculus Staff
    Hi,

    I am currently looking into this and will advise you on what information I find that is applicable to your situation.

  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    If it helps, I'm seeing the same problem on Unity 5.6 as well.
  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    This appears to be specific to an important project I have going.  When I start a new project in 5.6 and load in the OVR Samples, it does not crash.  How can I reset whatever oculus lib bindings exist in a given project?
  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    Perhaps a directory or DLL I can remove?  Anything? I still cannot play in editor.
  • vrdavebvrdaveb Posts: 1,622 Oculus Staff
    > How can I configure Unity/Oculus to not attempt to connect to an HMD which is not there?  Surely I do not require a Rift to develop for GearVR?

    I just tried this in 5.6 on Windows with a new project and it worked. When Unity can't initialize LibOVR, it normally fails over to non-VR. It should never crash. Can you provide %LOCALAPPDATA%\Unity\Editor\Editor.log and make sure VR support is disabled in the Windows configuration and you don't have OVRPlugin.dll anywhere in your project's Assets folder?
  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    I have tried many things with the following outcomes:
    • cleared /Library/ and rebuilt: no effect
    • reinstalled/updated OVR: no effect
    • reinstalled Oculus Home: now I get the following error:


    However, when I press OK, Unity exits/crashes, so I still cannot play in Editor.  How can I disable this?!
  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    Thanks for the reply @vrdaveb.  Here is the Editor.log.
  • vrdavebvrdaveb Posts: 1,622 Oculus Staff
    I don't see any crashes in that log. Can you provide one from just after the crash?
  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    I didn't either.  I restarted Unity, selected my project, hit "play", saw the most recent error message (screen shot above), selected "OK", then Unity exited.  Fresh log attached.

    Given that I was presented with "QUIT" and "OK", I do not expect Unity to quit when I press "OK", which is why I referred to it as "crashing", but it is entirely possible some logic has decided to exit without crash after I press "OK".
  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    It may also be worth mentioning that after Unity exits, Oculus Home starts up.
  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    If I disable OVRCameraRig (with the OVRManager attached), add a default Unity camera and press play the behavior persists.
  • vrdavebvrdaveb Posts: 1,622 Oculus Staff
    Thanks for the logs, but I don't see a smoking gun in them. Does the issue persist if you make a new project, switch to the Android build target, go to Project Settings, enable VR support, add Oculus to the list of supported devices, and press play? On my machine, that gracefully renders a non-VR view of the scene on my main monitor. If I then install the Rift Runtime, restart Unity, and press Play again, it uses the Rift for VR.
  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    I'm happy to do the test if it helps you diagnose this. (Stand by for results.) However, it isn't clear how that would help me finish this project?  Do I just bin this and start over?  I've been working on this since June 2015.

    Note, there is no longer a Rift attached to this system - I am developing for GearVR.
  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    When I start a fresh scene, change platform to Android, enable VR and select the Oculus support, I can hit Play and everything works without errors or exits.

    I also added OVR 1.13 and tried it with the OVRCameraRig - everything is fine there as well.

    Happy to do any other tests or collect any other information you can suggest.
  • vrdavebvrdaveb Posts: 1,622 Oculus Staff
    Thanks, that helps me narrow down the issue. It sounds like there is a small difference between the VR settings of your original project and the test project causing Unity to try to initialize LibOVR when you hit play. Are you using the latest copy of the Oculus Utilities?
  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    Yes, I am on version 1.13 as of a few days ago.


  • vrdavebvrdaveb Posts: 1,622 Oculus Staff
    If you make a copy of the broken project and remove everything except an empty scene with a camera, does it work? Are there any differences in the project settings between the two projects?
  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    OK, I was able to prune this down to a bare minimum project. An empty `Assets` directory and a `ProjectSettings` directory.  You can see the behavior on my system here: 

    The test project is attached.
  • vrdavebvrdaveb Posts: 1,622 Oculus Staff
    Thanks, this is very helpful. I am surprised the issue doesn't occur in a new project after enabling VR for Android and adding Oculus to the list of supported devices. I can see that's the case in your project settings. As expected, Unity tries to use VR on your Win10 machine when you hit play and ovr_Create fails. However, the pop-up is not expected from publicly-shipping builds. Does the issue persist if you uninstall the Rift runtime?
  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    Yes, actually, I've experienced this with the runtime uninstalled as well.  I reinstalled thinking that it might help but no such luck.
  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    I'll try uninstalling and retesting again for the sake of thoroughness, but it might not happen until tonight or tomorrow.
  • vrdavebvrdaveb Posts: 1,622 Oculus Staff
    If it occurs after uninstalling the Rift Runtime, you probably have a debug copy of LibOVRRT*.dll on PATH. Can you remove that and make sure OVRServer.exe isn't running? I assume you are also using the copy of OVRPlugin that came with Unity 5.6.0f3 and not some other build.
  • MeessenPhilipsMeessenPhilips Posts: 6
    Virtual Boy (or Girl)
    edited April 19
    I had the same problem after upgrading from Unity 5.5 to 5.6. Fixed it by deleting the Temp & Library folders, all Visual Studio files and the Project Settings folder (close Unity before deleting them). After this I had to re-apply all project settings manually (cumbersome work).

  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    Still looking into this - please standby!
  • boblaublawboblaublaw Posts: 23
    Lawnmower Man (or Woman)
    Apologies for the delay getting back to you with results.  I have tried all the suggestions - unfortunately there has not been an improvement.  Specifically, I:
    • removed oculus runtime
    • confirmed there was no LibOVRRT anywhere on my system
    • confirmed OVRServer was shut down
    • deleted /Assets/OVR and /Assets/Plugins/OVRGamepad.bundle
    • reinstalled OculusUtilities-1.13.0.unitypackage to ensure OVRPlugin.cs was up to date

    See attached images and let me know if anything else comes to you.

    No libOVRRT anywhere:


    No OVRServer running:


    Note the "no HMD attached" text is now missing, but it still exits no matter which I choose:


  • vrdavebvrdaveb Posts: 1,622 Oculus Staff
    Do you have any other VR SDKs in use such as SteamVR/OpenVR? Some SDKs try to wrap LibOVR and may display messages like this when our runtime isn't installed.
Sign In or Register to comment.