gst_event_new_flush_(start|stop) messing up the pipeline...

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

gst_event_new_flush_(start|stop) messing up the pipeline...

S Boucher
Is there some non-official documentation discussing the DOs and DONTs with flush events, and segments?

>From a pad task, I push a flush_start/flush_stop/segment, but any new audio data pushed after that doesn't get played.  The events are successfully pushed, and the timestamps of the new audio buffer are within the range defined by the segment.

I must be doing something wrong, but nothing that appears to contradict the official documentation.

Thanks,


      __________________________________________________________________
Ask a question on any topic and get answers from real people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.com

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_event_new_flush_(start|stop) messing up the pipeline...

Tim-Philipp Müller-2
On Wed, 2010-02-10 at 12:17 -0800, S Boucher wrote:

> Is there some non-official documentation discussing the DOs and DONTs
>   with flush events, and segments?
>
> From a pad task, I push a flush_start/flush_stop/segment, but any new
>   audio data pushed after that doesn't get played.  The events are
>   successfully pushed, and the timestamps of the new audio buffer are
>   within the range defined by the segment.
>
> I must be doing something wrong, but nothing that appears to contradict
>  the official documentation.

If audio is not played any longer, then either buffers are dropped
somewhere before the sink, or buffers are modified to silence data, or
the sink drops/clips them.

The GST_DEBUG log should tell you what's happening. Start with
GST_DEBUG=*sink:5 to see if the sink gets buffers and what it does with
them.

It's hard to give general 'DO and DON'T' advice, esp. without even
having seen the code or knowing more about what you are doing.

Do you have the problematic code somewhere for people to look at?

Have you maybe even made a minimal test case that demonstrates the
problem?

Is there a GST_DEBUG log for people to look at somewhere?

Cheers
 -Tim



------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_event_new_flush_(start|stop) messing up the pipeline...

S Boucher


--- On Fri, 2/12/10, Tim-Philipp Müller <[hidden email]> wrote:

> If audio is not played any longer, then either buffers are
> dropped
> somewhere before the sink, or buffers are modified to
> silence data, or
> the sink drops/clips them.

All buffers a pushed successfully the 1st and 2nd time (its the same data being pushed both times).

Inserting an identity element prior to the sink and dumping the buffers show that the buffers are, as expected, the same the 1st and 2nd time.

the audiosink appears to be consuming the buffers correctly the first and 2nd time. i.e. I get a series of (with the "at" increasing normally, and for the 1st and 2nd time through):

0:00:04.207250106 12211  0x84b2a80 DEBUG        baseaudiosink gstbaseaudiosink.c:1475:gst_base_audio_sink_render:<audiosink-actual-sink-pulse> rendering at 0 368/368
0:00:04.207293501 12211  0x84b2a80 DEBUG        baseaudiosink gstbaseaudiosink.c:1485:gst_base_audio_sink_render:<audiosink-actual-sink-pulse> wrote 368 of 368
0:00:04.207318364 12211  0x84b2a80 DEBUG        baseaudiosink gstbaseaudiosink.c:1508:gst_base_audio_sink_render:<audiosink-actual-sink-pulse> next sample expected at 368

So, something's getting busted in the pulse audio sink due to the flush_start/flush_stop sent between the first and 2nd time.



      __________________________________________________________________
The new Internet Explorer® 8 - Faster, safer, easier.  Optimized for Yahoo!  Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_event_new_flush_(start|stop) messing up the pipeline...

Thiago Sousa Santos-2


On Fri, Feb 12, 2010 at 2:32 PM, S Boucher <[hidden email]> wrote:


--- On Fri, 2/12/10, Tim-Philipp Müller <[hidden email]> wrote:

> If audio is not played any longer, then either buffers are
> dropped
> somewhere before the sink, or buffers are modified to
> silence data, or
> the sink drops/clips them.

All buffers a pushed successfully the 1st and 2nd time (its the same data being pushed both times).

Inserting an identity element prior to the sink and dumping the buffers show that the buffers are, as expected, the same the 1st and 2nd time.

the audiosink appears to be consuming the buffers correctly the first and 2nd time. i.e. I get a series of (with the "at" increasing normally, and for the 1st and 2nd time through):

