MuseScore icon indicating copy to clipboard operation
MuseScore copied to clipboard

WASAPI Driver: don't crash (or rather hang) when starting client fails

Open cbjeukendrup opened this issue 3 years ago • 1 comments

We were waiting infinitely for the WASAPI_Client_Started event, but when there was an error while starting the client, that event would never be signaled. So MuseScore would be stuck infinitely on launch.

So, in the cases where MS would hang before this PR, playback won't work, but at least MuseScore will launch.

This is maybe helpful in some of the cases of "crash on launch".

cbjeukendrup avatar Dec 28 '22 22:12 cbjeukendrup

I asked quite a lot of people on the MuseScore.org forums to test this, and so far the results seem exactly what I expected: MuseScore does at least launch now, only playback doesn't work.

In fact, I sent them a test build with some extra logging and it turns out that (not very surprisingly) the problem comes from m_audioClient->InitializeSharedAudioStream, which throws the AUDCLNT_E_UNSUPPORTED_FORMAT error.

cbjeukendrup avatar Dec 29 '22 12:12 cbjeukendrup

looks fine to me

vpereverzev avatar Jan 10 '23 10:01 vpereverzev

@DmitryArefiev test this one pls

vpereverzev avatar Jan 10 '23 10:01 vpereverzev

@vpereverzev @cbjeukendrup Works fine on my Windows10

DmitryArefiev avatar Jan 10 '23 15:01 DmitryArefiev