This is a continuation of this (Audio Callback Never Starts After Waking From Sleep - General JUCE discussion - JUCE) post a made a little while ago. However, I have been able to determine a lot more about the problem and was hoping a more pointed title might pique someone’s interest.
WASAPI sends a connection error message when I try to reconnect to an audio device after waking from sleep. If I have a break point or I wait a substantial amount of time or I sleep the message thread for1 - 1.5 seconds then everything connects as usual. The exact call that makes creates the error is
device->Activate on line 555 of juce_win32_WASAPI.cpp. It’s worth mentioning I am using JUCE 5 and updating isn’t an option for this project.