summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/Engine.cpp3
-rw-r--r--src/server/ingen_lv2.cpp17
2 files changed, 16 insertions, 4 deletions
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index 755e0d65..5c36f5c2 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -232,6 +232,9 @@ Engine::activate()
control_properties.insert(
make_pair(uris.atom_bufferType,
Resource::Property(uris.atom_Sequence)));
+ control_properties.insert(
+ make_pair(uris.rsz_minimumSize,
+ forge.make(4096)));
// Add control input
Resource::Properties in_properties(control_properties);
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index 0f3c2092..6f50847b 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -87,6 +87,12 @@ class LV2Driver;
void signal_main(ProcessContext& context, LV2Driver* driver);
+inline size_t
+ui_ring_size(SampleCount block_length)
+{
+ return std::max((size_t)8192, (size_t)block_length * 16);
+}
+
class LV2Driver : public Ingen::Server::Driver
, public Ingen::AtomSink
{
@@ -102,8 +108,8 @@ public:
, _writer(engine.world()->uri_map(),
engine.world()->uris(),
*this)
- , _from_ui(block_length * sizeof(float)) // FIXME: size
- , _to_ui(block_length * sizeof(float)) // FIXME: size
+ , _from_ui(ui_ring_size(block_length))
+ , _to_ui(ui_ring_size(block_length))
, _root_graph(NULL)
, _notify_capacity(0)
, _block_length(block_length)
@@ -337,7 +343,9 @@ public:
break;
}
- if (seq->atom.size + sizeof(LV2_Atom) + atom.size > _notify_capacity) {
+ if (seq->atom.size + lv2_atom_pad_size(
+ sizeof(LV2_Atom_Event) + atom.size)
+ > _notify_capacity) {
break; // Output port buffer full, resume next time
}
@@ -354,7 +362,8 @@ public:
}
read += lv2_atom_total_size(&ev->body);
- seq->atom.size += sizeof(LV2_Atom_Event) + ev->body.size;
+ seq->atom.size += lv2_atom_pad_size(
+ sizeof(LV2_Atom_Event) + ev->body.size);
}
if (_to_ui_overflow) {