From 16bde0c61dd7ce9c122e2cceb699dd899f03bf89 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 12 Mar 2026 16:01:52 +0100 Subject: [PATCH] filter-graph: set some more def/min/max for control input So that the values don't get clamped to 0.0 --- spa/plugins/filter-graph/plugin_builtin.c | 9 ++++++++- spa/plugins/filter-graph/plugin_ebur128.c | 1 + spa/plugins/filter-graph/plugin_onnx.c | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/spa/plugins/filter-graph/plugin_builtin.c b/spa/plugins/filter-graph/plugin_builtin.c index f3a0a0946..3c15673db 100644 --- a/spa/plugins/filter-graph/plugin_builtin.c +++ b/spa/plugins/filter-graph/plugin_builtin.c @@ -1467,6 +1467,7 @@ static struct spa_fga_port clamp_ports[] = { { .index = 3, .name = "Control", .flags = SPA_FGA_PORT_INPUT | SPA_FGA_PORT_CONTROL, + .def = 0.0f, .min = -FLT_MAX, .max = FLT_MAX }, { .index = 4, .name = "Min", @@ -1524,6 +1525,7 @@ static struct spa_fga_port linear_ports[] = { { .index = 3, .name = "Control", .flags = SPA_FGA_PORT_INPUT | SPA_FGA_PORT_CONTROL, + .def = 0.0f, .min = -FLT_MAX, .max = FLT_MAX }, { .index = 4, .name = "Mult", @@ -1591,6 +1593,7 @@ static struct spa_fga_port recip_ports[] = { { .index = 3, .name = "Control", .flags = SPA_FGA_PORT_INPUT | SPA_FGA_PORT_CONTROL, + .def = 0.0f, .min = -FLT_MAX, .max = FLT_MAX }, }; @@ -1640,6 +1643,7 @@ static struct spa_fga_port exp_ports[] = { { .index = 3, .name = "Control", .flags = SPA_FGA_PORT_INPUT | SPA_FGA_PORT_CONTROL, + .def = 0.0f, .min = -FLT_MAX, .max = FLT_MAX }, { .index = 4, .name = "Base", @@ -1697,6 +1701,7 @@ static struct spa_fga_port log_ports[] = { { .index = 3, .name = "Control", .flags = SPA_FGA_PORT_INPUT | SPA_FGA_PORT_CONTROL, + .def = 0.0f, .min = -FLT_MAX, .max = FLT_MAX }, { .index = 4, .name = "Base", @@ -2660,6 +2665,7 @@ static struct spa_fga_port debug_ports[] = { { .index = 2, .name = "Control", .flags = SPA_FGA_PORT_INPUT | SPA_FGA_PORT_CONTROL, + .def = 0.0f, .min = -FLT_MAX, .max = FLT_MAX }, { .index = 3, .name = "Notify", @@ -3006,7 +3012,7 @@ static struct spa_fga_port noisegate_ports[] = { { .index = 2, .name = "Level", .flags = SPA_FGA_PORT_INPUT | SPA_FGA_PORT_CONTROL, - .def = NAN + .def = NAN, .min = -FLT_MAX, .max = FLT_MAX }, { .index = 3, .name = "Open Threshold", @@ -3247,6 +3253,7 @@ static struct spa_fga_port null_ports[] = { { .index = 1, .name = "Control", .flags = SPA_FGA_PORT_INPUT | SPA_FGA_PORT_CONTROL, + .def = 0.0f, .min = -FLT_MAX, .max = FLT_MAX }, }; diff --git a/spa/plugins/filter-graph/plugin_ebur128.c b/spa/plugins/filter-graph/plugin_ebur128.c index fb79de590..02fbcbe53 100644 --- a/spa/plugins/filter-graph/plugin_ebur128.c +++ b/spa/plugins/filter-graph/plugin_ebur128.c @@ -399,6 +399,7 @@ static struct spa_fga_port lufs2gain_ports[] = { { .index = 0, .name = "LUFS", .flags = SPA_FGA_PORT_INPUT | SPA_FGA_PORT_CONTROL, + .def = 0.0f, .min = 0.0f, .max = FLT_MAX }, { .index = 1, .name = "Gain", diff --git a/spa/plugins/filter-graph/plugin_onnx.c b/spa/plugins/filter-graph/plugin_onnx.c index 3ef12e963..13fccee56 100644 --- a/spa/plugins/filter-graph/plugin_onnx.c +++ b/spa/plugins/filter-graph/plugin_onnx.c @@ -593,6 +593,10 @@ static const struct spa_fga_descriptor *onnx_plugin_make_desc(void *plugin, cons fp->flags |= SPA_FGA_PORT_OUTPUT; fp->name = ti->data_name; + fp->min = -FLT_MAX; + fp->max = FLT_MAX; + fp->def = 0.0f; + ti->data_index = desc->desc.n_ports; desc->desc.n_ports++;