Hi,
as outlined here: USB Midi doesn't reconnect on Linux / Pipewire · Issue #19 · bitfocus/companion-module-generic-midi · GitHub
The current version of the generic MIDI plugin does not reconnect to MIDI devices when the connection gets lost. It completely relies on the RTMidi stack to keep the logical MIDI device online. If the logical MIDI device closes the connection is only re-established when the “Save” button in the “Connections” tab of Companion is pressed or Companion is restarted, as that is the only times that the actual MIDI port is opened in software (in the constructor of the MIDI plugin class).
This can be verified in multiples ways:
On Arch Linux with Pipewire, where the logical device is closed when the hardware device is disconnected:
- Start Companion
- Set up MIDI device
- Disconnect MIDI device
- Reconnect MIDI device
- See theres no more data coming in
- Press “Save” or restart Companion
- See the data is coming in again (without re-selecting the device)
On MacOS the logical device is kept but can also be removed:
- Start Companion
- Set up MIDI device
- Disconnect MIDI device
- Remove MIDI device from “Audio-MIDI Setup” in MacOS
- Reconnect MIDI device
- See theres no more data coming in
- Press “Save” or restart Companion
- See the data is coming in again (without re-selecting the device)
In my opinion the plugin should check on the state of the MIDI connection repeatedly and re-establish the connection when the device is available again. Restarting companion or going to the settings to reconnect the MIDI device is not a great solution.
Thanks for the attention.