Port to fluidsynth 2.0.0 API

Authored by tommo on Jan 10 2020, 12:09 PM.



This includes necessary adaptations for fluidsynth 2.0. All changes are backward-compatible to fluidsynth 1.1. For details, see:


Diff Detail

R163 Minuet
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
tommo created this revision.Jan 10 2020, 12:09 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptJan 10 2020, 12:09 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
tommo requested review of this revision.Jan 10 2020, 12:09 PM
aacid added a subscriber: aacid.Jan 10 2020, 11:37 PM

Just to be clear, you're saying that this will compile and work both with fluidsynth 2.0 and fluidsynth 1.1, right?

aacid added a comment.Jan 16 2020, 9:51 PM

If i add this patch it crashes just starting the app for me

It seems to me like an if guarding that call would be a good idea?

Doesn't it crash for you?

#0 0x00007fffeae79c87 in fluid_sequencer_unregister_client () from /usr/lib/libfluidsynth.so.2
#1 0x00007fffeb36ffb9 in FluidSynthSoundController::deleteEngine (this=0x5555556e4e50) at /home/tsdgeos/devel/kde/minuet/src/plugins/fluidsynthsoundcontroller/fluidsynthsoundcontroller.cpp:249
#2 0x00007fffeb36fd9e in FluidSynthSoundController::resetEngine (this=0x5555556e4e50) at /home/tsdgeos/devel/kde/minuet/src/plugins/fluidsynthsoundcontroller/fluidsynthsoundcontroller.cpp:221
#3 0x00007fffeb36e9ee in FluidSynthSoundController::FluidSynthSoundController (this=0x5555556e4e50, parent=0x0) at /home/tsdgeos/devel/kde/minuet/src/plugins/fluidsynthsoundcontroller/fluidsynthsoundcontroller.cpp:62
#4 0x00007fffeb36e169 in qt_plugin_instance () at /home/tsdgeos/devel/kde/minuet/build/src/plugins/fluidsynthsoundcontroller/minuetfluidsynthsoundcontroller_autogen/EWIEGA46WW/moc_fluidsynthsoundcontroller.cpp:683
#5 0x00007ffff619ee3b in QPluginLoader::instance() () from /usr/lib/libQt5Core.so.5
#6 0x000055555555f970 in Minuet::PluginController::initialize (this=0x5555556d7920, core=0x5555556d78e0) at /home/tsdgeos/devel/kde/minuet/src/app/plugincontroller.cpp:77
#7 0x000055555555d10c in Minuet::Core::Core (this=0x5555556d78e0, parent=0x0) at /home/tsdgeos/devel/kde/minuet/src/app/core.cpp:87
#8 0x000055555555cf8e in Minuet::Core::initialize () at /home/tsdgeos/devel/kde/minuet/src/app/core.cpp:49
#9 0x000055555555c81d in main (argc=1, argv=0x7fffffffdbb8) at /home/tsdgeos/devel/kde/minuet/src/app/main.cpp:71

tommo updated this revision to Diff 73745.Jan 17 2020, 8:27 AM

You're right. Sorry. I had an orphaned fluidsynth install in /usr/local/ which caused the wrong .so to be used at runtime.

Also, it turns out that explicit sequencer client unregistering causes a double free in fluidsynth 1.1.11. So I only do this for version 2 and newer.

aacid accepted this revision.Jan 17 2020, 11:30 PM

ok, this looks better thanks :)

Commiting to master in a minute

This revision is now accepted and ready to land.Jan 17 2020, 11:30 PM
This revision was automatically updated to reflect the committed changes.

What consequence is there for using minuet with fluidsynth-2 without this patch? So far it had built and linked to it without issues.

tommo added a comment.EditedJan 20 2020, 4:35 PM

Reverb and chorus would remain active and you would leak memory. For details, see the link I mentioned above.