After UMP support was added in b399fb8 ev.type setting was inadvertently
dropped in the code path handling tempo meta event.
This is causing tempo meta events to not be handled at all.
Moreover, snd_seq_ev_set_fixed is also missing so MIDI files with
variable events such as SYSEX before the tempo meta event usually are
causing a segfault.
Fixes: b399fb85a9 ("aplaymidi: Add UMP support")
Closes: https://github.com/alsa-project/alsa-utils/issues/241
Signed-off-by: Takashi Iwai <tiwai@suse.de>
We need to support older compilers than GCC 11.
Link: https://github.com/alsa-project/alsa-utils/issues/233
Fixes: 181e190 ("aplaymidi: fix the verbose compilation warnings for latest gcc")
Fixes: a03377a ("aseqnet: fix the verbose compilation warnings for latest gcc")
Fixes: 429c32a ("aseqdump: fix the verbose compilation warnings for latest gcc")
Fixes: 0b48dd6 ("aconnect: fix the verbose compilation warnings for latest gcc")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
config.h may contain defines like _FILE_OFFSET_BITS which influence
the system wide include files (off_t types, open -> open64 function
usage etc.).
Related: https://github.com/alsa-project/alsa-utils/pull/223
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This patch adds to switch the operation mode of aseqdump to specify
how the values are shown. Namely, it allows to show the MIDI 2.0
values in two more different ways: compatible "normalized" view and
percentage view, in addition to the default "raw" view.
The "raw" view mode just shows the value found in the event almost as
is. The MIDI 2.0 values are shown in 16 or 32bit hex numbers.
The channel and UMP group numbers are 0-based, taking from 0 to 15.
OTOH, in the normalized view, the 16bit or 32bit velocity and data
values of MIDI 2.0 are normalized to the value fit in MIDI 1.0,
i.e. from 0 to 127, but with decimal points. Similarly, the pitch
wheel values are normalized between -8192 to 8191.
Also, the channel numbers and UMP group numbers are 1-based, taking
from 1 to 16.
In the percentage view, the velocity and data values are normalized
and shown in percentage, from 0% to 100%. The pitch wheel is
normalized from -100% to 100%. The channel and UMP groups are 1-based
as well as in normalized view mode.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Correct the wrong value shown in MIDI2 default output (status instead
of channel). Also adjust the printf formats to use %2d consistently
for the channel numbers.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The outputs from UMP MIDI 1.0 are slightly differently shown as the
legacy MIDI 1.0 (the velocities and values are in hex), which is
rather confusing. Let's make them look more similar.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This option allows to run multiple instances of aseqnet without having
to double check the assigned port number, since each one can get spawned
with a unique name.
Fixes: https://github.com/alsa-project/alsa-utils/pull/95
Signed-off-by: Andrea Piras <andrea.piras.85@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
To zero-initialize an object, use `{0}` instead.
Signed-off-by: Michael Forney <mforney@mforney.org>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The pointer operand to the binary `+` operator must be to a complete
object type.
Signed-off-by: Michael Forney <mforney@mforney.org>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add a command line option to automatically exit after recording a fixed
number of MIDI events. This allows a program using arecordmidi to expect
a MIDI file to be written automatically when the specified number of
events have been received, instead of having to send a SIGINT or SIGTERM
programmatically.
It also avoids the need to have the arecordmidi process running in the
background, and then constantly stat the output file to check if any
bytes have been written to it (this makes for less predictable and
longer-running tests).
This functionality finds use in Chrome OS functional testing, since
having to send SIGTERM/SIGINT programmatically and then wait for the
output file adds unpredictability and delay to the tests.
The addition of this command-line option should (hopefully) not break
any existing usage.
Signed-off-by: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
rawmidi devices expose the card number via IOCTLs, which allows to
find the corresponding device in sysfs.
The sequencer provides no identifing data. Chromium works around this
issue by scanning rawmidi as well as sequencer devices and matching
them by using assumtions, how the kernel register sequencer devices.
This patch adds support for displaying the sound card number/PID to
aconnect.
Signed-off-by: Martin Koegler <martin.koegler@chello.at>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
aconnect -l would just print usage.
This fix makes it do what usage says it should do.
Signed-off-by: Karl Bongers <karlbongers@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The man page did not document what happens when multiple ports are
specified; this could be misinterpreted as the events being duplicated
so that they are played on all ports simultaneously. As suggested by
Peter Billam, clarify that these ports are only used for multi-port MIDI
files.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
To save a call to snd_config_set_xxx, replace the calls to
snd_config_make_xxx with snd_config_imake_xxx.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
When throttling the data rate for big SysEx messages, use the bandwidth
that devices use in practice instead of the theoretical maximum.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
By doing this we move them from the .data section to .rodata setion,
or from .data.rel to .data.rel.ro.
The .rodata section is mapped directly from the on-disk file, which is
always a save, while .data.rel.ro is mapped directly when using
prelink, which is a save in a lot of cases.
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
Use local definitions of .EX/.EE or .DS/.DE to avoid low-level troff
requests in the page body. There are plans to add these to groff man;
in the interim, this patch adds a compatible definition.
From: Eric S. Raymond <esr@thyrsus.com>
Make sure that the sequencer output buffer is big enough to handle all
events that we send, and split large SysEx commands into one-second
chunks so that the sequencer kernel code can handle them.
When listing ports with aplaymidi/arecordmidi, show only
ports that understand MIDI messages, i.e., that have the
SND_SEQ_PORT_TYPE_MIDI_GENERIC flag set.