<div dir="ltr">Missed to mention that the logs are captured with gst-validate-1.0 application. <div>The scenario is switching track switch every 5seconds. </div><div>the adaptive demux plugin outputs video and audio ES.</div><div>The sequence of operations done on adaptive demux plugin are as follows:<br></div><div><span style="font-size:12.8px">On audio src pad of demux:</span></div><div>Flush buffered audio packets:<br style="font-size:12.8px"><span style="font-size:12.8px">- push gst_event_new_flush_start()</span><br style="font-size:12.8px"><span style="font-size:12.8px">- push gst_event_new_flush_stop(</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">FALSE)</span><br style="font-size:12.8px"><span style="font-size:12.8px">- push new segment event </span><br style="font-size:12.8px"><span style="font-size:12.8px">- push buffers with the time stamps corresponding to the current presentation time</span><br></div><div><span style="font-size:12.8px">It works 2-3 time but then freezes.</span><br></div><div><span style="font-size:12.8px">--Nitin</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 8, 2017 at 2:13 PM, Nitin Mahajan <span dir="ltr"><<a href="mailto:rise.era@gmail.com" target="_blank">rise.era@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Many Thanks. Attached basesink debug out captured when a/v freeze (freeze_basesink_traces.txt.<wbr>zip)<div>Also captured some info for the blocking thread below.</div><div>While analysing various threads, it seems that audio queue is empty post flushing the audio chain (upon track change) and the video queue is full.</div><div>The thread to push next video packet is blocked on multiqueue waiting for the space to be available to enqueue but video renderer is blocked.</div><div>Due to this, complete video pipeline is full and buffers not being consumed and the thread responsible to push audio packets from the demux in pipeline is blocked.</div><div>Could it be the possible reason that audio queue is empty post flush and video queue is full, so basesink will wait forever triggering a deadlock ..</div><div>Also, may request for ant reference implementation where on the fly flush start and stop is done on one of the decode chain (like audio decode chain in this case)..<br></div><div><br></div><div><div><div>(gdb) up</div><div>#4  0xb7d8d76d in gst_system_clock_id_wait_<wbr>jitter_unlocked (clock=0xad1672e0, entry=0xac732140, jitter=0xa09fe650, restart=1) at gstsystemclock.c:684</div><div>684          pollret = gst_poll_wait (sysclock->priv->timer, diff);</div><div>(gdb) p diff</div><div>$1 = 16433000</div><div>(gdb) up</div><div>#5  0xb7d3c1aa in gst_clock_id_wait (id=0xac732140, jitter=jitter@entry=<wbr>0xa09fe650) at gstclock.c:539</div><div>539      res = cclass->wait (clock, entry, jitter);</div><div>(gdb) p jitter</div><div>$2 = (GstClockTimeDiff *) 0xa09fe650</div><div>(gdb) p *jitter</div><div>$3 = -16433000</div><div>(gdb) p *clock</div><div>$4 = {object = {object = {g_type_instance = {g_class = 0xac708098}, ref_count = 46, qdata = 0x0}, lock = {p = 0xac705a28, i = {2893044264, 0}}, name = 0xac705a68 "GstPulseSinkClock", parent = 0x0, </div><div>    flags = 752, control_bindings = 0x0, control_rate = 100000000, last_sync = 18446744073709551615, _gst_reserved = 0x0}, priv = 0xad167278, _gst_reserved = {0x0, 0x0, 0x0, 0x0}}</div><div>(gdb) p *entry</div><div>$6 = {refcount = 1, clock = 0xad1672e0, type = GST_CLOCK_ENTRY_SINGLE, time = 25083000000, interval = 18446744073709551615, status = GST_CLOCK_BUSY, func = 0x0, user_data = 0x0, destroy_data = 0x0, </div><div>  unscheduled = 0, woken_up = 0, _gst_reserved = {0x0, 0x0, 0x0, 0x0}}</div><div>(gdb) </div><div>$7 = {refcount = 1, clock = 0xad1672e0, type = GST_CLOCK_ENTRY_SINGLE, time = 25083000000, interval = 18446744073709551615, status = GST_CLOCK_BUSY, func = 0x0, user_data = 0x0, destroy_data = 0x0, </div><div>  unscheduled = 0, woken_up = 0, _gst_reserved = {0x0, 0x0, 0x0, 0x0}}</div><div>(gdb) up</div><div>#6  0xb77f1930 in gst_base_sink_wait_clock (sink=sink@entry=0xad30c6d8, time=<optimized out>, jitter=jitter@entry=<wbr>0xa09fe650) at gstbasesink.c:2104</div><div>2104      ret = gst_clock_id_wait (sink->priv->cached_clock_id, jitter);</div><div>(gdb) p jitter</div><div>$8 = (GstClockTimeDiff *) 0xa09fe650</div><div>(gdb) p *jitter</div><div>$9 = -16433000</div><div>(gdb) up</div><div>#7  0xb77f3317 in gst_base_sink_do_sync (basesink=basesink@entry=<wbr>0xad30c6d8, obj=obj@entry=0xa0018220, late=late@entry=0xa09fe7d8, step_end=step_end@entry=<wbr>0xa09fe7dc) at gstbasesink.c:2491</div><div>2491      status = gst_base_sink_wait_clock (basesink, stime, &jitter);</div><div>(gdb) p stime</div><div>$10 = <optimized out></div><div>(gdb) p jitter</div><div>$11 = -16433000</div><div>(gdb) p *basesink</div><div>$12 = {element = {object = {object = {g_type_instance = {g_class = 0xad30b220}, ref_count = 4, qdata = 0xac7763b8}, lock = {p = 0xad30c8b8, i = {2905655480, 0}}, name = 0xad32f5f0 "irdetovideosink0", </div><div>      parent = 0xac72b048, flags = 32, control_bindings = 0x0, control_rate = 100000000, last_sync = 18446744073709551615, _gst_reserved = 0x0}, state_lock = {p = 0xad30c8d8, i = {0, 0}}, state_cond = {</div><div>      p = 0xad30c8f8, i = {0, 0}}, state_cookie = 3, target_state = GST_STATE_PLAYING, current_state = GST_STATE_PLAYING, next_state = GST_STATE_VOID_PENDING, pending_state = GST_STATE_VOID_PENDING, </div><div>    last_return = GST_STATE_CHANGE_SUCCESS, bus = 0xac706298, clock = 0xad1672e0, base_time = 0, start_time = 0, numpads = 1, pads = 0xadd5c5c0, numsrcpads = 0, srcpads = 0x0, numsinkpads = 1, </div><div>    sinkpads = 0xadd5c5d0, pads_cookie = 1, _gst_reserved = {0x0, 0x0, 0x0, 0x0}}, sinkpad = 0xad1664f8, pad_mode = GST_PAD_MODE_PUSH, offset = 0, can_activate_pull = 0, can_activate_push = 1, </div><div>  preroll_lock = {p = 0xad30ca78, i = {2905655928, 0}}, preroll_cond = {p = 0xad30ca98, i = {0, 0}}, eos = 0, need_preroll = 0, have_preroll = 0, playing_async = 0, have_newsegment = 1, segment = {</div><div>    flags = GST_SEGMENT_FLAG_NONE, rate = 1, applied_rate = 1, format = GST_FORMAT_TIME, base = 0, offset = 0, start = 0, stop = 18446744073709551615, time = 0, position = 25124666592, </div><div>    duration = 18446744073709551615, _gst_reserved = {0x0, 0x0, 0x0, 0x0}}, clock_id = 0xac732140, sync = 1, flushing = 0, running = 0, max_lateness = 20000000, priv = 0xad30c500, _gst_reserved = {</div><div>    0x0 <repeats 20 times>}}</div><div>(gdb) </div></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>--Nitin</div><div><br></div></font></span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 8, 2017 at 12:43 PM, Arun Raghavan <span dir="ltr"><<a href="mailto:arun@arunraghavan.net" target="_blank">arun@arunraghavan.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Thu, 1 Jun 2017, at 10:40 PM, Nitin Mahajan wrote:<br>
> Please note that flush stop is passed with False so that the clock timing<br>
> is not reset purposely as thereafter buffer with valid timestamp of<br>
> different language is pushed. What could trigger queue thread to block /<br>
> wait inside video renderer basesink from audio sink pulse audio. The test<br>
> is running on x86 with gstreamer 1.4.5. Suggestion/pointer will be very<br>
> helpful as there is not much clue from traces to establish design<br>
> relationship between audio and video sinks and blocking wait.<br>
<br>
</span>It might be a good idea to look at the basesink debug output -- what is<br>
the timestamp that you're pushing out, and what is the timestamp against<br>
which that the sink is waiting?<br>
<span class="m_-8380578883076805246HOEnZb"><font color="#888888"><br>
-- Arun<br>
</font></span><div class="m_-8380578883076805246HOEnZb"><div class="m_-8380578883076805246h5">______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesk<wbr>top.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-dev<wbr>el</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>