[pulseaudio-discuss] Fwd: [LOW LATENCY] PA_simple
Tanu Kaskinen
tanuk at iki.fi
Tue Jan 12 23:44:51 PST 2016
On Wed, 2016-01-13 at 10:19 +0530, Swapnali Patil wrote:
> 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.
The PA_STREAM_ADJUST_LATENCY flag is automatically set for all streams
created with the simple API.
> We tried to set /use
> PA_STREAM_API as mentioned below
> . but it fails in
>
> pa_stream_new
> () 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);
>
> if(!s)
> {
> s =
>
> pa_stream_new(pa_ctx, "Playback", &ss, NULL);
> if (!s) {
> printf("pa_stream_new failed\n");
This will fail, because pa_context_connect() doesn't immediately
establish the connection. You need to monitor the connection state by
setting up a callback with pa_context_set_state_callback().
> Please give direction how we can set low latency with pa_simple_api.
The latency is controlled by the tlength parameter in pa_buffer_attr,
which you pass to pa_simple_new().
--
Tanu
More information about the pulseaudio-discuss
mailing list