-
Notifications
You must be signed in to change notification settings - Fork 77
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
Pro Tools WASAPI AUDCLNT_E_DEVICE_IN_USE error #84
Comments
Well that log is… interesting. It paints the following story: At 03:54:28.341, FlexASIO is initialized, and is able to open an output stream just fine:
So far so good. At 03:54:28.539, for some reason, Pro Tools decides to close FlexASIO and reinitializes it about 1 second later:
Okay, why not. But then, from that point on, FlexASIO is unable to open the output anymore, failing with a
That's… strange. Off the top of my head I can see a couple of hypotheses:
The reason why I suspect it might be (2) is because I have a suspicion that this "unload, then load again" behaviour is caused by Pro Tools enumerating ASIO drivers on the system and loading them one after the other. The thing is, with some ASIO drivers, just the act of initializing them is enough to cause side effects that change the state of the hardware device. So, one hypothesis is that Pro Tools loaded a different ASIO driver between 03:54:28.539 and 03:54:29.593, and that ASIO driver messed up the state of the device, preventing FlexASIO from opening it again. @Kurausukun Do you have other ASIO drivers installed? If so, can you try uninstalling them and see what happens? (You can also temporarily disable a driver by deleting its registry key under Another hypothesis consistent with (2) is that Pro Tools itself is opening the device in exclusive mode, preventing FlexASIO from opening it. I'm not familiar with Pro Tools so I'm not sure if that could be the case. |
I do have two other ASIO drivers installed. I exported their keys for later and deleted them from my registry. Now when I open Pro Tools and select it, it doesn't give me that error, but Pro Tools itself crashes. I have a log of this as well. I also got a log from Pro Tools itself from when it crashed, but you said you aren't familiar with it, so I haven't uploaded it--if you want to try and parse it anyway, let me know and I can upload it. |
Thanks for the log. It looks like Pro Tools chokes on the first stream callback and never returns controls to FlexASIO:
I don't think I've seen this before. Does that happen with the default configuration (i.e. no config file) too? If not, can you try to determine which one of the configuration options you're using is causing the crash? (I would start with the FlexASIO managed to log the closing of the logfile, which is eyebrow-raising because that means static destructors had a chance to run, which in turn means the DLL was cleanly unloaded. These things normally don't happen in the case of a hard crash. This might mean that Pro Tools is crashing in some kind of "graceful" way. Feel free to upload a Pro Tools log. I'm not familiar with Pro Tools so I don't know if I'll be able to make sense of it, but I can give it a try. If you can provide both a FlexASIO log and a Pro Tools log that refer to the same crash, so that I can correlate timestamps between the two, that's even better. |
Oh and by the way, regarding the original issue:
This part looks suspiciously similar to #86, where other ASIO drivers (ASIO4ALL in the case of #86) mess up the initialization sequence of FlexASIO. Out of curiosity, would you mind naming the other two drivers you had installed? |
Yes--my other drivers are ASIO4ALL, which is the only thing that worked with it before, and another one called Realtek ASIO Driver that I'm pretty sure just came with my audio drivers--I've never gotten it to work before. I tried running FlexASIO with no settings file and it actually worked--mostly. The audio was very clicky, which I am 99% sure is because whatever the default buffer is set to was too small. Also, the reason I set my audio as Int24 was because that's the setting I have my soundcard set to--24-bit 48kHz. But if it's causing crashes, I guess I don't have a choice. I also was hoping to be able to use WASAPI instead of DirectSound, but I just tried to use it by making a settings file doing nothing but setting the backend to "Windows WASAPI" and setting exclusive mode to false, but while it does not crash the program, no audio can be heard. That is probably unrelated though, so I think there's no need to look into it immediately. But at least for the original issue, it does appear that ASIO4ALL was causing the problem with the "hardware in use" issue, and if I can get this to work, I'd be fine to uninstall that completely anyway since this will give me a lot more options. |
When operating in WASAPI shared mode (or any other shared backend), it doesn't make sense to change this setting from its default (32-bit float). That's because the audio gets processed by the Windows Audio Engine anyway which operates in 32-bit float. If you use a different Anyway, filed separate issue #87 regarding the custom sample type crashing Pro Tools.
This resembles symptoms seen in #83. Feel free to provide a log if you'd like me to take a look. |
Thanks for educating me regarding that, I obviously did not know the many layers the audio goes through before it is presented. Anyway, I managed to get slightly better results as a result of switching my buffer size from 2048 to 256 in WASAPI shared, but it's still not perfect--while it doesn't sound choppy like DirectSound did, it cuts out for extended periods of time (think half a second-ish) randomly. Perhaps this can be resolved with other buffer settings, but I captured the log either way. Fair warning, it's large. Edit: I was right, using a buffer of 512 seems to work perfectly so far. |
I am not able to reproduce the issue you're describing with a 256-sample buffer size. With FlexASIO 1.6 the following configuration seems to work fine in Pro Tools First 2019.6.0: backend = "Windows WASAPI"
bufferSizeSamples = 256 Keep in mind that when using such small buffer sizes it is very important to disable logging (by deleting or renaming the logfile) during testing, as the logging itself slows down FlexASIO and can make it miss its deadlines. You can also take a look at the FAQ entry for other possible causes of glitches. (By the way, I noticed a new issue where Pro Tools misbehaves when Closing as it's not clear to me there's anything left to do here, aside from the issues already tracked in #87 and #89. |
I have a very similar problem to #69 where Pro Tools First will tell me "Pro Tools is unable to reacquire the hardware because it is in use by another application. Please quit other applications and hit "OK" to retry." I read through the previous issue and attempted to change my settings file so that I could avoid the issue, but even after changing the settings, I get the same error. I was hoping you could see whether this issue is something that Pro Tools is doing wrong that they would need to fix on their end, or if I can change my settings in a different way to work around the issue.
I was able to get a log file, which includes my settings, so I made a gist here.
Thank you for any help.
The text was updated successfully, but these errors were encountered: