[pulseaudio-discuss] LADSPA plugin strange behavior
georg at chini.tk
Thu May 28 07:03:01 UTC 2020
On 27.05.20 12:12, Robert Bielik wrote:
> Oh, forgot to mention, I’m running pulseaudio 12.2 on a Raspberry Pi
> Model 3.
> <pulseaudio-discuss-bounces at lists.freedesktop.org> *On Behalf Of
> *Robert Bielik
> *Sent:* Wednesday, 27 May 2020 12:10
> *To:* pulseaudio-discuss at lists.freedesktop.org
> *Subject:* [pulseaudio-discuss] LADSPA plugin strange behavior
> Hi all,
> New to the list. I’m setting up a system where I have a
> post-processing LADSPA plugin. I’ve setup /etc/pulse/default.pa to
> load my LADSPA plugin and to set it as the default sink.
> Running pulseaudio with “pulseaudio 2>&1” I can see all the logs from
> my plugin, with it being properly initialized upon start of pulseaudio
> server, and deinitialized when shutting down the server.
> But, there is a strange behavior. Running one audio stream with aplay
> f.i., and then starting another one with paplay f.i., I can see that
> the pulseaudio server deactivates, and re-activates the plugin. This
> it does for any stream started AND stopped.
> Isn’t the stream to the plugin supposed to be continuous? Can the
> pulseaudio server be configured not to do this ?
This behavior is caused by rewinding. Basically, rewinding is used to
a new stream is heard immediately. Consider a stream running with a large
latency of let's say 500 ms. This means, that PA has already processed
more audio than has been played. When a new stream is added, it would
take half a second before the new stream is audible. To avoid this, PA
will roll back
the latency of the old stream as far as possible and then add the new
For a filter this means, that it has to process audio that already
the filter. This can lead to distortions. In an ideal case, the filter
would be able
to rewind to the state which matches the point in time where the stream
up again. This is however not possible, so PA resets the filter in the
hope that this
has less impact than simply running the same audio through the filter again.
For me, the concept of rewinding was difficult to understand, so I hope
is understandable. The correct solution here is to avoid rewinding
the LADSPA sink and limit the latency to some small value. I have
patches that do
exactly that, but they depend on lots of other patches that are still
For the moment I guess you have to live with that behavior (or you could
LADSPA sink not to reset the filter and see if this gives better results).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pulseaudio-discuss