[Bug] CaptureDeviceCallback ipguid was nullptr

After integrating the 4.11.1 hotfix into our build, editor will crash on load.
Exception is caused in the CaptureDeviceCallback() in \Engine\Source\Runtime\Online\Voice\Private\Windows\VoiceModuleWindows.cpp.

	// Allow HMD to override the voice capture device
	if (VCPtr->VoiceCaptureDeviceCount == VCPtr->HmdVoiceCaptureDeviceIndex)
	{
		UE_LOG(LogVoice, Display, TEXT("VoiceCapture device overridden by HMD to use '%s' %s"), lpcstrDescription, *PrintMSGUID(lpGuid));
		VCPtr->VoiceCaptureDeviceGuid = *lpGuid;
	}

IpGuid is null.

I am running an Oculus Rift DK2, there is no mic, so there can be no voice capture device.

Checking the declaration of HmdVoiceCaptureDeviceIndex, it mentions that this should be -1 if unused.

However, HmdVoiceCaptureDeviceIndex is not set to -1 anywhere that I can see.

Updating the FVoiceCaptureDeviceWindows constructor fixes this:

FVoiceCaptureDeviceWindows::FVoiceCaptureDeviceWindows() :
	bInitialized(false),
	DirectSound(NULL)
{
	// Declaration mentions this should be -1 if unused.
	// Assuming if it gets init'd properly, it will be set to non-zero.
	// At the moment, a HMD will override the voice capture device even if it doesn't have a mic (such as the Oculus DK2).
	HmdVoiceCaptureDeviceIndex = -1;
}

Known issue or should I be making a pull request?

Thanks.

Kris

Hello Kris,

If you have a viable fix for this issue, feel free to enter a pull request. It sounds like what you have has resolved the issue, so go ahead and enter one as soon as you have the chance.

Thank you for your report.

Appears to work fine.
Hope I’ve done this correctly:
https://github.com/EpicGames/UnrealEngine/pull/2265

Thank you.

Hello,

I am having same problem too but I use microphone voice input and I have used it before with version 4.10 without any problems. Does your fix work even when you are using microphone? I am asking because I don’t have engine downloaded from Github and I can’t edit it to try if it’s working.

Thanks in advance.