Thanks Tanu for the clarifications.<br><br>But the doubt is still , who is actually sending the pause(cork) event to pulsesink or gst, either or both of these:<br>1. module-x11-cork-request with X11 keyboard events<br>2. src/pulsecore/protocol-native.has sink_input_send_event_cb(),<br>
<br>and where these event is handled in pulsesink (and gst)? as gst_pulsering_stream_event_cb( ) is disabled with flag HAVE_PULSE_0_9_15, So I guess <br>this event is handled somewhere else,but not sure where?<br><br><br>
I am getting one bug, where pulse-audio daemon is terminated, the usecase is:<br><br>1. "phone" stream is ongoing <br>2. "music" stream arrives, <br><br>so expected behavior is music should get corked while phone is active, eventually its getting corked sometimes and working fine but not always!<br>
and sometimes PA daemon gets terminated saying Failed to handle SIGBUS, here are few gst logs when starting "music" stream from gst-launch:<br><br>ERROR: from element /GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:abin/GstBin:bin0/GstPulseSink:pulsesink0: pa_stream_write() failed: Connection terminated<br>
Additional debug info:<br>pulsesink.c(1587): gst_pulseringbuffer_commit (): /GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:abin/GstBin:bin0/GstPulseSink:pulsesink0<br>Execution ended after 75439452 ns.<br>Setting pipeline to PAUSED ...<br>
Setting pipeline to READY ...<br>/GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:abin/GstBin:bin0/GstPulseSink:pulsesink0.GstPad:sink: caps = NULL<br>Assertion 'pa_atomic_load(&(b)->_ref) > 0' failed at pulsecore/memblock.c:590, function pa_memblock_unref(). Aborting.<br>
Aborted<br> <br><br>I doubt this issue is related to my earlier question, as you mentioned "module-x11-cork-request is a workaround for clients that don't handle<br>
stream events (a workaround that isn't working very well, I've heard) "?<br><br>BR,<br>Himanshu<br><br><br><br><div class="gmail_quote">On Thu, Jun 16, 2011 at 1:47 PM, Tanu Kaskinen <span dir="ltr"><<a href="mailto:tanuk@iki.fi">tanuk@iki.fi</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">On Thu, 2011-06-16 at 12:54 +0530, Himanshu Chug wrote:<br>
> Hi<br>
><br>
> I am trying to understand how the corking/uncorking events reach from PA<br>
> module to PA applications/clients e.g gst-launch<br>
><br>
> Say, we are corking the playback stream in module-cork-music-on-phone by<br>
> calling :<br>
><br>
> apply_cork(struct userdata *u, pa_sink *s, pa_sink_input *ignore, pa_bool_t<br>
> cork)<br>
> pa_sink_input_send_event(ignore, PA_STREAM_EVENT_REQUEST_CORK, NULL);<br>
> (in sink-input.c)<br>
><br>
> (pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_SEND_EVENT],<br>
> &hook_data) (function then fire an hook)<br>
> sink_input_send_event_hook_cb( pa_core *c,<br>
> pa_sink_input_send_event_hook_data *data, struct userdata *u) ( in<br>
> module-x11-cork-request, passing *data that contains cork event)<br>
><br>
><br>
> now inside sink_input_send_event_hook_cb( ) ( in module-x11-cork-request )<br>
> there is an if-else check<br>
><br>
> if (pa_streq(data->event, PA_STREAM_EVENT_REQUEST_CORK))<br>
> sym = XF86XK_AudioPause;<br>
> else if (pa_streq(data->event, PA_STREAM_EVENT_REQUEST_UNCORK))<br>
> sym = XF86XK_AudioPlay;<br>
> else<br>
> return PA_HOOK_OK;<br>
><br>
> further the same function is calling<br>
> XTestFakeKeyEvent(display, code, True, CurrentTime);<br>
> XSync(display, False);<br>
<br>
</div></div>module-x11-cork-request is a workaround for clients that don't handle<br>
stream events (a workaround that isn't working very well, I've heard).<br>
As can be seen from the code you pasted, the idea is to generate<br>
AudioPause and AudioPlay X11 keyboard events with the hope that the<br>
applications will handle those.<br>
<div class="im"><br>
> But it is not clear to me how the Cork/Uncork events then reach to PA client<br>
> (say pulsesink or Gst-launch)<br>
<br>
</div>src/pulsecore/protocol-native.c has sink_input_send_event_cb(), which<br>
sends all stream events over the protocol to the client. It's then up to<br>
the client to decide what to do.<br>
<div class="im"><br>
> and then where gst listens to these events and<br>
> pause / resume gst pipeline accordingly ?<br>
> Is pulsesink involved here somehow ? I can see<br>
> gst_pulsering_stream_event_cb( ) function (inside pulsesink.c) handling<br>
> PA_STREAM_EVENT_REQUEST_CORK but currently it is under #ifdef<br>
> HAVE_PULSE_0_9_15 flag and disabled.<br>
<br>
</div>That's the function that should handle the cork request and pause the<br>
Gstreamer pipeline. If the code is disabled, then Pulseaudio's stream<br>
events apparently are not currently handled by Gstreamer.<br>
<font color="#888888"><br>
--<br>
Tanu<br>
<br>
_______________________________________________<br>
pulseaudio-discuss mailing list<br>
<a href="mailto:pulseaudio-discuss@lists.freedesktop.org">pulseaudio-discuss@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss" target="_blank">http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss</a><br>
</font></blockquote></div><br>