<div dir="ltr"><div><div><div><div><div><div><div>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.<br><br>1) Alsa seems to let me set a short latency, but when I do:<br>
<br> gst-launch-0.10 -v alsasrc latency-time=333 buffer-time=200000 ! queue ! alsasink<br> latency-time=100000 max-lateness=10000<br></div><br>I get<br> Setting pipeline to PAUSED ...<br> /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: actual-buffer-time = 199909<br>
/GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: actual-latency-time = 362<br> /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234,<br> signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)44100, channels=(int)2<br>
Pipeline is live and does not need PREROLL ...<br><br></div>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.<br>
<br></div>What is the actual latency of a pipeline?<br><br></div>2) How do I _really_ query for latency? One posting suggested something like:<br><br> GstQuery *q = gst_query_new_latency();<br> if (gst_element_query (ourPipeline, q)) {<br>
gboolean live;<br> GstClockTime minlat, maxlat;<br> gst_query_parse_latency (q, &live, &minlat, &maxlat);<br> fprintf(stderr, "live = %s.\n", live ? "true" : "false");<br>
} else {<br> fprintf(stderr, "Pipeline query unsuccessful.\n");<br> }<br> gst_query_unref (q);<br><br></div>However, whether this is done on the pipeline or the sink element, the query fails.<br>
<br>With thanks for assistance,<br></div></div>Alex</div>