[LV2] Configurable channels for LV2 plugins

David Robillard d at drobilla.net
Sun Mar 24 11:24:45 PDT 2013

On Sun, 2013-03-24 at 16:14 +0000, Harry van Haaren wrote:
> Hi everybody,
> I've been thinking a bit about how to let the host decide how many channels
> a plugin should handle.
> Reading around, the port-groups extension seems designed to describe the
> audio I/O formats.

Yep, property wise we already have almost everything needed to describe

> Setting the port group type could be done using the Options interface.
> We'd need to make an extension like "instance-port-configuration" (but a
> better shorter name)
> http://lv2plug.in/ns/ext/pluginPortConfiguration"
> What I'd imagine the "running order" of a host wanting to set up a stereo
> plugin (an supports options):
> -plugin is tagged with opts:requiredOption pluginPortConfiguration:atSetup
> -plugin lists pg:monoGroup and pg:stereoGroup as understood types.
> -host passes "options" LV2_Feature to plugin,
> -plugin iters over the provided "options" and finds one with the Key field
> Plugin interprets "option":
> -context LV2_OPTIONS_INSTANCE, so ignores subject
> -subject 0
> -key URID mapped PLUGIN_PORT_CONFIGURATION, (how this option was identified
> as the configure option by plugin)
> -size 0
> -type URID mapped pg:stereoGroup.
> -value pointer 0

The problem with this is it can only set *one* channel configuration for
the instance.  For example it couldn't configure a plugin to mono in,
stereo out, or stereo in + mono out, etc.

For this reason, it probably has to be per-port, or per-group, not a
single per-instance option.

> Issues I've not resolved / don't know how to deal with:
> -the plugin must change the amount of ports that it connects, dynamic
> manifest? Its supported by very few hosts..
> -always expose the max channel count the plugin can process (say 5.1: 6
> channels) but only process the ones as per the pg:stereoGroup?

This is probably a very large problem.  Variable number of ports we
don't have, and if we did, there'd be nowhere to describe them.  It
jumps off the deep end of fully dynamic plugin data, which we may get to
some day, but is a very big undertaking.  dyn-manifest is not designed
for run-time changes.

It would be much easier to create a new 'port' type that's really a
group, and can be configured.  Things would work as you described, but
you'd configure the group(s) individually.  I guess the buffer type
could be an array of pointers to buffers?

See my recent reply to Julien Pommier's thread "multiple channel
configurations in lv2 plugin" about this.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.lv2plug.in/pipermail/devel-lv2plug.in/attachments/20130324/5cabc15e/attachment-0002.pgp>

More information about the Devel mailing list