Hi, the docs at https://www.fmod.com/resources/documentation-api?version=2.0&page=white-papers-threads.html say “To ensure correct behavior FMOD assumes when using the WASAPI output mode (default for Windows Vita and newer) that you call output related functions from your UI thread.”
What counts as “output related functions”?
Is FMOD::System::update() "output related "?
We should clarify exactly what functions this is referring to as it is only a small number.
In this case it is APIs that directly interact with the output plugin: System::getNumDrivers, System::getDriverInfo and System::init.
We’re seeing a potential problem with OutputWASAPI::recordGetDriverInfo() getting called indirectly through System::update() -> SystemI::updateRecordCache(), bypassing the COM auto-initialization. Which is sort of our fault for not initializing COM ourselves on the update() thread, but then again it was not totally clear that we were supposed to. This makes me worried that we may have other areas where COM is being used through indirect calls without being initialized.
When that system was written, it assumed you call System::update on the same thread as System::init. If you are solely using the Core API and doing that, then the update thread needs to be initialized for COM too. We initialize all FMOD threads, so it not an issue if Core update is called as part of Studio update.