openvr icon indicating copy to clipboard operation
openvr copied to clipboard

Init_PathRegistryNotFound with c#

Open AlexanderAchberger opened this issue 1 year ago • 1 comments

Hi all,

I am trying to Initialize openvr in a own c# application. I added the openvr_api.dll and openvr_api.cs file in my project and tried to initialize openVR:

...
using Valve.VR;

public MainPage()
{
    this.InitializeComponent();
    EVRInitError error = EVRInitError.None;

    CVRSystem  CVR = Valve.VR.OpenVR.Init(ref error, EVRApplicationType.VRApplication_Utility);
    if (error is EVRInitError.None)
    {

    }
}

However, error is always Init_PathRegistryNotFound. My steamVr it turned on and my HMD is detected. Unity applications are also working with SteamVR.

Is there something I am doing wrong? Do I have to assign a path somewhere?

Thanks a lot.

AlexanderAchberger avatar Feb 20 '24 16:02 AlexanderAchberger

I checked the code and discovered the problem is the function CVRPathRegistry_Public::GetPaths . Here it tries to open and read the file openvrpaths.vrpath in my local app data folder. On my system, the file exists and contains path information. I do not understand why CVRPathRegistry_Public::GetPaths does not find that file.

However, if I set the environment variables VR_OVERRIDE VR_CONFIG_PATH VR_LOG_PATH I am receiving the error VRInitError_Init_NoLogPath.

Any ideas what the problem could be?

AlexanderAchberger avatar Feb 22 '24 07:02 AlexanderAchberger