I have compiled your demo MidiFiler on Linux Debian 12 but I do not catch how to test it.
Could you give the command line that you use on your Debian system (maybe I'll have the click) ?
What I'm doing is:
In one shell session:
Anything that connects to that will now get dumped.
In another shell session:
/usr/local/src/asound/trunk/examples$ aconnect -l
client 0: 'System' [type=kernel]
0 'Timer '
1 'Announce '
client 14: 'Midi Through' [type=kernel]
0 'Midi Through Port-0'
client 16: 'Keystation Pro 88' [type=kernel,card=0]
0 'Keystation Pro 88 MIDI 1'
1 'Keystation Pro 88 MIDI 2'
client 20: 'MD100' [type=kernel,card=1]
0 'MD100 MIDI 1 '
Connected From: 128:0
client 128: 'WatchP0x' [type=user,pid=1885]
0 'WatchP0x '
Connecting To: 20:0
client 129: 'Client-129' [type=user,pid=84482]
0 'Virtual RawMIDI '
/usr/local/src/asound/trunk/examples$ ./MidiFilter-x86_64-linux-qt5 16:0 129:0
Subscribing 1 sources, PID 84500
The first command there lists the current devices, note 129:0 at the end which is the copy of amidi dumping anything sent to it.
The second command sets up a subscription between 16:0 (a keyboard) and the debug output.
If instead you run the program from the Lazarus IDE with the parameters 16:0 129:0 you should see it set up a subscription. It will, in actual fact, handle multiple source devices in the same way that cat handles multiple source files.
On termination, subscriptions are freed (resulting in an abort, which is one of the problems).
If you look at the latter part of the program, you'll see a loop which I expected to read any events which were marked as filtered. However so far /everything/ appears to be handled inside ALSA, so I am not at all sure how one's supposed to capture the filtered stuff.
Any insights you can contribute would be much appreciated: /if/ the filtering facility does break into subscriptions (which is what I was initially expecting) it would vastly simplify this sort of code.
As you'll see from a README I've left in the examples directory, I was originally hoping that I'd be able to map controls on my M-Audio keyboard to the Bristol/Brighton softsynths. However I suspect that they've never actually gained MIDI handling other than key events and the pitch/mod wheels.
MarkMLl