If I create a basic setup of either MIDIInput or AudioDeviceManager, I can receive MIDI callbacks.
However, once I send my computer to sleep manually (using the Apple menu→sleep), I stop receiving the callbacks. Recreating the class instance fixes it.
A simplified example you can try in any JUCE GUI app:
juce::String getMidiDeviceByName(const juce::String& name)
{
auto inputs = juce::MidiInput::getAvailableDevices();
for (auto& input: inputs)
{
if (input.name.containsIgnoreCase(name))
return input.identifier;
}
jassertfalse;
return inputs[0].identifier;
}
struct MIDITestApp : juce::MidiInputCallback
{
MIDITestApp()
{
auto device = getMidiDeviceByName("Hammer 88");
dm.setMidiInputDeviceEnabled(device, true);
dm.addMidiInputDeviceCallback(device, this);
}
void handleIncomingMidiMessage(juce::MidiInput*,
const juce::MidiMessage&) override
{ DBG("MIDI Callback"); }
juce::AudioDeviceManager dm;
};
This was only tested with MacOS 26.2.
Is there any way to resolve this?
I’d also be happy with a solution that notifies me on wakeup/sleep so I can fix it locally in my project.
