aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--src/jack.c3
-rw-r--r--src/jalv.c8
-rw-r--r--src/port.h19
4 files changed, 21 insertions, 12 deletions
diff --git a/NEWS b/NEWS
index cebc20c..a6f46d1 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ jalv (1.6.9) unstable; urgency=medium
* Clean up command line help output
* Fix clashing command line options
* Fix minor memory leaks
+ * Reduce Jack process callback overhead
* Remove Gtk2 interface
* Replace use of deprecated Gtk interfaces
* Switch to external zix dependency
@@ -15,7 +16,7 @@ jalv (1.6.9) unstable; urgency=medium
* Use fewer platform-specific APIs
* Use portable zix filesystem API
- -- David Robillard <d@drobilla.net> Thu, 14 Nov 2024 18:26:43 +0000
+ -- David Robillard <d@drobilla.net> Fri, 15 Nov 2024 16:53:31 +0000
jalv (1.6.8) stable; urgency=medium
diff --git a/src/jack.c b/src/jack.c
index fd7a6f1..7971987 100644
--- a/src/jack.c
+++ b/src/jack.c
@@ -202,8 +202,7 @@ jack_process_cb(jack_nframes_t nframes, void* data)
for (uint32_t p = 0; p < jalv->num_ports; ++p) {
struct Port* const port = &jalv->ports[p];
if (port->flow == FLOW_OUTPUT && port->type == TYPE_CONTROL &&
- lilv_port_has_property(
- jalv->plugin, port->lilv_port, jalv->nodes.lv2_reportsLatency)) {
+ port->reports_latency) {
if (jalv->plugin_latency != port->control) {
jalv->plugin_latency = port->control;
jack_recompute_total_latencies(client);
diff --git a/src/jalv.c b/src/jalv.c
index bb40963..23a3698 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -210,6 +210,7 @@ create_port(Jalv* jalv, uint32_t port_index, float default_value)
die("Mandatory port has unknown data type");
}
+ // Set buffer size
LilvNode* min_size =
lilv_port_get(jalv->plugin, port->lilv_port, jalv->nodes.rsz_minimumSize);
if (min_size && lilv_node_is_int(min_size)) {
@@ -218,6 +219,13 @@ create_port(Jalv* jalv, uint32_t port_index, float default_value)
MAX(jalv->opts.buffer_size, port->buf_size * N_BUFFER_CYCLES);
}
lilv_node_free(min_size);
+
+ // Set reports_latency flag
+ if (port->flow == FLOW_OUTPUT && port->type == TYPE_CONTROL &&
+ lilv_port_has_property(
+ jalv->plugin, port->lilv_port, jalv->nodes.lv2_reportsLatency)) {
+ port->reports_latency = true;
+ }
}
/// Create port structures from data (via create_port()) for all ports
diff --git a/src/port.h b/src/port.h
index 5b3e0c9..7ca80b1 100644
--- a/src/port.h
+++ b/src/port.h
@@ -19,15 +19,16 @@ enum PortFlow { FLOW_UNKNOWN, FLOW_INPUT, FLOW_OUTPUT };
enum PortType { TYPE_UNKNOWN, TYPE_CONTROL, TYPE_AUDIO, TYPE_EVENT, TYPE_CV };
struct Port {
- const LilvPort* lilv_port; ///< LV2 port
- enum PortType type; ///< Data type
- enum PortFlow flow; ///< Data flow direction
- void* sys_port; ///< For audio/MIDI ports, otherwise NULL
- LV2_Evbuf* evbuf; ///< For MIDI ports, otherwise NULL
- void* widget; ///< Control widget, if applicable
- size_t buf_size; ///< Custom buffer size, or 0
- uint32_t index; ///< Port index
- float control; ///< For control ports, otherwise 0.0f
+ const LilvPort* lilv_port; ///< LV2 port
+ enum PortType type; ///< Data type
+ enum PortFlow flow; ///< Data flow direction
+ void* sys_port; ///< For audio/MIDI ports, otherwise NULL
+ LV2_Evbuf* evbuf; ///< For MIDI ports, otherwise NULL
+ void* widget; ///< Control widget, if applicable
+ size_t buf_size; ///< Custom buffer size, or 0
+ uint32_t index; ///< Port index
+ float control; ///< For control ports, otherwise 0.0f
+ bool reports_latency; ///< For control port outputs
};
JALV_END_DECLS