[pulseaudio-discuss] PA_STREAM_ADJUST_LATENCY with Simple API?

Cristian Morales Vega cmorve69 at yahoo.es
Fri May 22 18:32:06 PDT 2009


Hi,

I just wanted to know if there is a way to use the
PA_STREAM_ADJUST_LATENCY flag using the simple API.
I see that pa_simple_new() has a parameter for pa_buffer_attr, but no
for pa_stream_flags_t. Why I would want to specify the server buffer
size? I only want to specify the size because of the latency, isn't
that the common case? Perhaps PA_STREAM_ADJUST_LATENCY is the default
when using the simple API?

The app is a game console emulator. It doesn't needs anything special,
only a low latency so video and audio are in sync.
Right now the code is just an init() function that calls
pa_simple_new() and a sample() function that does this:

void sample(uint16_t left, uint16_t right) {
  if(!device.handle) return;

  buffer.data[buffer.offset++] = left + (right << 16);
  if(buffer.offset >= 64) {
    int error;
    pa_simple_write(device.handle, (const void*)buffer.data,
buffer.offset * sizeof(uint32_t), &error);
    buffer.offset = 0;
  }
}

I would really like to keep the simple API, if I could specify the
full latency I would not need to touch more than one or two lines.
But... it is possible?


Thanks.



More information about the pulseaudio-discuss mailing list