<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - pa_simple_get_latency() reports latency inaccurately"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=81075#c18">Comment # 18</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - pa_simple_get_latency() reports latency inaccurately"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=81075">bug 81075</a>
              from <span class="vcard"><a class="email" href="mailto:tanuk@iki.fi" title="Tanu Kaskinen <tanuk@iki.fi>"> <span class="fn">Tanu Kaskinen</span></a>
</span></b>
        <pre>With the full API you can get the negative latencies in your application, yes,
but I'm not sure if that's any more "right", unless you're recording from
monitor sources that really can have negative latencies (negative latency means
"seeing in the future", and with monitor sources that's possible, because you
may sometimes get the audio to your application before the sound goes to the
speakers).

If you're not using a monitor source, a negative latency means that there's a
bug in PulseAudio. I think my patch is ok, even though changing negative
latencies to zero makes the latency calculations jumpy. The root cause seems to
be in pa_stream_get_latency(), more specifically in the smoother that estimates
how much audio has been played in total based on the current time and the past
timing information updates from the server. The smoother is consistently
estimating the played amount to be too low, and that makes the calculated
latency negative.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>