View Issue Details

IDProjectCategoryView StatusLast Update
0001599OpenMPTPlugins / VSTpublic2022-05-28 05:21
Reporterdelete12345 Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx64OSWindowsOS Version10
Product VersionOpenMPT 1.30.04.00 / libopenmpt 0.6.3 (upgrade first) 
Summary0001599: Audio output is still open but unusable after standby
Description

I am using Windows 10 with MIDI-OX in order for my MIDI piano (Roland FP-1) to send MIDI signals to OpenMPT.

When I lock my PC, there is a short period of time where the instrument plugins loaded in OpenMPT can still receive MIDI inputs from my piano. After 15 seconds, the PC would set itself into standby mode, and the monitors would say it can't receive any display signals, and the instrument plugins no longer can receive the inputs.

After unlocking the PC and logging in, the Roland FP-1 piano can still send MIDI input signals to MIDI-OX, and the MIDI-OX can display the MIDI inputs onto the console log. OpenMPT also can receive MIDI inputs normally in the Pattern tab.

However, the Instrument Plugins in OpenMPT wouldn't be able to receive those inputs. Switching MIDI recording instruments doesn't help. Even removing the plugin and reselecting a different instrument plugin doesn't help. I would have to restart OpenMPT with a new session, in order for any instrument plugins to work as intended and normally thereafter.

Steps To Reproduce

Preliminary steps:

  1. Have Windows 10.
  2. Have MIDI-OX installed.
  3. Have a MIDI keyboard plugged into Windows 10.
  4. Have configured and wired MIDI-OX to reroute the MIDI inputs to a channel that OpenMPT can pick up on as the MIDI input device.
  5. Run OpenMPT.
  6. Create a new module.
  7. Confirm OpenMPT can receive MIDI signals from MIDI keyboard.
  8. Load an instrument plugin in OpenMPT in the currently opened module.
  9. Verify the instrument plugin can play back sounds with the MIDI keyboard in use.
  10. You are now ready.

The actual reproduction steps:

  1. Lock the Windows 10 session by pressing WinKey + L.
  2. Wait until Windows turns off the monitors (as in, it sets itself into standby mode.) Do not touch the mouse or keyboard keys.
  3. When the monitors are no longer receiving display output signals, move the mouse to wake Windows 10 up.
  4. Login.
  5. Verify when pressing a key on the MIDI keyboard or input device, you no longer can hear any sounds.
  6. Verify MIDI-OX and the OpenMPT Pattern Editor can still receive your MIDI inputs.
  7. Observe how the instrument plugins that are loaded in OpenMPT can no longer receive any MIDI inputs. You have to restart OpenMPT and reload the instrument plugins back into the module.
Additional Information

The first time I started using OpenMPT with a MIDI keyboard is when OpenMPT 1.30.01.00 was released. Since then, this issue has persisted up to the current stable release, OpenMPT 1.30.04.00 released.

TagsNo tags attached.
Has the bug occurred in previous versions?Yes
Tested code revision (in case you know it)

Activities

Saga Musix

Saga Musix

2022-05-20 17:40

administrator   ~0005184

OpenMPT also can receive MIDI inputs normally in the Pattern tab. However, the Instrument Plugins in OpenMPT wouldn't be able to receive those inputs

Can you please confirm that you tried that within the same OpenMPT run? Pattern MIDI recording and instrument editor or plugin editor MIDI recording all take the same code path, so it seems very unlikely that only one of these methods stop working.

The Windows MIDI API is very old, it is from a time when there was no such thing as USB MIDI interfaces - a MIDI interface always existed from bootup until shutdown. Losing USB MIDI devices due to standby is not a thing this API can deal with, so there's no way for an application like OpenMPT to be notified that its MIDI recording handle is no longer valid. If MIDI stops working completely, it would most likely be because the MIDI interface is lost during standby. In that case, clicking the MIDI record button in the OpenMPT toolbar twice should make it work again.

Saga Musix

Saga Musix

2022-05-21 14:44

administrator   ~0005187

For what it's worth, with my USB MIDI interface, I can see that any MIDI connection stops working after waking up from stand-by (not just in OpenMPT) until I plug the MIDI interface out and in again - which is either a Windows 10 bug or a driver bug.

delete12345

delete12345

2022-05-21 17:57

reporter   ~0005188

Can you please confirm that you tried that within the same OpenMPT run? Pattern MIDI recording and instrument editor or plugin editor MIDI recording all take the same code path, so it seems very unlikely that only one of these methods stop working.

I have made a (very crude) recording a footage of me in real-time pressing my MIDI keyboard and then entering standby mode, and relogging back in to a silent OpenMPT. At the moment, the video is currently being processed.

https://youtu.be/TSb8PhBtFRU

Losing USB MIDI devices due to standby is not a thing this API can deal with, so there's no way for an application like OpenMPT to be notified that its MIDI recording handle is no longer valid. If MIDI stops working completely, it would most likely be because the MIDI interface is lost during standby. In that case, clicking the MIDI record button in the OpenMPT toolbar twice should make it work again.

I also tried out this suggestion in the video. It doesn't seem to be the case.

For what it's worth, with my USB MIDI interface, I can see that any MIDI connection stops working after waking up from stand-by (not just in OpenMPT) until I plug the MIDI interface out and in again - which is either a Windows 10 bug or a driver bug.

I am just curious. Do others see similar issues with this, even outside of OpenMPT?

Saga Musix

Saga Musix

2022-05-21 18:22

administrator   ~0005189

Okay, so with that video it looks more like an audio driver issue than a MIDI issue (I thought you initially meant that notes triggered from the pattern editor would still be heard but directly triggered from a VST editor would not be audible). Does audio start working again after pressing the stop button in OpenMPT?

delete12345

delete12345

2022-05-23 00:24

reporter   ~0005190

Does audio start working again after pressing the stop button in OpenMPT?

IT ACTUALLY WORKED! Pressing the "Stop" button and then pressing a key on the MIDI keyboard worked when I was in that standby quiet state. I'm actually surprised by this, because I've been working around this issue for a bit of a while.

Saga Musix

Saga Musix

2022-05-23 07:57

administrator   ~0005191

Okay, that confirms that the issue has nothing at all to do with MIDI, but rather with the audio device. The audio device stays open and OpenMPT is not notified that it's in fact closed and no longer usable. Maybe there's a way for us to detect that.

Until then, my suggestion would be to disable going to stand-by when merely locking the laptop, or at least only put it in standby after a longer period of time than just a few seconds. After all if you want the laptop to go into standby immediately, there is still a separate option for that.

delete12345

delete12345

2022-05-23 14:10

reporter   ~0005192

Will do. Thanks for allowing me to save a small bit of time and not having to go through the whole process of restarting OpenMPT.

Issue History

Date Modified Username Field Change
2022-05-20 01:20 delete12345 New Issue
2022-05-20 17:40 Saga Musix Note Added: 0005184
2022-05-21 14:44 Saga Musix Note Added: 0005187
2022-05-21 17:57 delete12345 Note Added: 0005188
2022-05-21 18:22 Saga Musix Note Added: 0005189
2022-05-23 00:24 delete12345 Note Added: 0005190
2022-05-23 07:24 Saga Musix Summary After locking Windows 10 and relogin, instrument plugins no longer receive MIDI inputs until OpenMPT is restarted => Audio output is still open but unusable after standby
2022-05-23 07:57 Saga Musix Note Added: 0005191
2022-05-23 14:10 delete12345 Note Added: 0005192