[alsa-devel] usage of snd_seq_set_client_event_filter
Hi all,
I was trying to use snd_seq_set_client_event_filter in my application but I can't seem to get it to work correctly.
I have attached a small test program which can be compiled with "g++ -o test test.cpp -lasound". My alsa-lib is at 1.0.25. It should simple print the note number for any noteOn events.
I was under the impression that the way I have used it only noteOn events would get through but it seems that only the first noteOn event I send it gets through. I have been sending events using VMPK.
If I remove snd_seq_set_client_event_filter everything seems to work (except the events aren't filtered of course).
What am I doing wrong?
All the Best,
Kaspar
Sorry, in test.cpp, the line with snd_seq_set_client_event_filter should be uncommented of course.
Kaspar Bumke wrote:
I was trying to use snd_seq_set_client_event_filter in my application but I can't seem to get it to work correctly.
I have attached a small test program which can be compiled with "g++ -o test test.cpp -lasound". My alsa-lib is at 1.0.25. It should simple print the note number for any noteOn events.
I was under the impression that the way I have used it only noteOn events would get through but it seems that only the first noteOn event I send it gets through. I have been sending events using VMPK.
Any filtered-out events gets rejected with an error, which gets reported back to the sending application. If that application does nothing to handle the error, all further attempts to send events will get the same error because the event being rejected is still in the output buffer.
This behaviour makes event filters pretty much useless. Just ignore any events you don't want.
Regards, Clemens
participants (2)
-
Clemens Ladisch
-
Kaspar Bumke