Closed cdwfs closed 5 years ago
Ah, I just found the troubleshooting entry regarding problems with KORG controllers. I'll try uninstalling the KORG driver as recommended and post my results.
Sure enough, after switching back to the default USB Audio Device driver, midiInOpen()
now fails when attempting to re-open a device that's already opened. I'll happily blame the KORG driver for this one.
I'm closing the issue now. Please feel free to reopen for further issues.
Hello -- I'm trying to use MidiJack with a nanoKONTROL2 on Windows 10, and when I open the MidiJack window I see an endless spew of duplicate devices appearing over time (each with a unique DeviceHandle). I'm using the MidiJackPlugin.dll in a C++ test project to debug the issue, and I can reproduce the problem there as well, so I don't think Unity is involved.
Tracing into the DLL code: every time I call
MidiJackDequeueIncomingData()
, it callsRefreshDevices()
, which in turn callsOpenAllDevices()
. This function correctly detects 1 connected device, and callsOpenDevice(0)
. This is where the problem seems to occur --OpenDevice
callsmidiInOpen()
withindex=0
, which gets a newDeviceHandle
and returnsMMSYSERR_NOERROR
, even though the device at index 0 is already open. This handle is immediately passed tomidiInStart()
, which also returnsMMSYSERR_NOERROR
. The plugin now believes it's detected and started a brand new device, so it adds it toactive_handles
array. This array just continues to grow, filling up with new handles all referring to the same device.I'm not sure what the actual error is; is either
midiInOpen()
ormidiInStart()
supposed to return an error code if the specified device has already been opened/started, or is the application's responsibility to query all handles after opening them and filtering out/closing those that have already been opened & started? If the latter, then MidiJack just seems to be broken as written -- yet I see plenty of successful reports of it working on Windows, so that seems unlikely. Could it instead be a driver issue on KORG's side? I'm using the latest WIn10 driver I can find (1.15 r25e).Any help would be appreciated; thanks!