Quantcast
Channel: Questions in topic: "crash"
Viewing all articles
Browse latest Browse all 2383

Creating a KeywordRecognizer makes Unity crash

$
0
0
Hi ! I am currently trying to develop a project using both Speech Recognition and the Oculus Rift DK1. I developed the speech recognition part by using the [KeywordRecognizer][1] from Unity Scripting API (Note : I'm working on Windows 10). It worked well and I was able to detect words and do an action depending on the recognized word. After that, I installed the *Oculus Runtime for Windows V0.8.0.0-beta* which also required me to install an NVIDIA graphic driver with a version above 358.xx, so I installed the latest version which was 369.09. Later, when I tried launching my game which already used a KeywordRecognizer, Unity crashed. By crash I mean it did not even freeze for 1 second but I immediately had the message "Unity Editor has stopped working". I tried creating a whole new project with only one script (the one given in the Unity Documentation) : [SerializeField] private string[] m_Keywords; private KeywordRecognizer m_Recognizer; void Start() { m_Recognizer = new KeywordRecognizer(m_Keywords); m_Recognizer.OnPhraseRecognized += OnPhraseRecognized; m_Recognizer.Start(); } But it still crashes everytime I launch the game in the Editor. I tried debugging it with Visual Studio, and the problem comes from the following line : m_Recognizer = new KeywordRecognizer(m_Keywords); When Unity crashes, I can debug it and have the following error : **Unhandled exception at 0x77485E93 (ntdll.dll) in Unity.exe: 0xC0000005: Access violation writing location 0x00000040.** I am sure the problem is not coming from the string[] table since I tried several examples given by Unity Documentation or [Microsoft Developer Network][2]. [1]: https://docs.unity3d.com/ScriptReference/Windows.Speech.KeywordRecognizer.html [2]: https://developer.microsoft.com/en-us/windows/holographic/voice_input_in_unity Since it is an access violation error, I thought maybe another process is trying to access the same location in memory at the same time. I uninstalled the Oculus Runtime and driver, and I also uninstalled the NVIDIA driver. It still didn't work. I uninstalled and reinstalled Unity several times, tried launching my script in different versions of Unity (5.4.0f3 - 32 and 64 bits, and 5.4.0b15 - 32 and 64 bits), but nothing works. I compiled my project and tried launching the .exe file, and the executable also crashed. Then, I put the exact same .exe file on a Surface Pro 3 running under Windows 10, and it worked perfectly. At this point, since I had no restore points on Windows, I decided to reset my PC (but still keep my files). It still does not work ... The last thing I tried was replacing the Windows.Media.Speech.dll (in C:\Windows\System32) on my computer by the one I found on the Surface Pro, but it didn't help. I am running out of ideas and I would like to know if anyone already faced this problem or has an idea of something I could try to "repair" Unity, before I reset my PC completely. If it can be of any help, here is the Outputing Stack Trace from the logs of the Editor when it crashes : ========== OUTPUTING STACK TRACE ================== 0x77485E93 (ntdll) RtlEnterCriticalSection 0x6143B98B (Windows.Media.Speech) DllCanUnloadNow 0x614555F0 (Windows.Media.Speech) DllCanUnloadNow 0x6144711A (Windows.Media.Speech) DllCanUnloadNow 0x6143BA1A (Windows.Media.Speech) DllCanUnloadNow 0x614466E7 (Windows.Media.Speech) DllCanUnloadNow 0x6144666D (Windows.Media.Speech) DllCanUnloadNow 0x6144A292 (Windows.Media.Speech) DllCanUnloadNow 0x61429642 (Windows.Media.Speech) DllCanUnloadNow 0x61448B61 (Windows.Media.Speech) DllCanUnloadNow 0x75ACE63C (combase) DllGetClassObject 0x75A8C934 (combase) SetErrorInfo 0x75A8CC88 (combase) RoActivateInstance 0x75A8CBDA (combase) RoActivateInstance 0x00925543 (Unity) Unity::PhraseRecognitionSystem::IsSupported 0x0092BC12 (Unity) Unity::PhraseRecognizer::Create 0x0092DD60 (Unity) Unity::PhraseRecognizer::Create 0x010A7DEB (Unity) PhraseRecognizer_CUSTOM_INTERNAL_CALL_CreateFromKeywords 0x14208B1F (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Windows.Speech.PhraseRecognizer:INTERNAL_CALL_CreateFromKeywords (UnityEngine.Windows.Speech.PhraseRecognizer,string[],UnityEngine.Windows.Speech.ConfidenceLevel,intptr&) 0x14208AA2 (Mono JIT Code) [C:\buildslave\unity\build\artifacts\generated\common\runtime\SpeechBindings.gen.cs:47] UnityEngine.Windows.Speech.PhraseRecognizer:CreateFromKeywords (string[],UnityEngine.Windows.Speech.ConfidenceLevel) 0x142089BC (Mono JIT Code) [C:\buildslave\unity\build\Runtime\Export\Windows\Speech.cs:214] UnityEngine.Windows.Speech.KeywordRecognizer:.ctor (string[],UnityEngine.Windows.Speech.ConfidenceLevel) 0x1420885E (Mono JIT Code) UnityEngine.Windows.Speech.KeywordRecognizer:.ctor (string[]) 0x14208755 (Mono JIT Code) [C:\Users\Admin\Documents\Alex\Workspace Unity 32 bits\SpeechAgain\Assets\KeywordScript.cs:15] KeywordScript:Start () 0x0364B857 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr) 0x0C561592 (mono) [c:\buildslave\mono\build\mono\mini\mini.c:4936] mono_jit_runtime_invoke 0x0C4CD984 (mono) [c:\buildslave\mono\build\mono\metadata\object.c:2623] mono_runtime_invoke 0x007003BF (Unity) scripting_method_invoke 0x00832BCA (Unity) ScriptingInvocation::Invoke 0x006E9199 (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked 0x006E927C (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked 0x006E9A12 (Unity) MonoBehaviour::Start 0x006E9ECB (Unity) MonoBehaviour::DelayedStartCall 0x00514097 (Unity) DelayedCallManager::Update 0x007DE298 (Unity) PlayerLoop 0x00E41462 (Unity) Application::UpdateScene 0x00E4183E (Unity) Application::EnterPlayMode 0x00E48B85 (Unity) Application::SetIsPlaying 0x00E4961E (Unity) Application::TickTimer 0x01063296 (Unity) FindMonoBinaryToUse 0x010648E3 (Unity) WinMain 0x01737EDF (Unity) strnlen 0x75943744 (KERNEL32) BaseThreadInitThunk 0x7749A064 (ntdll) RtlSetCurrentTransaction ========== END OF STACKTRACE =========== EDIT : I tried using a DictationRecognizer instead of a KeywordRecognizer, and the problem is still the same.

Viewing all articles
Browse latest Browse all 2383

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>