<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,255)">Hello all,<br></div><div class="gmail_quote"><div dir="ltr"><div style="font-family:verdana,sans-serif;color:rgb(0,0,255)">we are using Pulse Audio API to playback audio received from network. So far we are using pa_simple_api, with this we get latency of 2+ seconds. From internet documents we got to about PA_STREAM_ADJUST_LATENCY flags. But it seem this flag can be set for PA_STREAM_API. We tried to set /use PA_STREAM_API as mentioned below<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,255);display:inline">. but it fails in </div><div class="gmail_default" style="display:inline"></div>pa_stream_new<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,255);display:inline">() it self. </div></div><div style="font-family:verdana,sans-serif;color:rgb(0,0,255)"><br></div><div><div><font color="#0000ff" face="verdana, sans-serif"> pa_ml = pa_mainloop_new();</font></div><div><font color="#0000ff" face="verdana, sans-serif"> pa_mlapi = pa_mainloop_get_api(pa_ml);</font></div><div><font color="#0000ff" face="verdana, sans-serif"> pa_ctx = pa_context_new(pa_mlapi, "ivcloudapp");</font></div><div><font color="#0000ff" face="verdana, sans-serif"> pa_context_connect(pa_ctx, NULL,PA_CONTEXT_NOFLAGS, NULL);</font></div><div><font color="#0000ff" face="verdana, sans-serif"><br></font></div><div><font color="#0000ff" face="verdana, sans-serif"> if(!s)</font></div><div><font color="#0000ff" face="verdana, sans-serif"> {</font></div><div><font color="#0000ff" face="verdana, sans-serif"><span style="white-space:pre-wrap"> </span>s = <div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,255);display:inline"></div>pa_stream_new(pa_ctx, "Playback", &ss, NULL);</font></div><div><font color="#0000ff" face="verdana, sans-serif"> <span style="white-space:pre-wrap"> </span></font><span style="color:rgb(0,0,255);font-family:verdana,sans-serif">if (!s) {</span></div><div><font color="#0000ff" face="verdana, sans-serif"> <span style="white-space:pre-wrap"> </span></font><font face="verdana, sans-serif" color="#ff0000">printf("pa_stream_new failed\n");</font></div><div><font color="#0000ff" face="verdana, sans-serif"><span style="white-space:pre-wrap"> <div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,255);display:inline"> </div></span>goto finish;</font></div><div><font color="#0000ff" face="verdana, sans-serif"><span style="white-space:pre-wrap"> </span> }</font></div><div><font color="#0000ff" face="verdana, sans-serif"> ret = 0;</font></div><div><font color="#0000ff" face="verdana, sans-serif"><span style="white-space:pre-wrap"> </span> paAttr.maxlength = pa_usec_to_bytes(latency,&ss);</font></div><div><font color="#0000ff" face="verdana, sans-serif"><span style="white-space:pre-wrap"> </span> paAttr.tlength = pa_usec_to_bytes(latency,&ss);</font></div><div><font color="#0000ff" face="verdana, sans-serif"><span style="white-space:pre-wrap"> </span> paAttr.prebuf = (uint32_t)-1;</font></div><div><font color="#0000ff" face="verdana, sans-serif"><span style="white-space:pre-wrap"> </span> paAttr.minreq = pa_usec_to_bytes(0,&ss)<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,255);display:inline">;</div></font></div><div><font color="#0000ff" face="verdana, sans-serif"><span style="white-space:pre-wrap"> </span> paAttr.fragsize = (uint32_t)-1;</font></div><div><font color="#0000ff" face="verdana, sans-serif"><span style="white-space:pre-wrap"> </span> int r = pa_stream_connect_playback(s, NULL, &paAttr,<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,255);display:inline"> </div></font><span style="color:rgb(0,0,255);font-family:verdana,sans-serif">PA_STREAM_ADJUST_LATENCY, NULL, NULL);<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,255);display:inline"> </div></span></div><div><span style="color:rgb(0,0,255);font-family:verdana,sans-serif"><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,255);display:inline"><br></div></span></div><div><span style="color:rgb(0,0,255);font-family:verdana,sans-serif"><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,255);display:inline">Please give direction how we can set low latency with pa_simple_api.</div></span></div></div><div><span style="color:rgb(0,0,255);font-family:verdana,sans-serif"><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,255);display:inline"><br></div></span></div><div><span style="color:rgb(0,0,255);font-family:verdana,sans-serif"><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,255);display:inline">Regards</div></span></div><div><span style="color:rgb(0,0,255);font-family:verdana,sans-serif"><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,255);display:inline">+swapnali </div></span></div><div><span style="color:rgb(0,0,255);font-family:verdana,sans-serif"><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,255);display:inline"><br></div></span></div></div>
</div><br></div>