[pulseaudio-discuss] R: New equalizer module (module-eqpro-sink), some questions

Tanu Kaskinen tanuk at iki.fi
Fri Apr 19 09:13:06 UTC 2019

On Tue, 2019-04-16 at 21:40 +0200, Georg Chini wrote:
> On 16.04.19 19:19, Tanu Kaskinen wrote:
> > On Thu, 2019-04-11 at 20:42 +0200, Georg Chini wrote:
> > > On 11.04.19 19:36, Tanu Kaskinen wrote:
> > > > If you want a better plugin standard, are you aware of LV2
> > > > and PipeWire's SPA (the latter doesn't seem to be properly documented
> > > > yet, but to my understanding it's supposed to have a stable and
> > > > flexible API)?
> > > Arun already suggested the pipewire SPA. I took a look, but it
> > > seems not very simple compared to LADSPA. I could not really
> > > understand how it works and it appears to support a lot more
> > > than just filters.
> > LV2 would also be an option, although it too is pretty complex compared
> > to LADSPA. But at least it's documented and has examples.
> I just took a look and on the first glance LV2 seems similar
> to LADSPA. I have to dig into the details though, maybe control
> arrays and interleaved audio ports are possible there.

I'm pretty sure they are possible, but neither of those features are
necessary. If the plugin gets the number of bands during the
initialization, it can create the appropriate number of non-array
control ports. Interleaved audio ports aren't needed either, because
PulseAudio can do the deinterleaving before passing the audio to the
plugin (like module-ladspa-sink already does). If one's going to write
an LV2 plugin, it's best to use standard port types so that all hosts
will be able to use the plugin.

> > > > You say that your extension allows full integration of Andrea's
> > > > equalizer, but I don't see how it allows the host to tell the plugin
> > > > how many channels and how many frequency bands it should initialize.
> > > For an interleaved audio port, there would be another control
> > > port which holds the number of (interleaved) channels. So
> > > this port would allow you to change the number of channels.
> > > You could for example have an audio port named "Input"
> > > and a control port "Number of input channels". Then the
> > > get_info_port() function would return the index of the
> > > "Number of input channels" control when called with the
> > > "Input" port as argument. Or the other way round: If you
> > > set "Number of input channels"  to 6 the plugin will expect
> > > 6 channels in the interleaved audio port (and you know
> > > which control port sets the number of channels because
> > > you can get it via the get_info_port() function.
> > > 
> > > The same applies to the number of bands. There must be a
> > > control port which reflects the number of elements in the
> > > control array which is the same as the number of bands.
> > > 
> > > Both values can be set to convenient defaults if the host does
> > > not supply them (like 5 bands and 2 channels).
> > Ok, so the idea is to do the configuration while the filter is running.
> > I think it would be better to do the configuration in the plugin setup
> > phase. I imagine that would simplify the control port allocoation and
> > management, since the setup doesn't have to run in the IO thread where
> > malloc() is not allowed. I don't see much benefit in doing this kind of
> > configuration while the filter is running, since the filter state most
> > likely has to be reset anyway when the number of EQ bands is changed.
> > 
> > There could be a function for getting a description of what options the
> > plugin accepts, and a setup function for setting the options.
> > 
> Why do you think that the filter must be configured while it is
> running? In case of the equalizer the number of channels and
> also the number of bands are known before the filter is run.
> The LADSPA standard says all control ports must be connected
> (and valid) before you can run the filter. If a parameter changes
> at runtime, the filter must be reset like the current ladspa-sink
> does.

Control ports are used for realtime parameter changes, so that's why I
thought the intention was to set the parameters while the filter is
running. I think it would be much clearer and easier to document the
expected host behaviour if the parameter configuration was not
implemented via control ports.



More information about the pulseaudio-discuss mailing list