Bug 54251

Summary: protocol-esound, protocol-simple: Rewind after underrun can be too large
Product: PulseAudio Reporter: Tanu Kaskinen <tanuk>
Component: coreAssignee: pulseaudio-bugs
Status: RESOLVED MOVED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Tanu Kaskinen 2012-08-30 08:29:52 UTC
Rewinding after an underrun should be done like this:

pa_sink_input_request_rewind(s->sink_input, (size_t) (s->sink_input->thread_info.underrun_for == (uint64_t) -1 ? 0 : s->sink_input->thread_info.underrun_for), FALSE, TRUE, FALSE);

(The example is from protocol-native.c.)

That ensures that the received data won't overwrite valid data in case the underrun was so short that the sink still has data left from time before the underrun started.

protocol-esound.c currently does this:

pa_sink_input_request_rewind(c->sink_input, 0, FALSE, TRUE, FALSE);

Giving zero as the rewind amount means that a full rewind will be done, regardless of whether valid data might get overwritten. If valid data gets overwritten, there will be a skip in the audio.

protocol-simple.c has the same bug.
Comment 1 GitLab Migration User 2018-07-30 09:38:15 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/65.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.