[pulseaudio-discuss] Fwd: [LOW LATENCY] PA_simple

Swapnali Patil swapnali.patil at intelli-vision.com
Tue Jan 12 20:49:42 PST 2016

Hello all,
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
​. ​but it fails in
​() it self. ​

    pa_ml = pa_mainloop_new();
    pa_mlapi = pa_mainloop_get_api(pa_ml);
    pa_ctx = pa_context_new(pa_mlapi, "ivcloudapp");
    pa_context_connect(pa_ctx, NULL,PA_CONTEXT_NOFLAGS, NULL);

s =
pa_stream_new(pa_ctx, "Playback", &ss, NULL);
       if (!s) {
  printf("pa_stream_new failed\n");
​ ​
goto finish;
         ret = 0;
paAttr.maxlength = pa_usec_to_bytes(latency,&ss);
paAttr.tlength = pa_usec_to_bytes(latency,&ss);
paAttr.prebuf = (uint32_t)-1;
paAttr.minreq =  pa_usec_to_bytes(0,&ss)
paAttr.fragsize = (uint32_t)-1;
int r = pa_stream_connect_playback(s, NULL, &paAttr,

Please give direction how we can set low latency ​with pa_simple_api.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20160113/9f5c2859/attachment.html>

More information about the pulseaudio-discuss mailing list