summaryrefslogtreecommitdiff
path: root/libs/ardour/lv2_plugin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/lv2_plugin.cc')
-rw-r--r--libs/ardour/lv2_plugin.cc29
1 files changed, 19 insertions, 10 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc
index 4ae1c7b452..fc8630d59b 100644
--- a/libs/ardour/lv2_plugin.cc
+++ b/libs/ardour/lv2_plugin.cc
@@ -1138,8 +1138,20 @@ LV2Plugin::write_from_ui(uint32_t index,
const uint8_t* body)
{
if (!_from_ui) {
- _from_ui = new RingBuffer<uint8_t>(
- _session.engine().raw_buffer_size(DataType::MIDI) * NBUFS);
+ size_t rbs = _session.engine().raw_buffer_size(DataType::MIDI) * NBUFS;
+ /* buffer data communication from plugin UI to plugin instance.
+ * this buffer needs to potentially hold
+ * (port's minimumSize) * (audio-periods) / (UI-periods)
+ * bytes.
+ *
+ * e.g 48kSPS / 128fpp -> audio-periods = 375 Hz
+ * ui-periods = 25 Hz (SuperRapidScreenUpdate)
+ * default minimumSize = 32K (see LV2Plugin::allocate_atom_event_buffers()
+ * -> 15 * 32K
+ * it is safe to overflow (but the plugin state may be inconsistent).
+ */
+ rbs = max((size_t) 32768 * 6, rbs);
+ _from_ui = new RingBuffer<uint8_t>(rbs);
}
if (!write_to(_from_ui, index, protocol, size, body)) {
@@ -1166,8 +1178,10 @@ void
LV2Plugin::enable_ui_emmission()
{
if (!_to_ui) {
- _to_ui = new RingBuffer<uint8_t>(
- _session.engine().raw_buffer_size(DataType::MIDI) * NBUFS);
+ /* see note in LV2Plugin::write_from_ui() */
+ size_t rbs = _session.engine().raw_buffer_size(DataType::MIDI) * NBUFS;
+ rbs = max((size_t) 32768 * 8, rbs);
+ _to_ui = new RingBuffer<uint8_t>(rbs);
}
}
@@ -1355,11 +1369,6 @@ LV2Plugin::describe_parameter(Evoral::Parameter which)
}
if (lilv_port_has_property(_impl->plugin,
- lilv_plugin_get_port_by_index(_impl->plugin, which.id()), _world.lv2_sampleRate)) {
- return X_("hidden");
- }
-
- if (lilv_port_has_property(_impl->plugin,
lilv_plugin_get_port_by_index(_impl->plugin, which.id()), _world.lv2_reportsLatency)) {
return X_("latency");
}
@@ -1902,7 +1911,7 @@ LV2Plugin::Impl::designated_input (const char* uri, void** bufptrs[], void** buf
return port;
}
-static bool lv2_filter (const string& str, void *arg)
+static bool lv2_filter (const string& str, void * /* arg*/)
{
/* Not a dotfile, has a prefix before a period, suffix is "lv2" */