Connection issues and how to debug them?
See original GitHub issueHi! Thank you so much for the time you have spent on this library!
I have a problem with a MIDI controller in Windows, and I’m struggling to create a reliable test case or useful log files.
What happens is I have DryWet connect to it, and everything works fine - sometimes for several days - and then after being connected for a long time it just stops working. If I then try to disconnect and connect again I get a “Device is already in use (IN_OPENRESULT_ALLOCATED)” error, so the connection is there, it just doesn’t register any input or can be properly disconnected anymore.
With nothing else to go on I’m thinking it could be a flaky USB connection, but the controller is working fine with other pieces of software so the problem is restricted to DryWet. It also only seem to happen when I’m away from it for some time, so possibly maybe it could be something in Windows that goes into sleep mode, or something being memory recycled in some way. But it’s all random which makes it so hard to pin point.
The code I’m using to connect is about as straight forward as can be.
// get all devices
using Melanchall.DryWetMidi.Multimedia;
...
var devices = InputDevice.GetAll().Select(device => device.Name);
// connect to the device I want
var input = InputDevice.GetByName(name);
// start listening to input
input.EventReceived += InputDeviceReceivedMidiEvent;
input.StartEventsListening();
so nothing fancy there. And it does work fine like this, just not if I leave it connected for a an extended period of time, except not always. Grrr.
Question: is there any way to turn on more low level debug output to see what’s going on here?
Issue Analytics
- State:
- Created 5 months ago
- Comments:5 (2 by maintainers)
Sorry for the delay, I’ve had a lot on my plate lately. I will reach some conclusion on this when I return home, I promise I’ll let you know so please don’t close it 😃
Thanks! I like the idea of talking to a virtual device, I’ll see what I can do. I can definitely agree that the Windows MIDI stack is… lacking. But, the controller does work fine with everything else on the same computer, it’s only with the DryWet implementation I’m experiencing this problem. I’ll do some more debugging on my end and see if I can find something more to go on!