Skip to content

[BUG]: App hangs when calling WinMM MIDI output APIs on a disconnected device #831

@m-komo

Description

@m-komo

Windows Version

Windows 11 25H2 build 25220.7653 (Insider Beta)

Service Installation Method

In-box In Insider Build

SDK version, if appropriate

No response

Location

Application using WinMM MIDI 1.0 (Classic API)

Type of bug

Application not working as expected

Steps to reproduce

  1. Connect any USB MIDI device.
  2. Launch PocketMIDI and select the device connected in step 1 as the Output Port.
  3. Confirm that MIDI messages can be sent successfully from PocketMIDI.
  4. Disconnect the device.
  5. Attempt to send a MIDI message from PocketMIDI.

The application becomes unresponsive (hangs).

Expected behavior

Even if the API call is made to an invalid (disconnected) MIDI port, the call should immediately return with an error code, and the application should not become unresponsive.

Additional notes

In environments where the MIDI Service is enabled, calling midiOutShortMsg or midiOutLongMsg on an invalid MIDI port results in a 5‑second timeout wait.
In previous environments (without the MIDI Service enabled), the API calls returned immediately with an error code.

Would the following fix address this issue?

#823

Metadata

Metadata

Assignees

Labels

bug 🐞Something isn't workingneeds-investigation 🔍Needs to be investigated before considering or solving.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions