Commit graph

82 commits

Author SHA1 Message Date
Miroslav Kovac
7547242d0f aseqsend: initial version
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>
2024-05-23 13:22:20 +02:00
John K. Luebs
4cb3e3a7b5 aplaymidi: Set event completely for tempo event
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>
2024-01-08 09:52:55 +01:00
Jaroslav Kysela
66112d60e4 seq: use ATTRIBUTE_UNUSED instead remove argument name
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>
2023-09-04 16:54:14 +02:00
Jaroslav Kysela
feb9c4cdec reshuffle included files to include config.h as first
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>
2023-08-30 18:48:23 +02:00
Jaroslav Kysela
5201ec026d aseqdump: fix MIDI 2.0 code - it compiles now
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 15:56:06 +02:00
Jaroslav Kysela
181e19017d aplaymidi: fix the verbose compilation warnings for latest gcc
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 15:42:19 +02:00
Jaroslav Kysela
a03377a221 aseqnet: fix the verbose compilation warnings for latest gcc
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 12:58:11 +02:00
Jaroslav Kysela
429c32a2ec aseqdump: fix the verbose compilation warnings for latest gcc
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 12:58:11 +02:00
Jaroslav Kysela
0b48dd621b aconnect: fix the verbose compilation warnings for latest gcc
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 12:53:16 +02:00
Takashi Iwai
7e9bebad0b aseqdump: Add options to switch view mode
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>
2023-08-28 16:44:45 +02:00
Takashi Iwai
ad09344d4c aseqdump: Correct wrong channel number
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>
2023-08-28 16:44:45 +02:00
Takashi Iwai
8703c08978 aseqdump: Align outputs of UMP MIDI 1.0 with legacy MIDI 1.0
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>
2023-08-28 16:44:45 +02:00
Takashi Iwai
b399fb85a9 aplaymidi: Add UMP support
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>
2023-06-06 15:44:58 +02:00
Takashi Iwai
64b1d486b1 aconnect: Add UMP support
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>
2023-06-06 15:44:57 +02:00
Takashi Iwai
2b08d585a3 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.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-06 15:44:57 +02:00
Jaroslav Kysela
5471a0b285 aseqnet: add ipv6 support
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-08-09 20:24:44 +02:00
Jaroslav Kysela
c8e5762750 aseqnet: use getaddrinfo() instead obsolete gethostbyname()
- modernize code (preparation for IPv6)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-08-09 18:11:37 +02:00
Andrea Piras
0e21f4d864 added an option to aseqnet to optionally set the midi process name
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>
2021-06-14 12:00:44 +02:00
Jaroslav Kysela
f8ce4f1e3a amidi, aseqnet: handle write errors
BugLink: https://github.com/alsa-project/alsa-utils/issues/17
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-03-05 21:50:28 +01:00
Michael Forney
cb47f6dcf4 Avoid empty initializer list
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>
2020-02-10 12:39:43 +01:00
Michael Forney
62a765087e Avoid pointer arithmetic on void *
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>
2020-02-10 12:38:52 +01:00
Rosen Penev
5e6df5ae4b treewide: sys/poll to poll
Fixes warning on musl:

