Commit graph

29 commits

Author SHA1 Message Date
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
1843540e27 amidi: fix the verbose compilation warnings for latest gcc
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 12:50:57 +02:00
SASANO Takayoshi
613372dc7c Add OpenBSD support
- ERESTART not supported platform: use EINTR instead
- add include/os_compat.h, well-used OS specific definition
- copied include/bswap.h from alsa-lib

- EPIPE and ESTRPIPE are different usage, but currently
  EPIPE is used when ESTRPIPE is not defined.

  To fix this problem, assign ESPIPE instead.

Fixes: https://github.com/alsa-project/alsa-utils/pull/186
Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-02-03 13:08:44 +01:00
John Keeping
4daf22b278 amidi: restore space between bytes
Commit 9a8fcec ("amidi: add timestamp option for dump") removed the
space between bytes when dumping MIDI, changing the output from:

	90 45 40
	80 45 00

to:

	904540
	804500

It seems that this was an unintentional side effect of refactoring the
code to add the new timestamp output but the result is less readable
than it was before.

Restore the space between bytes in the same message.

Fixes: 9a8fcec ("amidi: add timestamp option for dump")
Fixes: https://github.com/alsa-project/alsa-utils/pull/158/
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2022-11-04 22:01:19 +01:00
Jaroslav Kysela
52f5bea5e9 amidi: remove unused variable
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-12-06 11:02:10 +01:00
folkert van heusden
9a8fcec5aa amidi: add timestamp option for dump
Added -T / --timestamp option (with parameter "realtime", "monotonic" or "raw") which prints
a timestamp before each received message when using the --dump mode.

Fixes: https://github.com/alsa-project/alsa-utils/pull/108
Signed-off-by: Folkert van Heusden <mail@vanheusden.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-08-24 12:05:52 +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
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
b1e3d945b7 Change FSF address (Franklin Street)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2017-11-14 14:28:53 +01:00
Jaroslav Kysela
1314abd2d6 amidi: optarg might be NULL, fix 't' argument parsing 2017-02-27 09:04:08 +01:00
Felipe F. Tonello
b59745978f amidi: add sysex-interval option
This patch adds a new option to amidi tool: sysex-interval.

It adds a delay (in milliseconds) in between each SysEx message - it searches
for a 0xF7 byte.

This is very useful when sending firmware updates to a remote device via SysEx
or any other use that requires this delay in between SysEx messages.

`amidi' manual was updated with an example usage as well.

Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-13 18:19:19 +02:00
Clemens Ladisch
a6e9a8da9e amidi: fix timeout handling
The timeout is not supposed to expire when ignored messages are
received.  This cannot be handled with the poll() timeout, so add
a separate timer.

Reported-by: Martin Tarenskeen <m.tarenskeen@gmail.com>
Reviewd-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 11:18:58 +02:00
Clemens Ladisch
04322ca749 amidi: ignore not only Active Sensing but also Clock bytes
Active Sensing messages are sent by many devices in the background and
would only interfere with the actual messages that amidi is supposed to
capture.  Therefore, amidi ignores them by default.  However, there are
also devices that send Clock messages with the same problem, so it is
a better idea to filter them out, too.

Reported-by: Martin Tarenskeen <m.tarenskeen@gmail.com>
Reviewd-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 11:18:48 +02:00
Clemens Ladisch
c2eaf88f7e amidi: fix port listing
Rewrite the port listing code because it was too complex and had some
bugs when handling write-only or read-only ports.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2010-01-25 14:11:37 +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
Diego E. 'Flameeyes' Pettenò
ca1ea1e904 Mark static the functions not used outside their unit.
This way the compiler can assume more information about their
interface for optimisation.

Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
2008-11-21 13:09:56 +01:00
Clemens Ladisch
2d470cf9c1 amidi: open devices non-blockingly
Open the RawMIDI devices in non-blocking mode so that we do not hang
while a device is busy.
2007-04-17 09:25:01 +02:00
Clemens Ladisch
7bae1b0a5b amidi: fix --list-devices
Fix the formatting of devices with several unnamed subdevices,
and show input/outputness for these, too.
2006-06-27 08:19:15 +02:00
Takashi Iwai
6764ddbd53 amidi: Fix device list
From: Matthias Koenig <mk@phasorlab.de>

amidi does not show all devices with the --list-devices option.
It assumes that all output ports equals input ports and does not
show an input only port.
This patch extends the output of amidi -l by one column which shows
the input/output direction of each port.
E.g.

zebra:amidi # ./amidi -l
Dir Device    Name
IO  hw:1,0    MPU-401 MIDI 1-0
IO  hw:2,0,0  Keystation MIDI 1
IO  hw:3,0,0  Miditerminal 1
IO  hw:3,0,1  Miditerminal 2
IO  hw:3,0,2  Miditerminal 3
IO  hw:3,0,3  Miditerminal 4
I   hw:3,0,4  Miditerminal SMPTE
2006-06-23 14:53:38 +02: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
Clemens Ladisch
556364bbaf detect attempts to play .mid files with amidi
Complain when the user attempts to play .mid files with amidi.
2005-03-14 15:13:48 +00:00
Clemens Ladisch
44cb75c764 fix amidi error handling
Fix error handling when the input file cannot be loaded.
2005-03-14 15:11:45 +00:00
Clemens Ladisch
c44463f841 fix buffer length calculation
The send_hex buffer length has to include the separating space, too.
2005-02-16 10:03:52 +00:00
Clemens Ladisch
5df127e3f3 allow --send-hex data without quotes
Now all non-option arguments are read as data for the -S option,
instead of requiring exactly one argument for -S.

This fixes the bug that when specifying multiple bytes for the -S
option separated with spaces but without quoting, amidi would silently
ignore all but the first byte.
2005-02-16 09:52:25 +00:00
Takashi Iwai
e24a1cb4f9 Clemens Ladisch <clemens@ladisch.de>:
- This adds an option to amidi not to ignore active sensing bytes.
2004-01-19 18:39:12 +00:00
Takashi Iwai
87873452ce Clemens Ladisch <clemens@ladisch.de>:
- set file permission bits for output file
2004-01-13 16:11:56 +00:00
Jaroslav Kysela
80476a0170 - changes against PCM API switch
- 1.0.0 version
- fixed amidi warning
2003-11-05 11:08:25 +00:00
Takashi Iwai
e90417e3fd - added amidi utility by Clemens Ladisch <clemens@ladisch.de>
- fixed .cvsignore and README
2003-10-28 10:53:43 +00:00