jackaudio / jack2

jack2 codebase
GNU General Public License v2.0
2.16k stars 371 forks source link

MIDI 2.0 Universal MIDI Packet format (UMP) #535

Open symdeb opened 4 years ago

symdeb commented 4 years ago

What is the assessment of the impact the MIDI 2.0 packet based protocol will have on Jack audio and MIDI ? Would this need a new ALSA driver/sequencer and a change of Jack2 related APIs ? https://www.midi.org/articles-old/details-about-midi-2-0-midi-ci-profiles-and-property-exchange

falkTX commented 4 years ago

A bit too early to tell, barely anything exists that supports MIDI 2.0 yet. From my understanding, there is no need to change JACK MIDI API, but we might have to do something regarding ALSA-MIDI support. First we have to wait until the ALSA does something about it though

symdeb commented 4 years ago

Link ALSA https://github.com/alsa-project/alsa-lib/issues Link universal packet format https://www.midi.org/articles-old/details-about-midi-2-0-midi-ci-profiles-and-property-exchange) https://www.midi.org/articles-old/midi-2-0-scope https://juce.com/discover/stories/introducing-midi-2-0 Link first MIDI 2.0 Ready product: Roland A-88MKII https://www.midi.org/articles-old/roland-announces

From MIDI.ORG: MIDI 2.0 uses a Universal MIDI Packet (UMP) format for MIDI 1.0 Protocol messages and MIDI 2.0 Protocol messages. There is a Version 2 of the USB Device Class Definition for MIDI Devices in development to support the UMP format. It will require new class drivers. All of the major OS vendors are aware of the progress. I think the ALSA team is also aware.

Note: ALSA team has been made aware of this, see ALSA github repo. https://github.com/alsa-project/alsa-lib/issues/24

bbouchez commented 4 years ago

Hello there, I am a MMA (MIDI Manufacturers Association) member from the MIDI 2.0 workgroup and I am currently working on some prototypes involving MIDI 2.0 on JACK. I can tell that JACK is currently perfectly compatible with MIDI 2.0 UMP packets. I have performed various tests on Windows and Linux platforms and the JACK servers on these two platforms are passing UMP packets perfectly.

symdeb commented 4 years ago

Is that between client created ports or with physical USB devices using the raw or sequencer setting in jack ? How would that work with Windows Win32 MIDI API that lies underneath Jack in Windows since the win32 API only supports a DWORD for MIDI events.

bbouchez commented 4 years ago

For now, there are no "official" physical devices yet, as the standard group is still discussing about USB implementation (there is nothing officially released about USB MIDI 2.0). On my side, I am working on Ethernet based devices, which do not need system dependent drivers. One of the tools I have created is a RTP-UMP daemon, which allows to exchange UMP packets between different physical machines. About Windows API : the problem is that there is not yet any official API (MME on Windows or CoreMIDI on Mac) which supports UMP packets for now. So you should not expect any existing Windows software to be compatible with UMP. For now, the only way to get these messages on a Windows machine is to use JACK to circumvent the MME API limitations.

symdeb commented 4 years ago

Thanks. that explains it Out of curiosity just verified UMP on Jack (Linux) with client registered ports. The data messages of 4 (and 8) bytes can indeed be exchanged between the ports. However when the packet reaches the ALSA level the first byte gets removed so only a 3 byte legacy MIDI message remains and this does reach the ALSA hardware device (or software clients) correctly. Do however get an error stack smashing detected : terminated Aborted (core dumped) when disconnecting ports & deactivating Jack. That does not occur with messages of 3 bytes.

bbouchez commented 4 years ago

Sounds logic. ALSA (like Win MME or Core MIDI) knows nothing about MIDI 2.0. That's why I am using RTP-UMP (based on RTP-MIDI) hardware interfaces. From software point of view, JACK's clients must be programmed specifically to recognize UMP. I plan to work on some Open Source synths later (especially for the Zynthian target) By the way, UMP is not only 4 and 8 bytes, there are also 16 bytes messages (but they pass through JACK like the others). From what I can see, JACK works like if these messages are SYSEX but it does not check that they start with 0xF0 (which is pretty cool as it makes JACK compatible de facto with UMP °-)

cbix commented 3 years ago

https://github.com/atsushieno/cmidi2

might be useful for client implementations.

jcelerier commented 11 months ago

things are starting to move, ALSA has alsa_ump support now: https://github.com/alsa-project/alsa-lib/blob/master/include/ump.h ; CoreMIDI has it since macOS 11.0 / iOS 14 (https://developer.apple.com/documentation/coremidi/midi_services/incorporating_midi_2_into_your_apps/) and there's WIP support on windows: https://devblogs.microsoft.com/windows-music-dev/the-new-windows-midi-services-spring-2023-update/

I'm currently adding support to https://github.com/jcelerier/libremidi