[pulseaudio-discuss] why command_cork_playback_stream() will be invoked many times?

Lennart Poettering lennart at poettering.net
Sun Jan 18 09:16:24 PST 2009


On Fri, 09.01.09 21:10, Zhang, Xing Z (xing.z.zhang at intel.com) wrote:

> Hi experts:

> I worked on an audiomanager project based on PulseAudio. Now I am
> blocked by a command_cork_playback_stream() issue.  In our design,
> an application may be corked when connects to pulseaudio if its
> priority is low. I set a hook on PA_CORE_HOOK_SINK_INPUT_PUT and
> invoke pa_sink_input_cork(..., TRUE). Unfortunately it doesn't
> work. By GDB, I found application will call
> command_cork_playback_stream() which invokes pa_sink_input_cork(...,
> FALSE) several times, this make my hook is of no effect. I don't
> look into PA for ALSA plugin, anyone know why
> command_cork_playback_stream() need be called so frequently during
> app initialization?

Hmm, I think you are confusing a few things here.

command_cork_playback_stream() is the code that dispatches client
requests for corking/uncorking (when done via the native protocol). It
is not used when corking something internally as for example by a hook
function.

Pausing a stream (i.e. corking) should be something that is controlled
exclusively by the client. You should not intefere with it from inside
the server. There is a state machine in the PA client code that
follows the cork state. If you change the state underneath it might
become invalid. Also it might confuse client applications due to
the paused timing.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4



More information about the pulseaudio-discuss mailing list