[pulseaudio-discuss] What is corking?

David Henningsson launchpad.web at epost.diwic.se
Fri Dec 25 11:23:55 PST 2009


Lennart Poettering wrote:
> On Fri, 25.12.09 03:57, David Henningsson (launchpad.web at epost.diwic.se) wrote:
> 
>> Hi,
>>
>> I triage some sound bugs in Ubuntu and for one user I found the
>> following lines in the "pulseaudio -vvvv" log:
>>
>> D: sink-input.c: Requesting rewind due to corking
>> D: module-suspend-on-idle.c: Sink alsa_output.default becomes idle,
>> timeout in 5 seconds.
>> D: sink-input.c: Requesting rewind due to uncorking
>> D: module-suspend-on-idle.c: Sink alsa_output.default becomes busy.
>> D: protocol-native.c: Requesting rewind due to rewrite.
>> D: sink-input.c: Requesting rewind due to corking
>> D: module-suspend-on-idle.c: Sink alsa_output.default becomes idle,
>> timeout in 5 seconds.
>> D: sink-input.c: Requesting rewind due to uncorking
>> D: module-suspend-on-idle.c: Sink alsa_output.default becomes busy.
>> D: protocol-native.c: Requesting rewind due to rewrite.
>> D: protocol-native.c: Requesting rewind due to rewrite.
>>
>> These lines keep repeating themselves over and over again (at least 20
>> times), sometimes with multiple "Requesting rewind due to rewrite" lines.
>>
>> So, can someone explain a little bit what this is all about? Is it
>> something to worry about? I think it happens during regular playback.
>> I'm not a native English speaking person, so I don't even know what
>> "corking" means in this context (and "define:corking" on Google didn't
>> help much...).
> 
> Corking means that the application asked for the audio stream to be
> "corked" temporarily, so that data flow stops. "uncorking" then makes
> things flow again.
> 
> It's mostly synonymous to application triggered pause/unpause.

Instantaneous pause, i e without "drain buffers" first, right?

> If the app corks playback we need to drop most of the playback buffer
> and rerender it again, that's why you see the rewind lines there,
> which "rewinds" the read index in the playback fifo buffer. 
> 
> A "rewrite" means that the application itself rewrote what it already
> wrote before. I.e. an explicit rewind of the write index triggered by
> the application.
> 
> In both cases this is triggered by the app explicitly.

Thanks, that answers some questions but also raises new ones...

There are rows saying "Requesting rewind due to rewrite" but there are
no rows following up that rewind, as seen in other logs[2]. How come?

Second, can you (or anyone else) think of a scenario where these lines
typically reoccurs frequently, or are we looking at an error, either in
GStreamer[1] or in PulseAudio?

// David

[1] This was from playing a movie with Totem, with tsched=0 explicitly
set (for reasons unknown to me). If you're curious, the complete log is
available here: http://launchpadlibrarian.net/37141654/pulseverbose.log

[2] Lines like these:

D: alsa-sink.c: Requested to rewind 32768 bytes.
D: alsa-sink.c: Limited to 32608 bytes.
D: alsa-sink.c: before: 4076
D: alsa-sink.c: after: 4076
D: alsa-sink.c: Rewound 32608 bytes.



More information about the pulseaudio-discuss mailing list