[pulseaudio-tickets] [Bug 54007] New: The alsa sink does larger rewind than needed when the configured sink latency changes

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Aug 24 06:43:56 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=54007

             Bug #: 54007
           Summary: The alsa sink does larger rewind than needed when the
                    configured sink latency changes
    Classification: Unclassified
           Product: PulseAudio
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: medium
         Component: alsa
        AssignedTo: pulseaudio-bugs at lists.freedesktop.org
        ReportedBy: tanuk at iki.fi
         QAContact: pulseaudio-bugs at lists.freedesktop.org
                CC: lennart at poettering.net


If a sink supports dynamic latency and the latency is adjusted downwards, there
needs to be a rewind to ensure that the sink buffer doesn't contain more data
than what is allowed by the new latency. This is because rewind requests can't
be larger than the configured latency, and if there's more data than that in
the buffer, a later rewind request may end up being too small.

The alsa sink requests the rewind in sink_update_requested_latency_cb():

    if (u->hwbuf_unused > before) {
        pa_log_debug("Requesting rewind due to latency change.");
        pa_sink_request_rewind(s, (size_t) -1);
    }

Doing a full rewind (-1 as the rewind amount) is not necessary, as far as I can
see. It would be sufficient to rewind only by the difference between the old
and new latency.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the pulseaudio-bugs mailing list