-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure button creates a second instance of ASIO driver in violation of ASIO spec #133
Comments
As I don't know that much about ASIO, is ASIO entirely single thread only across the ASIO API ? |
That's a good question. The ASIO SDK is completely silent on the subject of thread safety (the only exception is that Given this, it would make sense to apply the robustness principle and for drivers to ensure their entry points are thread safe. At the same time, hosts should not assume drivers are thread safe. In practice, FlexASIO doesn't really follow this principle (i.e. it's not thread safe). So far it has gotten away with it and I have not come across an ASIO host that would make concurrent calls to the driver. I hope no hosts do this, as that's really asking for trouble. Nonetheless, I filed dechamps/FlexASIO#185 to document this limitation. Another interesting question is whether |
Hi, FlexASIO dev here.
In dechamps/FlexASIO#183 I observed that, if the "Configure" button in the SAR control panel is clicked while the ASIO driver is running, SAR will instantiate a second instance of the backend ASIO driver in the same process.
This is arguably a violation of the ASIO spec, given that the ASIO SDK really only supports a single global singleton instance of the ASIO driver running in the entire process, and ASIO drivers would therefore be justified in assuming that they will not be instantiated more than once in the same process at any given time.
Currently FlexASIO does make that assumption, and crashes as soon as SAR attempts to create the second instance. I'm going to make FlexASIO more resilient to this usage pattern, but I would recommend that SAR refrains from using ASIO drivers in ways that might not be compliant with the ASIO SDK, as that might cause problems with other backend drivers as well. (Especially since, in this particular case, this seems like an easy fix - if you already have an ASIO driver instance, then call
controlPanel()
on that instance instead of creating a new one.)The text was updated successfully, but these errors were encountered: