amidi.c.patch review request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi,

I improved my own patch to amidi.c

As a result I can now succesfully fetch a SysEx dump from my Yamaha Reface DX, and it exits succesfully after the timeout that I specify using the -t option.

Problem: My synth sends continuously not only 0xFE (Active Sensing) but also 0xF8 (Timing Clock). 24 times per quarter note to be exactly. With a fast tempo like 250 BPM this gives a 0xF8 byte every 10 ms. Until now when I tried to fetch a SysEx dump from my synth using amidi the data were polluted with lots of 0xF8 bytes and the -t option would not work. A bug I would say.

The attached patch seems to solve this issue, but please comment and improve where needed. Please try with other synths also.

Can someone submit my patch to the official sources? I don't know how to.
See attached.

--

Martin
--- amidi.c.orig	2015-11-20 23:10:21.230502547 +0100
+++ amidi.c	2016-03-20 16:52:55.366066476 +0100
@@ -559,7 +559,7 @@
 			int i, length;
 			unsigned short revents;
 
-			err = poll(pfds, npfds, 200);
+			err = poll(pfds, npfds, 5);
 			if (stop || (err < 0 && errno == EINTR))
 				break;
 			if (err < 0) {
@@ -567,7 +567,7 @@
 				break;
 			}
 			if (err == 0) {
-				time += 200;
+				time += 5;
 				if (timeout && time >= timeout)
 					break;
 				continue;
@@ -589,7 +589,7 @@
 			}
 			length = 0;
 			for (i = 0; i < err; ++i)
-				if (!ignore_active_sensing || buf[i] != 0xfe)
+				if (!ignore_active_sensing || buf[i] < 0xf8)
 					buf[length++] = buf[i];
 			if (length == 0)
 				continue;
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux