<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 27.05.20 12:12, Robert Bielik wrote:<br>
</div>
<blockquote type="cite"
cite="mid:AM5PR0201MB22897087DDF5C6D9C749AFD3FAB10@AM5PR0201MB2289.eurprd02.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Oh, forgot to mention,
I’m running pulseaudio 12.2 on a Raspberry Pi Model 3.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span
style="mso-fareast-language:#2000" lang="EN-US">From:</span></b><span
style="mso-fareast-language:#2000" lang="EN-US">
pulseaudio-discuss
<a class="moz-txt-link-rfc2396E" href="mailto:pulseaudio-discuss-bounces@lists.freedesktop.org"><pulseaudio-discuss-bounces@lists.freedesktop.org></a>
<b>On Behalf Of </b>Robert Bielik<br>
<b>Sent:</b> Wednesday, 27 May 2020 12:10<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:pulseaudio-discuss@lists.freedesktop.org">pulseaudio-discuss@lists.freedesktop.org</a><br>
<b>Subject:</b> [pulseaudio-discuss] LADSPA plugin
strange behavior<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">Hi all,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Isn’t the stream to the
plugin supposed to be continuous? Can the pulseaudio server
be configured not to do this ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">/Robert<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</blockquote>
This behavior is caused by rewinding. Basically, rewinding is used
to ensure that<br>
a new stream is heard immediately. Consider a stream running with a
large<br>
latency of let's say 500 ms. This means, that PA has already
processed 500 ms<br>
more audio than has been played. When a new stream is added, it
would normally<br>
take half a second before the new stream is audible. To avoid this,
PA will roll back<br>
the latency of the old stream as far as possible and then add the
new stream.<br>
<br>
For a filter this means, that it has to process audio that already
passed through<br>
the filter. This can lead to distortions. In an ideal case, the
filter would be able<br>
to rewind to the state which matches the point in time where the
stream is picked<br>
up again. This is however not possible, so PA resets the filter in
the hope that this<br>
has less impact than simply running the same audio through the
filter again.<br>
<br>
For me, the concept of rewinding was difficult to understand, so I
hope the explanation<br>
is understandable. The correct solution here is to avoid rewinding
completely for<br>
the LADSPA sink and limit the latency to some small value. I have
patches that do<br>
exactly that, but they depend on lots of other patches that are
still not reviewed.<br>
<br>
For the moment I guess you have to live with that behavior (or you
could patch the<br>
LADSPA sink not to reset the filter and see if this gives better
results).<br>
</body>
</html>