warning redirecting incorrect #include <sys/poll.h> to <poll.h>

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-11-20 19:44:02 +01:00
Jaroslav Kysela
6dc4b1eab5 arecordmidi: simple coverity fix
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-03-12 16:06:03 +01:00
Prashant Malani
52c9cc9571 seq: arecordmidi: Add num-events option
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>
2019-02-11 09:13:47 +01:00
Jaroslav Kysela
b1e3d945b7 Change FSF address (Franklin Street)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2017-11-14 14:28:53 +01:00
Martin Koegler
ccc108fb83 aconnect: Show sequencer sound card numer/PID via aconnect
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>
2016-03-09 09:15:43 +01:00
Jaroslav Kysela
0a6c9e80f7 Makefiles - use AM_CPPFLAGS instead INCLUDES
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2014-05-07 10:55:59 +02:00
Karl Bongers
0d46081679 fix aconnect -l option
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>
2014-05-07 08:51:00 +02:00
Elimar Riesebieter
48554fc28b Fix several typos in manpage and help strings.
Signed-off-by: Jordi Mallach <jordi@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-16 10:38:02 +02:00
Takashi Iwai
2b31992c79 aseqnet: Remove obsoleted .LO entry from man page
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-15 16:34:55 +02:00
Clemens Ladisch
8f7b63be04 aplaymidi: clarify multi-port documentation
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>
2011-11-02 20:03:42 +01:00
Clemens Ladisch
b4ff58b685 Revert wrong parts of "alsactl: use snd_config_imake* functions"
This reverts the parts of commit e509df69a5
that accidentally reverted a bunch of earlier commits.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2010-05-26 10:37:58 +02:00
Clemens Ladisch
e509df69a5 alsactl: use snd_config_imake* functions
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>
2010-05-26 10:07:47 +02:00
lieven moors
b5f5ebcbe6 aconnect -x: Do not update index after removal of connection.
Signed-off-by: lieven moors <lievenmoors@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-25 12:21:58 +01:00
Clemens Ladisch
d94ab95c0d aplaymidi: reduce bandwidth for big SysEx messages
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>
2009-08-17 12:29:11 +02:00
Takashi Iwai
2e3915d158 aseqnet - Add $(INTLLIBS) to Makefile.am
Add $(INTLLIBS) to LDADD for aseqnet to fix build errors on uclibc
(and possibly others).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-08 11:59:27 +01:00
Diego E. 'Flameeyes' Pettenò
6232f1c96c Make some static tables and strings constants.
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>
2008-11-21 13:10:02 +01:00
Clemens Ladisch
8e2046bed5 aseqdump: flush output
Flush the output after all currently available events have been printed
to allow filtering interactive output through a pipe.
2008-02-21 09:12:53 +01:00
Clemens Ladisch
23f3e570cc fix poll timeout
Use an infinite poll timeout to prevent unnecessary wakeups.
2008-02-21 09:12:27 +01:00
Clemens Ladisch
8497258145 aseqdump: increase verbosity
Include the names of parameters when printing events instead of just
showing the raw values.
2008-02-21 09:11:58 +01:00
Takashi Iwai
14f7981d59 Add missing inclusion of assert.h 2007-10-25 15:39:19 +02:00
Clemens Ladisch
32c0c7bc5a arecordmidi: mention SMF type in man page
Document the SMF type (0 or 1) that will be generated by arecordmidi.
2007-09-17 09:44:29 +02:00
Takashi Iwai
83bf6c33ad Fix aconnect man page
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>
2007-01-08 11:46:12 +01:00
Clemens Ladisch
4de3d5a273 aplaymidi: handle big SysEx commands
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.
2006-12-04 18:01:23 +01:00
Clemens Ladisch
3a7f46c00f aplaymidi: list only MIDI-capable ports
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.
2006-05-02 15:43:07 +02:00
Takashi Iwai
9fb30e388f Fix compile warnings
Fix trivial compile warnings.
2005-12-16 18:44:14 +00:00
Takashi Iwai
9dc666526f Disable NLS support when --disable-nls is passed
Disable NLS support when --disable-nls is passed (bug#1514).
2005-11-08 16:43:36 +00:00
Takashi Iwai
9d1ad2effd Fix compile with --disable-nls
Fix compile with --disable-nls.
2005-10-31 14:44:03 +00:00
Clemens Ladisch
e6cbac57f6 aseqdump - remove fishy comment
Remove the fishy comment because it isn't needed anymore after the tuna
has been accidentally removed.
2005-07-25 15:20:07 +00:00
Takashi Iwai
39ff48b437 Output help messages to stdout
Output help messages and lists to stdout instead of stderr.
2005-06-23 10:39:16 +00:00