Cabbage Logo
Back to Cabbage Site

CSound seems to break Oculus Rift Dev environment in Unity

I’m trying to port a project to VR and find that I cannot run the project using an actual Rift setup. I have created a new project with minimal assets and can run it in Unity and see it on my Rift. I added a sphere and set it to bounce on a terrain which works fine. When I add a csound script to the object I cannot get the Unity project to show up on the Rift. Please help! I would love to have a csound enabled Unity game!

Thanks!!!

p.s. when I enable csound logging to console I get no errors from csound. I am using csound 2.3. Unity 2017.3.1f1

When I run Unity I get the error message:

Virtual Reality SDK Oculus failed to initialize.
Attempting to enable OpenVR instead.

XR: OpenVR Error! OpenVR failed initialization with error code VRInitError_Init_PathRegistryNotFound: “Installation path could not be located (110)”!

Virtual Reality SDK OpenVR failed to initialize.
Attempting to enable None instead.

p.p.s. The Unity-Oculus link remains broken even if I back out the Csound script. I have to restart Unity to get the Unity-Oculus link re-established. I think the breakage happens before Csound tries to play a sound, since I am not triggering any sounds in Csound when it breaks.

I’ll need a little help with this one as I don’t have access to a machine with Unity on it at the moment. Can you try the following file, just drop it in as a replacement to the existing file. When the game loads the console should print the new path, which I’ve made some modifications to. If it doesn’t work, copy and paste that path back to me :wink:

Thanks Rory. I pasted the file in and get an error message “The name ‘data’ does not exist in the current context”, and
"The name ‘updatepath’ does not exist in the current context. I assume you meant ‘dataPath’ and ‘updatedPath’, and have changed them accordingly.
I get the same initial errors that I did before. If I run the project directly from Unity startup I can see the scene in the goggles.

The first error (after the other ones I mentioned) is:

DllNotFoundException: libovravatar
OvrAvatarSDKManager.Initialize() (at Assets/Oculus/Avatar/Scripts/OvrAvatarSDKManager.ce:57)

and the console continously outputs the error

"DllNotFoundException: libovravatar
OvrAvatarSDKManager.Update() (at Assets/Oculus/Avatar/Scripts/OvrSDKManager.cs:72)

Thereafter, if I try to run the project again it cannot communicate with the Oculus Rift until I restart Unity.

Here is the printed path:

Updatedpath:D:/UnityProjects/NewVRTest4Csound/Assets/StreamingAssets;D:/UnityProjects/NewVRTest4Csound/Assets/StreamingAssets
UnityEngine.MonoBehaviour:print(Object)
CsoundUnity:Awake() (at Assets/Scripts/CsoundUnityScripts/CsoundUnity.cs:201)

Can you try that file again? I just made a few changes there that should fix the error you were getting. What we’re trying to get here is your full system path WITH the CsoundUnity stuff. I think what’s happening is we are erasing the system path temporarily, which is why the other libraries are not loading. It also explains why you have to restart unity.

That fixed my Oculus environment, thanks!!!
Now I just have to figure out why csound isn’t making a sound…

Got the sound working again, great! Now the fun begins!

Great stuff.