External UI: Load and destroy for at least 2 times
AnClark opened this issue · 2 comments
Hi, falkTX!
There's a bug of external UI support: DISTRHO::UI
instance will initialize and destroy for more than once.
For example, after the initialization of the UI instance, it suddenly destroyed, then re-create.
All of VST2, VST3 and CLAP formats have this issue.
Here's a verbose log of my port of infamousPlugins. The lines prefixed with >> UI ...
are output at the end of constructor and deconstructor of DISTRHO::UI
.
Verbose log of a VST3 plugin instance (with -DDEBUG=1)
dpf_factory::num_classes
dpf_factory::get_class_info => 0 0x7ffe19ea2670
query_interface_factory => 0x35c07f0 {v3_plugin_factory_2} 0x7ffe19ea2658 | OK
dpf_factory::get_class_info_2 => 0 0x7ffe19ea26f0
unref_factory::unref => 0x35c07f0 | refcount 1
dpf_factory::create_instance => 0x35c07f0 {dpf_tuid_class} {v3_component} 0x35c0818
dpf_component() with hostApplication (nil)
dpf_component::initialize => 0x35c1000 0x62f7ac0 | hostApplication 0x62f7ac0
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea24d0
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea24d0
query_interface_component => 0x35c1000 {v3_audio_processor} 0x35c0820 | OK convert (nil)
dpf_audio_processor::get_latency_samples => 0x359d258
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea2470
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea2470
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea2470
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea2470
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea2470
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea2470
dpf_audio_processor::get_bus_arrangement => 0x359d258 V3_INPUT 0 0x35cff10
dpf_audio_processor::get_bus_arrangement => 0x359d258 V3_OUTPUT 0 0x35cff18
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea24d0
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea24d0
query_interface_component => 0x35c1000 {v3_edit_controller} 0x35c0828 | reject unwanted
dpf_component::get_controller_class_id => 0x7ffe19ea26f8
dpf_factory::create_instance => 0x35c07f0 {dpf_tuid_controller} {v3_edit_controller} 0x35c0828
dpf_edit_controller() with hostApplication (nil)
dpf_edit_controller::initialize => 0x35d0ec0 0x62f7ac0 | host 0x62f7ac0
dpf_edit_controller::set_component_handler => 0x35d0ec0 0x62f7ad8
query_interface_component => 0x35c1000 {v3_connection_point_iid} 0x35c08f0 | OK convert (nil)
query_interface_edit_controller => 0x35d0ec0 {v3_connection_point_iid} 0x35c08f8 | OK convert (nil)
dpf_comp2ctrl_connection_point::connect => 0x359d260 0x35d0f80
dpf_comp2ctrl_connection_point::connect => 0x35d0f80 0x359d260
query_interface_edit_controller => 0x35d0ec0 {v3_midi_mapping_iid} 0x35c0bf0 | OK convert static
query_interface_edit_controller => 0x35d0ec0 {0x6B2449CC,0x419740B5,0xAB3C79DA,0xC5FE5C86} 0x35c0c00 | WARNING UNSUPPORTED
query_interface_edit_controller => 0x35d0ec0 {v3_edit_controller_note_expression_controller|NOT} 0x35c0be0 | WARNING UNSUPPORTED
query_interface_edit_controller => 0x35d0ec0 {0x1F2F76D3,0xBFFB4B96,0xB99527A5,0x5EBCCEF4} 0x35c0be8 | WARNING UNSUPPORTED
query_interface_edit_controller => 0x35d0ec0 {v3_unit_info|NOT} 0x35c0bf8 | WARNING UNSUPPORTED
dpf_component::get_state => 0x35c1000 0x10ddd80
dpf_edit_controller::set_component_state => 0x35d0ec0 0x10ddd80
found state 'Default' ''
found parameter 'CHANNEL' '0'
found parameter 'MASTER_GAIN' '1'
found parameter 'RULE' '30'
found parameter 'CELL_LIFE' '0.25'
found parameter 'INIT_CELLS' '1'
found parameter 'NHARMONICS' '12'
found parameter 'HARM_MODE' '1'
found parameter 'HARM_WIDTH' '0'
found parameter 'WAVE' '0'
found parameter 'ENV_A' '0.10000000149'
found parameter 'ENV_D' '0.10000000149'
found parameter 'ENV_B' '0.5'
found parameter 'ENV_SWL' '3'
found parameter 'ENV_SUS' '0.75'
found parameter 'ENV_R' '0.10000000149'
found parameter 'AMOD_WAV' '0'
found parameter 'AMOD_FREQ' '0'
found parameter 'AMOD_GAIN' '0.10000000149'
found parameter 'FMOD_WAV' '0'
found parameter 'FMOD_FREQ' '0'
found parameter 'FMOD_GAIN' '0.10000000149'
query_interface_edit_controller => 0x35d0ec0 {0x31E29A7A,0xE55043AD,0x8B95B9B8,0xDA1FBE1E} 0x7ffe19ea2660 | WARNING UNSUPPORTED
query_interface_edit_controller => 0x35d0ec0 {0xC3B17BC0,0x2C174494,0x80293402,0xFBC4BBF8} 0x7ffe19ea2658 | WARNING UNSUPPORTED
query_interface_edit_controller => 0x35d0ec0 {v3_info_listener|NOT} 0x7ffe19ea2668 | WARNING UNSUPPORTED
dpf_factory::get_class_info => 0 0x7ffe19ea0490
dpf_factory::get_factory_info => 0x7ffe19ea0490
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea0210
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea0210
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea0210
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea0210
dpf_audio_processor::get_bus_arrangement => 0x359d258 V3_INPUT 0 0x35cff10
dpf_audio_processor::get_bus_arrangement => 0x359d258 V3_OUTPUT 0 0x35cff18
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea0270
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea0270
query_interface_edit_controller => 0x35d0ec0 {0x049BF9E7,0xBC74EAD0,0xC4101E86,0x7F725981} 0x7ffe19ea0460 | WARNING UNSUPPORTED
dpf_audio_processor::get_latency_samples => 0x359d258
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea0670
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea0670
dpf_audio_processor::setup_processing => 0x359d258 0x7ffe19ea0440
dpf_audio_processor::setup_processing => 0x359d258 0x7ffe19ea0440 | 512 48000.000000
dpf_component::set_active => 0x35c1000 1
dpf_audio_processor::set_processing => 0x359d258 1
dpf_audio_processor::get_latency_samples => 0x359d258
dpf_audio_processor::get_tail_samples => 0x359d258
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea2780
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea2780
dpf_factory::get_class_info => 0 0x7ffe19ea2650
dpf_component::get_state => 0x35c1000 0x10ddd80
dpf_edit_controller::get_state => 0x35d0ec0 0x10ddd80
dpf_component::set_state => 0x35c1000
found state 'Default' ''
found parameter 'CHANNEL' '0'
found parameter 'MASTER_GAIN' '1'
found parameter 'RULE' '30'
found parameter 'CELL_LIFE' '0.25'
found parameter 'INIT_CELLS' '1'
found parameter 'NHARMONICS' '12'
found parameter 'HARM_MODE' '1'
found parameter 'HARM_WIDTH' '0'
found parameter 'WAVE' '0'
found parameter 'ENV_A' '0.10000000149'
found parameter 'ENV_D' '0.10000000149'
found parameter 'ENV_B' '0.5'
found parameter 'ENV_SWL' '3'
found parameter 'ENV_SUS' '0.75'
found parameter 'ENV_R' '0.10000000149'
found parameter 'AMOD_WAV' '0'
found parameter 'AMOD_FREQ' '0'
found parameter 'AMOD_GAIN' '0.10000000149'
found parameter 'FMOD_WAV' '0'
found parameter 'FMOD_FREQ' '0'
found parameter 'FMOD_GAIN' '0.10000000149'
dpf_edit_controller::set_component_state => 0x35d0ec0 0x10ddd80
found state 'Default' ''
found parameter 'CHANNEL' '0'
found parameter 'MASTER_GAIN' '1'
found parameter 'RULE' '30'
found parameter 'CELL_LIFE' '0.25'
found parameter 'INIT_CELLS' '1'
found parameter 'NHARMONICS' '12'
found parameter 'HARM_MODE' '1'
found parameter 'HARM_WIDTH' '0'
found parameter 'WAVE' '0'
found parameter 'ENV_A' '0.10000000149'
found parameter 'ENV_D' '0.10000000149'
found parameter 'ENV_B' '0.5'
found parameter 'ENV_SWL' '3'
found parameter 'ENV_SUS' '0.75'
found parameter 'ENV_R' '0.10000000149'
found parameter 'AMOD_WAV' '0'
found parameter 'AMOD_FREQ' '0'
found parameter 'AMOD_GAIN' '0.10000000149'
found parameter 'FMOD_WAV' '0'
found parameter 'FMOD_FREQ' '0'
found parameter 'FMOD_GAIN' '0.10000000149'
dpf_edit_controller::set_state => 0x35d0ec0 0x10ddd80
dpf_audio_processor::set_processing => 0x359d258 0
dpf_audio_processor::get_latency_samples => 0x359d258
dpf_component::set_active => 0x35c1000 0
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea4bc0
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea4bc0
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea4bc0
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea4bc0
dpf_audio_processor::get_bus_arrangement => 0x359d258 V3_INPUT 0 0x35cff10
dpf_audio_processor::get_bus_arrangement => 0x359d258 V3_OUTPUT 0 0x35cff18
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea4c20
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea4c20
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea4bc0
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea4bc0
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea4bc0
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea4bc0
dpf_audio_processor::get_bus_arrangement => 0x359d258 V3_INPUT 0 0x35cff10
dpf_audio_processor::get_bus_arrangement => 0x359d258 V3_OUTPUT 0 0x35cff18
dpf_audio_processor::set_bus_arrangements => 0x359d258 0x35cff10 1 0x35cff18 1
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea4c20
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea4c20
dpf_audio_processor::get_latency_samples => 0x359d258
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_INPUT 0 0x7ffe19ea5020
dpf_component::get_bus_info => 0x35c1000 V3_AUDIO V3_OUTPUT 0 0x7ffe19ea5020
dpf_component::set_active => 0x35c1000 1
dpf_audio_processor::set_processing => 0x359d258 1
dpf_audio_processor::get_latency_samples => 0x359d258
dpf_factory::get_class_info => 0 0x7ffe19ea6e20
dpf_factory::get_class_info => 0 0x7ffe19eb1310
dpf_factory::get_factory_info => 0x7ffe19eb15f0
dpf_factory::get_class_info => 0 0x7ffe19eb1570
dpf_edit_controller::create_view => 0x35d0ec0 editor
create_view has contexts (nil) 0x62f7ac0
dpf_edit_controller::create_view => 0x35d0ec0 editor | edit-ctrl 0x62f7ac0, factory (nil)
dpf_plugin_view() with hostApplication 0x62f7ac0
query_interface_view => 0x359b900 {v3_connection_point_iid} 0x7ffe19eb4968 | OK convert (nil)
view connection query ok 0x5fc2010
UI|dpf_ui_connection_point::connect => 0x5fc2010 0x35d0f78
dpf_ctrl2view_connection_point::connect => 0x35d0f78 0x5fc2010
dpf_plugin_view::set_frame => 0x359b900 0x699ff30
dpf_plugin_view::get_size => 0x359b900
dpf_plugin_view::get_size => 0x359b900 | NOTE: size request before attach
>> UI loaded.
>> UI destroyed.
query_interface_view => 0x359b900 {v3_plugin_view_content_scale_iid} 0x7ffe19eb49c0 | OK convert (nil)
dpf_plugin_view::check_size_constraint => 0x359b900 {0,0,460,600}
dpf_plugin_view::on_size => 0x359b900 {0,0,460,600}
dpf_plugin_view::is_platform_type_supported => 0x359b900 X11EmbedWindowID
dpf_plugin_view::attached => 0x359b900 0xc001a7 X11EmbedWindowID
>> UI loaded.
requesting current plugin state
dpf_plugin_view::get_size => 0x359b900
getSize request returning 460 600
query_interface_view => 0x359b900 {v3_plugin_view_content_scale_iid} 0x7ffe19eb49c0 | OK convert 0x6c88690
dpf_plugin_view::set_content_scale_factor => 0x5fc2018 1.000000
dpf_plugin_view::get_size => 0x359b900
getSize request returning 460 600
dpf_plugin_view::get_size => 0x359b900
getSize request returning 460 600
dpf_plugin_view::get_size => 0x359b900
getSize request returning 460 600
dpf_plugin_view::get_size => 0x359b900
getSize request returning 460 600
dpf_plugin_view::get_size => 0x359b900
getSize request returning 460 600
dpf_plugin_view::check_size_constraint => 0x359b900 {0,0,460,600}
applyGeometryConstraints 0 0 0 {0,0,460,600} | BEFORE
applyGeometryConstraints 0 0 0 {0,0,460,600} | AFTER
dpf_plugin_view::on_size => 0x359b900 {0,0,460,600}
host->plugin onSize request 460 600 (OK)
dpf_plugin_view::get_size => 0x359b900
getSize request returning 460 600
dpf_plugin_view::check_size_constraint => 0x359b900 {0,0,460,600}
applyGeometryConstraints 0 0 0 {0,0,460,600} | BEFORE
applyGeometryConstraints 0 0 0 {0,0,460,600} | AFTER
dpf_plugin_view::on_size => 0x359b900 {0,0,460,600}
host->plugin onSize request 460 600 (OK)
first resize forced behaviour is now stopped
was resizing from host, now stopped
This is normal, for some formats we need to temporarily create a UI in order to know its size and pass this info into the host.
Not a bug but a feature.
You can define some macros so DPF can skip this intermediary UI step https://distrho.github.io/DPF/group__PluginMacros.html#ga93240ccad789419d3c26768d00f2e97f
Thanks a lot!