Greetings,
My code works perfectly on Windows, but crashes very frequently (not always) on Android (OQ2). I am using VoiceModule like this:
FVoiceModule::Get().CreateVoiceCapture("", 44100, 1);
When this line of code is run on the OQ2 device, it sometimes crashed the application with this error:
LogPlayLevel: 09-13 14:25:20.560 23749 23793 D UE4 : Assertion failed: (!ModuleInfo->bWasUnloadedAtShutdown) [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Core/Private/Modules/ModuleManager.cpp] [Line: 416]
LogPlayLevel: 09-13 14:25:20.560 23749 23793 D UE4 : Attempted to load module ‘Voice’ that was already unloaded at shutdown. FModuleManager::LoadModule() was called to load a module that was previously loaded, and was unloaded at shutdown time. If this assert goes off, your trying to load a module during the shutdown phase that was already cleaned up. The easiest way to fix this is to change your code to query for an already-loaded module instead of trying to load it directly.
LogPlayLevel: 09-13 14:25:20.560 23749 23793 D UE4 : [2023.09.13-12.25.20:560][578]Assertion failed: (!ModuleInfo->bWasUnloadedAtShutdown) [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Core/Private/Modules/ModuleManager.cpp] [Line: 416]
LogPlayLevel: 09-13 14:25:20.560 23749 23793 D UE4 : Attempted to load module ‘Voice’ that was already unloaded at shutdown. FModuleManager::LoadModule() was called to load a module that was previously loaded, and was unloaded at shutdown time. If this assert goes off, your trying to load a module during the shutdown phase that was already cleaned up. The easiest way to fix this is to change your code to query for an already-loaded module instead of trying to load it directly.
LogPlayLevel: Error: 09-13 14:25:20.560 23749 23793 D UE4 : [2023.09.13-12.25.20:560][578]LogAndroid: Error: === Critical error: ===
LogPlayLevel: Error: 09-13 14:25:20.560 23749 23793 D UE4 : [2023.09.13-12.25.20:560][578]LogAndroid: Error:
LogPlayLevel: Error: 09-13 14:25:20.560 23749 23793 D UE4 : [2023.09.13-12.25.20:560][578]LogAndroid: Error: Assertion failed: (!ModuleInfo->bWasUnloadedAtShutdown) [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Core/Private/Modules/ModuleManager.cpp] [Line: 416]
LogPlayLevel: Error: 09-13 14:25:20.560 23749 23793 D UE4 : [2023.09.13-12.25.20:560][578]LogAndroid: Error: Attempted to load module ‘Voice’ that was already unloaded at shutdown. FModuleManager::LoadModule() was called to load a module that was previously loaded, and was unloaded at shutdown time. If this assert goes off, your trying to load a module during the shutdown phase that was already cleaned up. The easiest way to fix this is to change your code to query for an already-loaded module instead of trying to load it directly.
LogPlayLevel: Error: 09-13 14:25:20.560 23749 23793 D UE4 : [2023.09.13-12.25.20:560][578]LogAndroid: Error: [Callstack] 0x0000007298984044 libUE4.so(0x0000000007802044)!FDebug::CheckVerifyFailedImpl(char const*, char const*, int, char16_t const*, …)
LogPlayLevel: Error: 09-13 14:25:20.560 23749 23793 D UE4 : [2023.09.13-12.25.20:560][578]LogAndroid: Error: [Callstack] 0x0000007298A93254 libUE4.so(0x0000000007911254)![]()
LogPlayLevel: Error: 09-13 14:25:20.561 23749 23793 D UE4 : [2023.09.13-12.25.20:561][578]LogAndroid: Error: [Callstack] 0x0000007298A4FF30 libUE4.so(0x00000000078CDF30)!FModuleManager::LoadModuleWithFailureReason(FName, EModuleLoadResult&)
LogPlayLevel: Error: 09-13 14:25:20.561 23749 23793 D UE4 : [2023.09.13-12.25.20:561][578]LogAndroid: Error: [Callstack] 0x0000007298A509BC libUE4.so(0x00000000078CE9BC)!FModuleManager::LoadModuleChecked(FName)
When I try to check if the VoiceModule is available before calling it, via
FVoiceModule::IsAvailable()
it says that it is not available.
I am not sure where the issue might be, that the VoiceModule is not available all the time. The biggest issue is that it is very random, sometimes it works, sometimes it crashes.
Is it possible to check if the Module is not available and then try to load it again? As
FModuleManager::LoadModuleChecked(FName)
is not working (crashes) for the VoiceModule.
Thank you!