From ea9690d72b1c51371b488bd93655d9023991272b Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Mon, 6 May 2019 10:46:54 -0700 Subject: [PATCH] Disable MIDI rescan after devicechange, to avoid deadlock --- interface/src/Application.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 59f4934dca..6b956e7f55 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -557,7 +557,10 @@ public: return true; } } - + // Attempting to close MIDI interfaces of a hot-unplugged device can result in audio-driver deadlock. + // Detecting MIDI devices that have been added/removed after starting Inteface has been disabled. + // https://support.microsoft.com/en-us/help/4460006/midi-device-app-hangs-when-former-midi-api-is-used +#if 0 if (message->message == WM_DEVICECHANGE) { const float MIN_DELTA_SECONDS = 2.0f; // de-bounce signal static float lastTriggerTime = 0.0f; @@ -567,6 +570,7 @@ public: Midi::USBchanged(); // re-scan the MIDI bus } } +#endif } return false; }