Move the low-level API function call to init_seq() instead of calling
directly from main(). Just a code refactoring.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Make man page a bit nicer; reformatting and setting bold/italic
properly, typo fixes, and adding a few more words and sections.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add a new option -u to specify the UMP MIDI1 or MIDI2 mode. As
default (-u 0), the program reads the legacy MIDI 1.0 byte stream,
while in UMP mode, it reads as UMP packets and send to the target.
The UMP packet bytes are encoded in big endian.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Show the event prefix "SysEx" for UMP SysEx data. Otherwise it's
difficult to know what it is.
Fixes: 506097ebb1 ("aseqdump: Show UMP SysEx messages")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The printf format for a normalized velocity in MIDI2 mode had a typo,
resulting in a bogus value. Fix it.
Fixes: 7e9bebad0b199 ("aseqdump: Add options to switch view mode")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Enhance aseqdump to interpret more UMP messages. Now it includes the
standard Stream messages and Flex Data messages.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
So far, aplaymidi2 passes the MIDI1/MIDI2 channel voice UMP messages
to the target while processing other UMP messages internally. But
sometimes we'd like to pass all UMP messages as is and let the
receiver processes.
This patch adds a new option -a (or --passall) to pass the all UMP
packets included in the given MIDI Clip file to the target as-is.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The current code didn't proceed the text position buffer and the text
was always truncated in 12 bytes. Let's fix it.
Fixes: 74daf3a93a ("arecordmidi2: Add options to put meta data texts")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
For convenience, add more options to embed the meta data texts given
via command line. The song name etc can be given directly via the
respective option directly, e.g. --song="text..."
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Allow to add arbitrary profile UMP data to be put into the
configuration of the recorded stream via --profile option.
The file must contain valid UMP data encoded in big-endian.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
When the output file is '-', it's recorded to stdout.
For avoiding the corruption, this mode also suppresses the messages to
stdout, too, which can be enabled also via -s / --silent option.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This reverts commit e609d66807.
It turned out that the failure was rather in alsa-lib API; the
input and output have been incorrectly implemented.
Now that the alsa-lib code got fixed, let's revert the bad fix.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Now aplaymidi2 shows the meta data texts embedded in Flex Data
messages such as copyright and lyrics. The text output isn't
synchronized yet with the actual position, though.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The inactive port should have been shown in each port line instead of
the client name line.
Fixes: 64b1d486b1 ("aconnect: Add UMP support")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The recorded tick is incorrectly converted for 1us tempo-base on the
old kernels. Since we correct the queue tempo, we don't have to
adjust the returned tick value any longer. The current code applies
it doubly, resulting in 100 times slower.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The direction was wrongly passed to the FB setup. It has to be
"OUTPUT" instead of "INPUT, so that other applications can write to
arecordmidi2 port.
Fixes: 2cdf5ebedb ("arecordmidi2: Add initial version")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The queue should be started at the very same time of the start of the
stream itself in the interactive mode. Otherwise it'll get bogus long
waits until the start of the clip.
Move the code to start the queue in start_bar(), so that it's always
tied with the start sequence.
Fixes: 1205dd5f6c ("arecordmidi2: Add passive mode and interactive mode")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Allow arecordmidi2 running without specifying the source ports via -p
option. This will create a UMP Endpoint with the full 16 FBs, and
simply reads from the input ports via subscribers. User needs to
connect to the ports manually, though.
Also, add -r option to run in the interactive mode. In the
interactive mode, arecordmidi2 waits for the RETURN key entered from
the terminal to start the recording, and the recording ends after
another RETURN key.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
arecordmidi2 is a similar program like arecordmidi for recording the
incoming MIDI events, but storing in a MIDI Clip file for MIDI 2.0.
Most options are kept from arecordmidi, but some are dropped: namely,
the -l, -m and -f options are dropped for code simplicity.
Also -s option is dropped as well, as there is no need for split for
MIDI Clip file unlike SMF.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
aplaymidi2 is a program similar like aplaymidi, but intended for
playing back a MIDI Clip file that was introduced for handling UMP.
MIDI Clip file contains UMP packets, and its structure is much simpler
than SMF.
The options are mostly same as aplaymidi, but I omitted -l option for
simplifying the code.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix white spaces and applied a slight code refactoring to reduce the
indentation levels. No code functionality changes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
A slightly better version. The extraction of a SysEx byte from a UMP
packet is more complicated than wished, in anyway.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
aseqsend is a command-line utility which allows one to send SysEx
(system exclusive) data to ALSA MIDI seqencer port. It can also send
any other MIDI commands.
Closes: https://github.com/alsa-project/alsa-utils/pull/257
Signed-off-by: Miroslav Kovac <mixxoo@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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>