summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-06-08 21:41:07 +0000
committerDavid Robillard <d@drobilla.net>2013-06-08 21:41:07 +0000
commit1b38fdcc778ca6b82efc549243d4312645441c50 (patch)
treee398816aa57963654a73a93ff4d65a05776c0d37 /src/server
parent29eb3c251811e4f34b95312c75e9c6510df5a6c3 (diff)
downloadingen-1b38fdcc778ca6b82efc549243d4312645441c50.tar.gz
ingen-1b38fdcc778ca6b82efc549243d4312645441c50.tar.bz2
ingen-1b38fdcc778ca6b82efc549243d4312645441c50.zip
Specify rsz:minimumSize for main control ports.
Fix running as an LV2 plugin at very low block sizes. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5128 a436a847-0d15-0410-975c-d299462d15a1
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) {