fluidsynth
fluidsynth copied to clipboard
Fluidsynth keeps playing the last note infinitely if the client application crashes or gets killed
Fluidsynth version 2.2.8 System: Arch Linux x64 Exec string: /usr/bin/fluidsynth -is -a pulseaudio -m alsa_seq -r 48000
Fluidsynth keeps playing the last note infinitely if the client application crashes or gets killed. Changing audio driver doesn't help. This does not happen with Timidity.
Ways to reproduce: start any midi player (Drumstick MIDI Player in my case), play .midi file, killall midiplayer
.
Aha, and how do you expect fluidsynth to behave in this case? Crash as well? Terminate itself? Or simply send itself a noteoff?
Aha, and how do you expect fluidsynth to behave in this case? Crash as well? Terminate itself? Or simply send itself a noteoff?
I'd expect FluidSynth to stop playing once the client's output stream is off for whatever reason. I am not aware if the MIDI standard implies looping the last sent note forever (i.e. to avoid flooding the bitstream with recurring notes or similar), but IMO it should be noticed that applications may not terminate properly.
I am not aware if the MIDI standard implies looping the last sent note forever
It is an immanent feature of the MIDI standard that when you unplug the cable, you get hanging notes. Therefore, I consider this to be feature request rather than a bug.
AFAIK, Timidity only supports ALSA sequencer and can therefore simply make use of the SND_SEQ_EVENT_PORT_UNSUBSCRIBED
. Fluidsynth however supports various sequencer backends. Handling this corner case of disconnected ports is quite a lot of effort. I don't think it's worth it. I would prefer to have consistent behavior across all MIDI drivers (as with hanging notes currently). Yet, you're welcome to draft a PR for this.
I'm currently not planning to change this behavior for all drivers, sry.
Perhaps, if you aren't going to support the ALSA MIDI standard in a sensible way, it might be an idea to remove the ALSA synthesizer functionality from Fluidsynth altogether - as it stands, I've just wasted a bunch of time configuring Fluidsynth as an ALSA server only to find out, hours later, from here that it's intentionally broken and will never be fixed.
At the moment, the deliberately broken by design ALSA implementation gives people the incorrect impression that Fluidsynth can be used as an ALSA synth device when it is actually unfit for that purpose.
I propose that removing ALSA MIDI support might inspire someone to fork Fluidsynth and implement the protocol correctly, and won't give people the mistaken impression that Fluidsynth is currently usable for that purpose.
The current intentionally broken implementation serves as an impediment to that.
You are welcome to use FluidSynth for your purposes if you want. And if you are missing a feature or notice a bug, you are welcome to change the code and propose a fix or new feature. If you can't code and you don't want to learn it, then you can ask politely if someone would be willing to implement the change for you. And if the maintainer of the project doesn't see value in your change, you are welcome to argue your case.
Be constructive, be nice. Then people will continue to share their work with you.