Oculus audio plug-in failed to initialize

I’m using 4.11 branch as of February 23 and when I activate the Oculus audio plug-in, I have the following error in the editor’s output log:

LogInit: XAudio2 using ‘Speakers (Realtek High Definition Audio)’ : 2 channels at 48 kHz using 32 bits per sample (channel mask 0x3)
LogAudio:Error: Oculus Audio SDK Error - Failed to initialize OVR Audio system: Unknown Error
LogInit: FAudioDevice initialized.

My steps to get this far:

  1. Enable the Oculus audio plugin
  2. Restart the editor
  3. See the above error in the output log

In looking at the plug-in’s source, this is the result of line 240 in OculusAudio.cpp:

		// Initialize the OVR Audio SDK before making any calls to ovrAudio
		ovrResult Result = ovrAudio_Initialize();
		OVR_AUDIO_CHECK(Result, "Failed to initialize OVR Audio system");

Which means the failure is occurring within the ovraudio64.dll itself. Any ideas on what needs to happen to get the Oculus audio plug-in to work? Thanks!

This morning I thought I would try an uncooked version of the game (project launched with -game) to see if this error was only in the editor. Unfortunately, this same error is in the logs.

Hi Gnometech,

We haven’t seen any issues like this with our own testing in the 4.11 branch so it’s hard to say what might be going on, especially because the error code is “unknown”.

Do you know the specific error number/enumeration returned from the call? Is it specifically 2000 (ovrError_AudioUnknown) or something else. We default to ovrError_AudioUnknown if the specific error number isn’t handled. I wrote specific cases for all their error enumerations but just curious if its spitting something else out.

Hey! Thanks for responding.

Just before posting the above, I modified OVR_AUDIO_CHECK just to confirm that it was indeed ovrError_AudioUnknown that was being returned. I realized that the switch statement used to convert the code to text would spit out unknown for any error code that wasn’t specified.

#define OVR_AUDIO_CHECK(Result, Context)																\
    	if (Result != ovrSuccess)																			\
	{																									\
		const TCHAR* ErrString = GetOculusErrorString(Result);											\
		UE_LOG(LogAudio, Error, TEXT("Oculus Audio SDK Error - %s: %s [%d]"), TEXT(Context), ErrString, Result);	\
		return;																							\
	}

And sure enough, error 2000 was output to the log:

LogInit: XAudio2 using 'Speakers (Realtek High Definition Audio)' : 2 channels at 48 kHz using 32 bits per sample (channel mask 0x3)
LogAudio:Error: Oculus Audio SDK Error - Failed to initialize OVR Audio system: Unknown Error [2000]
LogInit: FAudioDevice initialized.

Being unknown, it is really hard to troubleshoot. :slight_smile:

You make any headway? I’d suggest maybe force-syncing the plugin (or double-check everything is updated) to make sure you have the right everything. It’s supposed to have an error if the dll is the wrong version, but it might be corrupt, not loading, etc.

I’ve deleted the ovraudio64.dll file and then performed a forced setup, and it popped back into place. Unfortunately, I’m still getting the same error message. I’ll see about updating from the 4.11 branch again, but I didn’t see anything related to the Oculus audio plug-in in the commits.

Is there some place I can independently download this file from to test with? I’ve downloaded the three most recent Oculus Audio SDK’s and cannot find this file in there. Where does it originate from? Would it be possible for you to send me yours to test with?

Thanks!

Weird. I can’t attach a dll here and I don’t think I can legally post it anywhere. I’d link to github but the 3rd party binary is not visible there. Have you stepped through the module initialization code? I’m going to ping one of the programmers here who fully groks the plugin/module-load stuff and see if he has any ideas.

I updated to the latest 4.11 branch updates as of this morning. Deleted the DLL, and rebuilt everything. The DLL was put back. Stepped through FOculusAudioPlugin::Initialize() and from what I can tell, the DLL loads in correctly (a handle is obtained by LoadModule()). Then I reach the line:

		ovrResult Result = ovrAudio_Initialize();
		OVR_AUDIO_CHECK(Result, "Failed to initialize OVR Audio system");

and I still received a result code of 2000. So still a no go. I can’t step through ovrAudio_Initialize() of course, so no idea what is happening in that black box.

When I open ovraudio64.dll in Microsoft’s Dependency Walker, I get the following errors:

Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.

And interestingly, I cannot find the ovrAudio_Initialize function within the function ordinal list within Dependency Walker.

Should I be asking Oculus about ovraudio64.dll? I’m still not sure who owns it and where it came from.

If you are able to send me your copy of the DLL to test with, you could use Google Drive or something similar and send an email to TheHeadGnome at gnometech.com. Thanks!

Oh, I also wanted to add that when LoadModule() is called, I see the following in the debug output:

'UE4Editor.exe' (Win32): Loaded 'M:\Dave\GitHub\UnrealEngine-4.11\Engine\Binaries\ThirdParty\Oculus\Audio\Win64\ovraudio64.dll'. Cannot find or open the PDB file.

So it does appear that the DLL is loading.

Well, the dependency walker caught what was going wrong. The question is why. Are you running 32 bit or 64 bit? I assume 64 since we’ve never supported a 32 bit OVR dll.

Yes, only compiling as Win64. I don’t have any binaries in the Win32 directories.

According to this, Dependency Walker reporting 32bit DLL’s can be ignored: https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/393036

What happens when you try to load the old dll? Presumably it should give you an error indicating the version is wrong. But that would at least confirm that it’s loading the dll properly.

