Trying to modify/create our own implementation of AudioDeviceSelectorComponent we stumpled across an error. Our app started crashing with the “read acces violation” in the juce_win32_WASAPI.cpp.
We tested the DemoRunner for 5.4.5 and 5.4.7 and it is easy to reproduce the error. It might be a bug in the WASAPI code, related to thread safety.
How to reproduce in DemoRunner:
- Navigate to AudioSettingsDemo.h or the gear knob/settings where the AudioDeviceSelectorComponent is present.
- Set audio device type to Windows Audio.
- Set output: Speakers/Headphones(Realtek® Audio)
- Set input: Microphone (Realtek® Audio)
- Enable/Disable Active input channels a few times and the error occurs.
On my Win10 PC the error occurs first time I disable the input, but on my colleagues Win10 PC we have to enable/disable few times before the error occurs.
When breaking and hovering the outputDevice in line 1295, Visual Studio tells us that the outputDevice is empty. We guess that means it is a nullptr?
DemoRunner.exe!juce::WasapiClasses::WASAPIAudioIODevice::run() Line 1297 C++ DemoRunner.exe!juce::Thread::threadEntryPoint() Line 96 C++ DemoRunner.exe!juce::juce_threadEntryPoint(void * userData) Line 119 C++ DemoRunner.exe!juce::threadEntryProc(void * userData) Line 62 C++
Hope you can help os identify/solve the problem.