[alsa-devel] [PATCH 1/2] amidi: ignore not only Active Sensing but also Clock bytes

Takashi Sakamoto o-takashi at sakamocchi.jp
Sat Aug 13 13:14:46 CEST 2016


Hi Clemens,

On Aug 13 2016 19:28, Clemens Ladisch wrote:
> 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 at gmail.com>
> Signed-off-by: Clemens Ladisch <clemens at ladisch.de>
> ---
>  amidi/amidi.1 |   19 ++++++++++++++-----
>  amidi/amidi.c |   13 +++++++++++--
>  2 files changed, 25 insertions(+), 7 deletions(-)
> 
> ...
>
> diff --git a/amidi/amidi.c b/amidi/amidi.c
> index cedf18c..58ac814 100644
> --- a/amidi/amidi.c
> +++ b/amidi/amidi.c
> @@ -77,7 +77,8 @@ static void usage(void)
>  		"-d, --dump             print received data as hexadecimal bytes\n"
>  		"-t, --timeout=seconds  exits when no data has been received\n"
>  		"                       for the specified duration\n"
> -		"-a, --active-sensing   don't ignore active sensing bytes\n");
> +		"-a, --active-sensing   include active sensing bytes\n"
> +		"-c, --clock            include clock bytes\n");
>  }
> 
>  static void version(void)
> @@ -419,10 +420,12 @@ int main(int argc, char *argv[])
>  		{"dump", 0, NULL, 'd'},
>  		{"timeout", 1, NULL, 't'},
>  		{"active-sensing", 0, NULL, 'a'},
> +		{"clock", 0, NULL, 'c'},
>  		{ }

Need to modify a table for short options.

diff --git a/amidi/amidi.c b/amidi/amidi.c
index 290df48..ea61cba 100644
--- a/amidi/amidi.c
+++ b/amidi/amidi.c
@@ -411,7 +411,7 @@ static void add_send_hex_data(const char *str)

 int main(int argc, char *argv[])
 {
-       static const char short_options[] = "hVlLp:s:r:S::dt:a";
+       static const char short_options[] = "hVlLp:s:r:S::dt:a:c";
        static const struct option long_options[] = {
                {"help", 0, NULL, 'h'},
                {"version", 0, NULL, 'V'},

Regards

Takashi Sakamoto


More information about the Alsa-devel mailing list