I copied the 4.10 version of the DLL into my 4.11 branch and tried again. I get the same 2000 result. Looking at the code in OculusAudio.cpp, the check for version happens after the initialize, so we cannot rely on that:

		// Initialize the OVR Audio SDK before making any calls to ovrAudio
		ovrResult Result = ovrAudio_Initialize();
		OVR_AUDIO_CHECK(Result, "Failed to initialize OVR Audio system");

		const char* OvrVersionString = ovrAudio_GetVersion(&MajorVersionNumber, &MinorVersionNumber, &PatchNumber);
		if (MajorVersionNumber != OVR_AUDIO_MAJOR_VERSION || MinorVersionNumber != OVR_AUDIO_MINOR_VERSION)
		{
			UE_LOG(LogAudio, Warning, TEXT("Using mismatched OVR Audio SDK Versiont! %d.%d vs. %d.%d"), OVR_AUDIO_MAJOR_VERSION, OVR_AUDIO_MINOR_VERSION, MajorVersionNumber, MinorVersionNumber);
			return;
		}
		FOculusAudioPlugin::bInitialized = true;

Thanks for trying to help. I’m really at a loss as to what to do without being able to talk to the person that created ovraudio64.dll and find out under what conditions a 2000 result happens.

Yeah me too… I believe one of the possible errors that can output from ovrAudio_Initialize() is that the version is wrong (i.e. header mismatches the loaded dll version). I’ll ping the oculus audio guys and see if they have any ideas. We’re not seeing this issue on our end and other users have had no issues running the updated dll (they’ve found other bugs, but not this!)

Ok, one of the programmers at Oculus looked at this thread and had the following suggestions:

“Scanning through the code, the most likely cause is that the DLL failed to load.
It could be missing C runtime DLL. Our current release compiles with /MD. This will be changed to /MT for the next release to prevent this kind of issue.”

And:

“Another thought: possibly trying to load 32-bit DLL in 64-bit process?”

So, related to his suggestions, we’ve talked about your system itself being 64 bit, but are you accidentally compiling the 32 bit version of UE4? The 64 bit oculus dll we’re using won’t work with 32 bit UE4.

His comment about the /MD vs /MT is interesting. The /MD compile option dynamically links to the c-runtime lib vs statically linking. /MD, -MT, -LD (Use Run-Time Library) | Microsoft Learn

Thanks for sticking with this one. I’ve done a couple of things to make sure that UE4 is indeed running as a 64bit process (other than making sure that Win64 is chosen in Visual Studio). Using Visual Studio’s “dumpbin /headers” on UE4Editor.exe, my game’s DLL, and ovraudio64.dll, I see the following in the header info for each:

8664 machine (x64)
20B magic # (PE32+)

So it seems that everything is 64bit. When running my game as DebugGame Editor in debug mode, I see that 64bit versions of libraries are being loaded. For example, OpenVR is coming in as:

Loaded 'M:\Dave\GitHub\UnrealEngine-4.11\Engine\Binaries\ThirdParty\OpenVR\OpenVRv0_9_12\win64\openvr_api.dll'. Cannot find or open the PDB file.
Loaded 'C:\Program Files (x86)\Steam\steamapps\common\OpenVR\bin\vrclient_x64.dll'. Cannot find or open the PDB file.
Loaded 'C:\Program Files (x86)\Steam\steamapps\common\OpenVR\drivers\lighthouse\bin\win64\driver_lighthouse.dll'. Cannot find or open the PDB file.

etc. And of course, my game does work on the Vive fine like this, so it feels like everything is coming in as 64bit.

As with all of the other library loading, ovraudio64.dll shows the following in the debug output:

Loaded 'M:\Dave\GitHub\UnrealEngine-4.11\Engine\Binaries\ThirdParty\Oculus\Audio\Win64\ovraudio64.dll'. Cannot find or open the PDB file.

So it seems like the DLL is loading fine. The engine appears to grab a handle to the DLL when it is loaded. I would have thought that a 32bit process attempting to load a 64bit library would just fail. I don’t think Windows would allow for the mixing of address spaces.

…continued from previous comment.

As a test, I took C:\Windows\SysWOW64\advapi32.dll and placed it into Engine\Binaries\ThirdParty\Oculus\Audio\Win64. I renamed the original ovraudio64.dll out of the way, and renamed this 32bit DLL to ovraudio64.dll. I then started up my game in the UE4 editor as a debug build and see the following:

Loaded 'M:\Dave\GitHub\UnrealEngine-4.11\Engine\Binaries\ThirdParty\Oculus\Audio\Win64\ovraudio64.dll'. Cannot find or open the PDB file.
Unloaded 'M:\Dave\GitHub\UnrealEngine-4.11\Engine\Binaries\ThirdParty\Oculus\Audio\Win64\ovraudio64.dll'
[2016.03.03-20.23.43:440][  0]LogAudio:Error: Failed to load OVR Audio dll
[2016.03.03-20.23.43:441][  0]LogAudio:Error: Oculus Audio SDK Error - Failed to create simple context: Missing DLL [2003]

So I feel good that attempting to load in a wrong bit DLL will correctly error out in UE4. Unfortunately, this doesn’t appear to get us any closer to determine what is wrong with the original ovraudio64.dll on my system.

Man, I hate saying this but I have no idea what’s going on for you… :frowning: We haven’t had anybody report this issue. Do you have access to another computer just to verify that it’s an issue with your computer?

Now that 4.11 is out I thought I’d try the binary version from the launcher. That should rule out any compiling errors at my end.

Unfortunately, when I activate the Oculus Audio SDK plug-in for a new, blank, Blueprint-only project, I still see the same error as before:

LogInit: XAudio2 using 'Speakers (Realtek High Definition Audio)' : 2 channels at 48 kHz using 32 bits per sample (channel mask 0x3)
LogAudio:Error: Oculus Audio SDK Error - Failed to initialize OVR Audio system: Unknown Error
LogInit: FAudioDevice initialized.

Not sure what’s going on with it as it is the same Unknown error.