Latency long and latency query fails

Alex Stark jastark.work at gmail.com
Fri Aug 2 11:02:59 PDT 2013


I am trying to do live audio processing.  I don't mind a delay, but I need
to know very accurately and precisely what that delay is.

1) Alsa seems to let me set a short latency, but when I do:

    gst-launch-0.10 -v alsasrc latency-time=333 buffer-time=200000 ! queue
! alsasink
    latency-time=100000 max-lateness=10000

I get
    Setting pipeline to PAUSED ...
    /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: actual-buffer-time = 199909
    /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: actual-latency-time = 362
    /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0.GstPad:src: caps =
audio/x-raw-int, endianness=(int)1234,
    signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)44100,
channels=(int)2
    Pipeline is live and does not need PREROLL ...

This looks promising, but the audio is (on listening) quite obviously
delayed more than 362, unless that means msec. (!)  Removing the queue,
tweaking the parameters, etc, etc, do not result in improved latency.

What is the actual latency of a pipeline?

2) How do I _really_ query for latency?  One posting suggested something
like:

    GstQuery *q = gst_query_new_latency();
    if (gst_element_query (ourPipeline, q)) {
       gboolean live;
       GstClockTime minlat, maxlat;
       gst_query_parse_latency (q, &live, &minlat, &maxlat);
       fprintf(stderr, "live = %s.\n", live ? "true" : "false");
    } else {
        fprintf(stderr, "Pipeline query unsuccessful.\n");
    }
    gst_query_unref (q);

However, whether this is done on the pipeline or the sink element, the
query fails.

With thanks for assistance,
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130802/b400efd8/attachment.html>


More information about the gstreamer-devel mailing list