Skip to contentSkip to conversation

Add MIDI 2.0 support

PATCH Superseded Takashi Iwai 1 participant 4 messages May 20, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Add MIDI 2.0 support

This is a small patch set for alsa-utils to add the MIDI 2.0 support. Very minimalistic changes, covering only the sequencer programs:
aseqdump, aconnect and aplaymidi.

Takashi

---

Takashi Iwai (3):
aseqdump: Add UMP support
aconnect: Add UMP support
aplaymidi: Add UMP support

 configure.ac              |   4 +
 seq/aconnect/aconnect.1   |   3 +
 seq/aconnect/aconnect.c   |  91 +++++++++++++---
 seq/aplaymidi/aplaymidi.1 |   6 ++
 seq/aplaymidi/aplaymidi.c | 216 ++++++++++++++++++++++++++++++--------
 seq/aseqdump/aseqdump.1   |   9 ++
 seq/aseqdump/aseqdump.c   | 211 ++++++++++++++++++++++++++++++++++++-
 7 files changed, 478 insertions(+), 62 deletions(-)
Signature · 1 line
2.35.3
#1 lore raw

PATCH 1/3 aseqdump: Add UMP support

Add the support for showing the UMP events to aseqdump. With the new option -u, the program can start as a UMP sequencer client and receive UMP events instead of the legacy MIDI events.

Also, the automatic event conversion among legacy and UMP clients can be suppressed by the new -r option, too.

---
 configure.ac            |   4 +
 seq/aseqdump/aseqdump.1 |   9 ++
 seq/aseqdump/aseqdump.c | 211 +++++++++++++++++++++++++++++++++++++++-
 3 files changed, 219 insertions(+), 5 deletions(-)
configure.ac +4 -0
index e079e241aa29..2ce8a62c585c 100644
@@ -54,6 +54,10 @@ AC_CHECK_LIB([asound], [snd_seq_client_info_get_pid], [HAVE_SEQ_CLIENT_INFO_GET_
 if test "$HAVE_SEQ_CLIENT_INFO_GET_PID" = "yes" ; then
     AC_DEFINE([HAVE_SEQ_CLIENT_INFO_GET_PID], 1, [alsa-lib supports snd_seq_client_info_get_pid])
 fi
+AC_CHECK_LIB([asound], [snd_seq_client_info_get_midi_version], [HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION="yes"])
+if test "$HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION" = "yes" ; then
+    AC_DEFINE([HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION], 1, [alsa-lib supports snd_seq_client_info_get_midi_version])
+fi
 AC_CHECK_LIB([atopology], [snd_tplg_save], [have_topology="yes"], [have_topology="no"])
 
 #
seq/aseqdump/aseqdump.1 +9 -0
index f6f2aa9cb12b..6f7904159b90 100644
@@ -27,6 +27,15 @@ Prints the current version.
 .I \-l,\-\-list
 Prints a list of possible input ports.
 
+.TP
+.I \-u,\-\-ump=version
+Sets the client MIDI version.
+0 is for legacy mode, 1 is UMP MIDI 1.0 mode, and 2 is UMP MIDI 2.0 mode.
+
+.TP
+.I \-r,\-\-raw
+Suppress the automatic conversion of events among UMP and legacy clients.
+
 .TP
 .I \-p,\-\-port=client:port,...
 Sets the sequencer port(s) from which events are received.
seq/aseqdump/aseqdump.c +206 -5

275 lines not on this page · raw message

Signature · 1 line
2.35.3
#2 lore raw

PATCH 2/3 aconnect: Add UMP support

In reply to Takashi Iwai

This patch extends the aconnect program for supporting UMP. Now the verbose output can show the UMP client version.

Also, a new option -a is added to control the behavior whether to show the all ports including the inactive ports or not. As default, only the active ports are shown, but UMP clients allow to hide some ports as inactive.

---
 seq/aconnect/aconnect.1 |  3 ++
 seq/aconnect/aconnect.c | 91 +++++++++++++++++++++++++++++++++--------
 2 files changed, 78 insertions(+), 16 deletions(-)
seq/aconnect/aconnect.1 +3 -0
index 2050187a3362..5c015196f19c 100644
@@ -120,6 +120,9 @@ List existing output (writable) ports.
 This option is exclusive to
 .B \-i.
 .TP
+.B \-a, \-\-all
+List inactive ports, too.
+.TP
 .B \-l, \-\-list
 List the current connection status.  The connected and connecting ports
 from/to each port are listed together.
seq/aconnect/aconnect.c +75 -16

156 lines not on this page · raw message

Signature · 1 line
2.35.3
#3 lore raw

PATCH 3/3 aplaymidi: Add UMP support

In reply to Takashi Iwai

By switching via the new option -u, aplaymidi can behave as a UMP client and output UMP packets instead of legacy sequencer events. As of now, the only supported version is 1.

---
 seq/aplaymidi/aplaymidi.1 |   6 ++
 seq/aplaymidi/aplaymidi.c | 216 ++++++++++++++++++++++++++++++--------
 2 files changed, 181 insertions(+), 41 deletions(-)
seq/aplaymidi/aplaymidi.1 +6 -0
index 02fef9d9d668..0c8238d586fe 100644
@@ -31,6 +31,12 @@ Prints a list of possible output ports.
 Sets the sequencer port(s) to which the events in the MIDI file(s) are
 sent.
 
+.TP
+.I \-u, \-\-ump=version
+Changes the sequencer client to the given MIDI version and outputs via
+the UMP packets instead of legacy sequencer events.
+As of now, the only supported version is 1.
+
 A client can be specified by its number, its name, or a prefix of its
 name. A port is specified by its number; for port 0 of a client, the
 ":0" part of the port specification can be omitted.
seq/aplaymidi/aplaymidi.c +175 -41

283 lines not on this page · raw message

Signature · 1 line
2.35.3