question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Connection issues and how to debug them?

See original GitHub issue

Hi! 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:closed
  • Created 5 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nejducommented, May 4, 2023

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 😃

1reaction
nejducommented, Apr 17, 2023

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Approaches to debug network connectivity
The following tools and commands are available to help you debug network connectivity issues. Use the Ping Remote tool to determine whether the...
Read more >
Debugging a broken Internet connection
Debugging a broken Internet connection · 1. Try a different web browser · 2. Try websites by IP address · 3. Try to...
Read more >
5 techniques to debug network issues in Linux and Windows
Best practices for debugging network issues​​ Begin by checking for basic functionality, such as power, physical connections and ping tests. From the general ......
Read more >
Debugging 5 Common Networking Problems With Full ...
These logs indicate the inability to reach the remote service or connect to an incorrect service. It's worth checking your aggregated logging to ......
Read more >
Basic Tips for Debugging Home Internet Connections
Check to see if an Ethernet or Wifi connection is enabled. If neither is, try to enable one. If wifi is enabled and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found