[Ardour-Dev] [Ardour-dev] LXVST support
ace17 at free.fr
ace17 at free.fr
Tue Jul 24 23:43:53 PDT 2012
Hi all,
I'm writing a GNU/Linux native VST plugin (https://launchpad.net/acevirus/), and I want to use it with ardour3 (r13075).
For reasons of compatibility with other hosts, I'm invoking the audioMasterWantMidi from the plugin's effOpen callback.
Here's how ardour3 currently handles audioMasterWantMidi :
108| case audioMasterWantMidi:
109| SHOW_CALLBACK ("amc: audioMasterWantMidi\n");
110| // <value> is a filter which is currently ignored
111| if (plug) {
112+> plug->get_info()->n_inputs.set_midi (1);
113| }
114| return 0;
Here's the call stack :
#4 0x00007ffff76e3ae7 in ARDOUR::Session::vst_callback (effect=0x7fffdfd9f488, opcode=6, index=0, value=1, ptr=0x0, opt=0) at ../libs/ardour/session_vst.cc:112
#5 0x00007fffbd07f1a2 in EVEREST::PluginWrapper::Dispatcher (this=0x7fffdfd9f460, eRequest=VST_CMD_SETSAMPLERATE, iParam1=0, iParam2=0, pData=0x0, fParam=44100) at ../../lib_everest/plugin_wrapper.cpp:377
#6 0x00007fffbd07ff71 in EVEREST::PluginWrapper::static_dispatcher (pVstInterface=0x7fffdfd9f488, a=10, b=0, c=0, d=0x0, e=44100) at ../../lib_everest/plugin_wrapper.h:71
#7 0x00007ffff76e4551 in ARDOUR::VSTPlugin::set_plugin (this=0x7fffb03c43f0, e=0x7fffdfd9f488) at ../libs/ardour/vst_plugin.cc:64
#8 0x00007ffff76e0e16 in ARDOUR::LXVSTPlugin::LXVSTPlugin (this=0x7fffb03c43f0, e=..., session=..., h=0x7fffb0263110) at ../libs/ardour/lxvst_plugin.cc:39
#9 0x00007ffff76e11ad in ARDOUR::LXVSTPluginInfo::load (this=0x2b41170, session=...) at ../libs/ardour/lxvst_plugin.cc:75
FYI, EVEREST is the name of the VST SDK I wrote (loosely based on Vestige).
At this point, get_info() returns a null pointer, because we're still in the call stack of LXVSTPlugin's constructor, and set_info() will be called later from LXVSTPluginInfo::load.
So I tried to call audioMasterWantMidi from effSetSampleRate instead of effOpen, but it's still the same. Actually, effOpen and effSetSampleRate are both called before set_info().
I don't really know who is a fault here : maybe I'm supposed not to call any audioMasterX from effSetSampleRate or effOpen (Anyway, I think the host should protect itself from this).
But maybe it's an error to call set_info so late, or to call effOpen so early.
What do you think?
Cheers
Sebastien Alaiwan
More information about the Ardour-Dev
mailing list