0:00:04.207250106 12211  0x84b2a80 DEBUG        baseaudiosink gstbaseaudiosink.c:1475:gst_base_audio_sink_render:<audiosink-actual-sink-pulse> rendering at 0 368/368
0:00:04.207293501 12211  0x84b2a80 DEBUG        baseaudiosink gstbaseaudiosink.c:1485:gst_base_audio_sink_render:<audiosink-actual-sink-pulse> wrote 368 of 368
0:00:04.207318364 12211  0x84b2a80 DEBUG        baseaudiosink gstbaseaudiosink.c:1508:gst_base_audio_sink_render:<audiosink-actual-sink-pulse> next sample expected at 368

So, something's getting busted in the pulse audio sink due to the flush_start/flush_stop sent between the first and 2nd time.

You can compare what your element does with some other element of the same kind (demuxer, decoder, source) that's on -base or -good and check if something is different.
 



     __________________________________________________________________
The new Internet Explorer® 8 - Faster, safer, easier.  Optimized for Yahoo!  Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
Thiago Sousa Santos

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_event_new_flush_(start|stop) messing up the pipeline...

S Boucher
In reply to this post by S Boucher
I think what is happening is that after the flush/new segment, the audio sink is already moving along, so that the audio data supposed to match the new segment, when it arrives, is already too late and gets dropped.


I hit the following in gst_ring_buffer_commit_full():

      /* segment too far ahead, writer too slow, we need to drop, hopefully UNLIKELY */
      if (G_UNLIKELY (diff < 0)) {
        /* we need to drop one segment at a time, pretend we wrote a
         * segment. */
        skip = TRUE;
        break;
      }


So, how do I go about getting my pipeline to preroll some after a flush?

--- On Fri, 2/12/10, S Boucher <[hidden email]> wrote:

> From: S Boucher <[hidden email]>
> Subject: Re: [gst-devel] gst_event_new_flush_(start|stop) messing up the pipeline...
> To: "Discussion of the development of GStreamer" <[hidden email]>
> Received: Friday, February 12, 2010, 12:32 PM
>
>
> --- On Fri, 2/12/10, Tim-Philipp Müller <[hidden email]>
> wrote:
>
> > If audio is not played any longer, then either buffers
> are
> > dropped
> > somewhere before the sink, or buffers are modified to
> > silence data, or
> > the sink drops/clips them.
>
> All buffers a pushed successfully the 1st and 2nd time (its
> the same data being pushed both times).
>
> Inserting an identity element prior to the sink and dumping
> the buffers show that the buffers are, as expected, the same
> the 1st and 2nd time.
>
> the audiosink appears to be consuming the buffers correctly
> the first and 2nd time. i.e. I get a series of (with the
> "at" increasing normally, and for the 1st and 2nd time
> through):
>
> 0:00:04.207250106 12211  0x84b2a80 DEBUG   
>     baseaudiosink
> gstbaseaudiosink.c:1475:gst_base_audio_sink_render:<audiosink-actual-sink-pulse>
> rendering at 0 368/368
> 0:00:04.207293501 12211  0x84b2a80 DEBUG   
>     baseaudiosink
> gstbaseaudiosink.c:1485:gst_base_audio_sink_render:<audiosink-actual-sink-pulse>
> wrote 368 of 368
> 0:00:04.207318364 12211  0x84b2a80 DEBUG   
>     baseaudiosink
> gstbaseaudiosink.c:1508:gst_base_audio_sink_render:<audiosink-actual-sink-pulse>
> next sample expected at 368
>
> So, something's getting busted in the pulse audio sink due
> to the flush_start/flush_stop sent between the first and 2nd
> time.
>
>
>
>      
> __________________________________________________________________
> The new Internet Explorer® 8 - Faster, safer,
> easier.  Optimized for Yahoo!  Get it Now for
> Free! at http://downloads.yahoo.com/ca/internetexplorer/
>
> ------------------------------------------------------------------------------
> SOLARIS 10 is the OS for Data Centers - provides features
> such as DTrace,
> Predictive Self Healing and Award Winning ZFS. Get Solaris
> 10 NOW
> http://p.sf.net/sfu/solaris-dev2dev
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>


      __________________________________________________________________
The new Internet Explorer® 8 - Faster, safer, easier.  Optimized for Yahoo!  Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel