1

My code is using PortMidi for several years now.
I use it for writing portable C++ code to control an external MIDI Surface Control of type Mackie.
I use PortMidi latest version: 20101008

Lately we found out that when the control is used exensively on Windows 10 we receive a deadlock. This happens only on Windows 10.

When in deadlock state the following thread is stuck:

ntdll!ZwWaitForSingleObject
KERNELBASE!WaitForSingleObjectEx
wdmaud!CMIDIOutDevice::WriteEvent
wdmaud!CMIDIOutDevice::PlaySysEx
wdmaud!HwModMessage
wdmaud!dspsL
WINMMBASE!midiMessage
WINMMBASE!midiOutLongMsg
MIDICommunication!winmm_write_flush
MIDICommunication!Pm_WriteSysEx

Using debugger I found that code is waiting for an event (not a lock).

Is anyone aware of PortMidi issues on Windows 10 and/or how to get around it?

Many thanks, Paz

PazO
  • 1,314
  • 1
  • 11
  • 30
  • Win10 is [known to be troublesome](https://stackoverflow.com/a/32553208/17034). Do make sure you did not lie about it, you will get deadlock if you pass the wrong value. – Hans Passant Oct 09 '17 at 13:52

1 Answers1

3

4 months later...
While debugging I found out that this problem exists also if you use Microsoft MIDI API directly.
Due to this I opened a Premier Support Call with Microsoft.
After long time of investigation (four months) Microsoft confirmed that this is a defect in Microsoft WinMM API implementation, which "...does not properly handle PNP removal...".

I was advised that a fix for this will be issued within RS5 timeframe.


11 months later...
As part of handling my Premier Support Call, Microsoft issued public KB article to describe this problem.

PazO
  • 1,314
  • 1
  • 11
  • 30
  • 1
  • Any further updates from Microsoft? I am seeing the same deadlock when using the Mixxx DJ software on Win10, which also uses portmidi. – jorenl Mar 05 '19 at 03:36
  • @jorenl AFAIK Microsoft did not yet fix MIDI API implementation. Microsoft rep advised me that in order to get a workaround this problem I will need to alternate to WINRT API for MIDI. Please note that WINRT API for MIDI requires you to use Visual-Studio 2017 or higher, which requires Windows-10. – PazO Mar 06 '19 at 11:36