opentok / opentok-windows-sdk-samples

Sample applications illustrating best practices using OpenTok Windows SDK
MIT License
9 stars 29 forks source link

BasicVideoChat example fails with fatal error on Windows 10 #26

Closed derekcroprecords closed 4 years ago

derekcroprecords commented 4 years ago

Running the BasicVideoChat example (just added API_KEY, SESSION_ID, TOKEN) fails on Windows 10 with the following error.

#
# Fatal error in: ../../src/media/engine/webrtcvoiceengine.cc, line 253
# last system error: 0
# Check failed: adm()
The program '[32132] BasicVideoChat.exe' has exited with code -1073740791 (0xc0000409).
slorello89 commented 4 years ago

Hi @derekcroprecords - I think you may have to set the API_KEY, SESSION_ID, and TOKEN first before launching the app

derekcroprecords commented 4 years ago

Hi @slorello89 - I am setting up the API_KEY, SESSION_ID, and TOKEN properly. The code is failing before those are ever used. The code fails in MainWindow.Xaml.cs at Publisher = new Publisher(Context.Instance, renderer: PublisherVideo);

msach22 commented 4 years ago

@derekcroprecords This could be an issue if you haven't specified microphone permissions in the privacy settings of the device.

We've added a fix where an exception will be thrown instead of a crash. It will be released with 2.16.5 (hopefully today)

derekcroprecords commented 4 years ago

@msach22
Under windows settings --> Camera "Allow desktop apps to access your camera" is on. And windows settings --> Microphone "Allow desktop apps to access your microphone" is on.

I'm not sure where else I can give the microphone permissions to a desktop application

Here are some more details from the debug output

` [DEBUG] c:\jenkins\workspace\task-build-otkit-ng-windows\src\otkit\src\webrtc\otk_peer_connection.cpp:135 - RTC LOG: [000:567] [38984] (audio_device_core_win.cc:2018): AudioDeviceBuffer must be attached before streaming can start

[DEBUG] c:\jenkins\workspace\task-build-otkit-ng-windows\src\otkit\src\webrtc\otk_peer_connection.cpp:135 - RTC LOG: [000:567] [38984] (audio_device_core_win.cc:2027): IAudioClient::GetBufferSize() => 1056 (<=> 4224 bytes)

[DEBUG] c:\jenkins\workspace\task-build-otkit-ng-windows\src\otkit\src\webrtc\otk_peer_connection.cpp:135 - RTC LOG: [000:567] [38984] (audio_device_core_win.cc:2049): render side is now initialized

[DEBUG] c:\jenkins\workspace\task-build-otkit-ng-windows\src\otkit\src\webrtc\otk_peer_connection.cpp:135 - RTC LOG: [000:567] [38984] (audio_device_core_win.cc:2563): no rendering stream is active => close down WASAPI only

[DEBUG] c:\jenkins\workspace\task-build-otkit-ng-windows\src\otkit\src\webrtc\otk_peer_connection.cpp:135 - RTC LOG: [000:567] [38984] (audio_device_core_win.cc:3548): _RefreshDeviceList

[DEBUG] c:\jenkins\workspace\task-build-otkit-ng-windows\src\otkit\src\webrtc\otk_peer_connection.cpp:135 - RTC LOG: [000:569] [38984] (audio_device_core_win.cc:3584): _DeviceListCount

[DEBUG] c:\jenkins\workspace\task-build-otkit-ng-windows\src\otkit\src\webrtc\otk_peer_connection.cpp:135 - RTC LOG: [000:573] [38984] (audio_device_core_win.cc:350): AudioDeviceWindowsCore::CoreAudioIsSupported() Failed to use Core Audio Playout for device id=4

[DEBUG] c:\jenkins\workspace\task-build-otkit-ng-windows\src\otkit\src\webrtc\otk_peer_connection.cpp:135 - RTC LOG: [000:574] [38984] (audio_device_core_win.cc:533): ~AudioDeviceWindowsCore destroyed

[DEBUG] c:\jenkins\workspace\task-build-otkit-ng-windows\src\otkit\src\webrtc\otk_peer_connection.cpp:135 - RTC LOG: [000:574] [38984] (audio_device_core_win.cc:580): AudioDeviceWindowsCore::~AudioDeviceWindowsCore() the Avrt DLL module is now unloaded

[DEBUG] c:\jenkins\workspace\task-build-otkit-ng-windows\src\otkit\src\webrtc\otk_peer_connection.cpp:135 - RTC LOG: [000:574] [38984] (audio_device_core_win.cc:368): Windows Core Audio is NOT supported => will revert to the Wave API

[DEBUG] c:\jenkins\workspace\task-build-otkit-ng-windows\src\otkit\src\webrtc\otk_peer_connection.cpp:135 - RTC LOG: [000:574] [38984] (audio_device_impl.cc:304): Failed to create the platform specific ADM implementation.

[DEBUG] c:\jenkins\workspace\task-build-otkit-ng-windows\src\otkit\src\webrtc\otk_peer_connection.cpp:135 - RTC LOG: [000:574] [38984] (audio_device_impl.cc:318): ~AudioDeviceModuleImpl

[DEBUG] c:\jenkins\workspace\task-build-otkit-ng-windows\src\otkit\src\webrtc\otk_peer_connection.cpp:135 - RTC LOG: [000:574] [38984] (audio_device_buffer.cc:76): AudioDeviceBuffer::~dtor`

msach22 commented 4 years ago

@derekcroprecords Hmm, thanks for sharing. We just released Windows 2.16.5 which has a fix when the audio device cannot be loaded by webrtc that throws an exception (similar to what you're seeing), but with an additional internal improvement. Could you please check that out?

michaeljolley commented 4 years ago

I pulled this repo and ran the BasicVideoChat on a clean install of Windows 10. It seems to have been resolved by the latest releases of the Windows SDK.

@derekcroprecords if you continue to have an issue, please reopen this ticket.