Open dar7man opened 3 years ago
I'm not surprised that WASAPI would invalidate devices when waking from sleep (especially USB devices which probably undergo something similar to a disconnection event). I would expect DirectSound to better handle this scenario, so you might want to use that if you can.
One thing I could do in FlexASIO to work around the issue is make a reset request to the application when this kind of situation occurs. A specific solution could be to monitor for wakeup events. A more general solution could perhaps involve issuing reset requests in response to certain kinds of PortAudio errors. Such workarounds would only be useful if the host application handles ASIO reset requests in a sensible manner, though.
I tested DirectSound and indeed - after waking up everything is working fine. Unfortunately DirectSound is no go for me due to lags, so I'll stay with WASAPI for now. Thank you very much!
It's an issue in portaudio, no doubt. SuperCollider (which uses portaudio too) suffers from the same problem on some of my machines, i.e. the server stops working when waking up from suspend. (Usually it complains about a full queue it's unable to offload to the driver.)
Would this explain why my USB mic would randomly get muted when my system goes to sleep only when using FlexASIO and ASIOLink (my audio mixing tool). It was driving me nuts for a bit, especially since my mic was brand new
Do you mean your mic gets muted system-wide? That shouldn't happen, unless perhaps you were using the mic in FlexASIO with an exclusive backend (WASAPI Exclusive or WDM-KS).
System Wide. It's super possible that being Exclusive is why but I was streaming earlier and it randomly did it mid stream.
By "mid stream" did you mean it happened outside of your computer waking up from sleep? If so, can you file a separate ticket and try to get a log while the issue is happening?
Thanks. Will do. It was my first time that it happened during a stream. Usually occurred during sleep. :D
Related: PortAudio/portaudio#944
It's an issue in portaudio, no doubt.
The problem is not in PA but in Windows drivers. Issue https://github.com/PortAudio/portaudio/issues/944 can be interesting for all app developers. App must not rely on the fact that audio device will survive hibernation/power state change. Therefore app shall detect power state change and re-start the audio stream if it is not working.
Yeah. If WASAPI itself is failing then clearly there's no easy way to truly fix this problem (as in, have the stream continue), but FlexASIO could at least hook into PaWasapi_SetStreamStateHandler()
so that it can cleanly issue an ASIO reset request to the host app when this happens. The rest will be up to the app; hopefully some apps will automatically restart the stream in response.
FlexASIO could at least hook into
PaWasapi_SetStreamStateHandler()
so that it can cleanly issue an ASIO reset request to the host app when this happens
Indeed. This error is thrown when device goes away - AUDCLNT_E_DEVICE_INVALIDATED
. The same error is thrown when device is detached from PC, e.g. USB DAC.
Hello!
First I would like to thank you for this superb driver. I find shared mode very useful. Awesome job! I got only one issue to report. After I wake up my system (Windows 10) from S3 sleep with DAW being running, FlexASIO no longer works (no sound at all). After restarting audio driver in DAW (or other audio application), it works again. It's not big deal, but it's little annoying.
Here is what I found in log just after waking up system with DAW turned on:
This problem is not specific to any DAW or other audio application. I don't even now if it is possible to fix this (looks like problem with PortAudio backend).
Thanks, Konrad