microsoft / MixedReality-WebRTC

MixedReality-WebRTC is a collection of components to help mixed reality app developers integrate audio and video real-time communication into their application and improve their collaborative experience
https://microsoft.github.io/MixedReality-WebRTC/
MIT License
898 stars 277 forks source link

CreateFromArgb32Callback Crashes when 5.1 Sound is Enabled #836

Closed BobbyShoe closed 2 years ago

BobbyShoe commented 2 years ago

This really does not make sense, but a call to ExternalVideoTrackSource.CreateFromArgb32Callback crashes when the audio output on the system is set to 5.1 (surround sound). Our application crashes, and there are logs in the Windows Event Viewer indicating that the faulting module is mrwebrtc.DLL

Exception Code: 0xc0000409

It appears to happen every time. To recreate the issue have your windows sound configured to output 5.1 surround sound and call ExternalVideoTrackSource.CreateFromArgb32Callback.

I am not sure why the system audio settings would have anything to do with the video capture. For this particular instance we do not even need the audio being captured, so if there is anything we can disable on the audio side that would be fine for now.

This is occurring on Windows 10 using C# in a WPF .Net 5.0 x64 application. It occurs in debug in release mode if that matters.

Any suggestions would be appreciated.

Thanks, Bobby

BobbyShoe commented 2 years ago

Answering my own question here, but I found another bug that was fixed in the master branch here that resolved my issue https://github.com/microsoft/MixedReality-WebRTC/pull/507/files

I had to pull this into the release/2.0 branch and do a custom build to fix this issue.

Thanks to @djee-ms for fixing the original issue. Since this causes the library to fatally crash and become unusable on some systems, seems like it would be nice to pull back into the release/2.0 branch in a patch release.