Hi Lennart,<br>Here is the use case Xing is referring to: you are listening to music, and a VoIP call starts. The user may not want to mix the music and the speech call. <br><br>So the idea is to pause the music while the call takes place, and resume the music once the call finishes. PulseAudio receives both streams, and it would seem natural to configure said behavior in a PulseAudio module. So we either need the ability to pause a stream within PulseAudio, or we need a means to inform the client they need to pause. <br>
<br>I agree with you that pausing may create timing havoc on the client; but we are missing a generic protocol to notify the clients and implement this legitimate use case.<br>Regards,<br>Pierre Bossart<br><br><div class="gmail_quote">
On Sun, Jan 18, 2009 at 11:16 AM, Lennart Poettering <span dir="ltr"><<a href="mailto:lennart@poettering.net">lennart@poettering.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Fri, 09.01.09 21:10, Zhang, Xing Z (<a href="mailto:xing.z.zhang@intel.com">xing.z.zhang@intel.com</a>) wrote:<br>
<br>
> Hi experts:<br>
<br>
> I worked on an audiomanager project based on PulseAudio. Now I am<br>
> blocked by a command_cork_playback_stream() issue. In our design,<br>
> an application may be corked when connects to pulseaudio if its<br>
> priority is low. I set a hook on PA_CORE_HOOK_SINK_INPUT_PUT and<br>
> invoke pa_sink_input_cork(..., TRUE). Unfortunately it doesn't<br>
> work. By GDB, I found application will call<br>
> command_cork_playback_stream() which invokes pa_sink_input_cork(...,<br>
> FALSE) several times, this make my hook is of no effect. I don't<br>
> look into PA for ALSA plugin, anyone know why<br>
> command_cork_playback_stream() need be called so frequently during<br>
> app initialization?<br>
<br>
Hmm, I think you are confusing a few things here.<br>
<br>
command_cork_playback_stream() is the code that dispatches client<br>
requests for corking/uncorking (when done via the native protocol). It<br>
is not used when corking something internally as for example by a hook<br>
function.<br>
<br>
Pausing a stream (i.e. corking) should be something that is controlled<br>
exclusively by the client. You should not intefere with it from inside<br>
the server. There is a state machine in the PA client code that<br>
follows the cork state. If you change the state underneath it might<br>
become invalid. Also it might confuse client applications due to<br>
the paused timing.<br>
<br>
Lennart<br>
<font color="#888888"><br>
--<br>
Lennart Poettering Red Hat, Inc.<br>
lennart [at] poettering [dot] net ICQ# 11060553<br>
<a href="http://0pointer.net/lennart/" target="_blank">http://0pointer.net/lennart/</a> GnuPG 0x1A015CC4<br>
_______________________________________________<br>
pulseaudio-discuss mailing list<br>
<a href="mailto:pulseaudio-discuss@mail.0pointer.de">pulseaudio-discuss@mail.0pointer.de</a><br>
<a href="https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss" target="_blank">https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss</a><br>
</font></blockquote></div><br>