[pulseaudio-discuss] pacmd list-sink-inputs "requested latency" value

Cristian Morales Vega cmorve69 at yahoo.es
Fri Jan 1 09:30:21 PST 2010


Hi,

I'm trying to understand the output from pacmd.
My problem is that pacmd list-sinks outputs: "configured latency: 0,00
ms; range is 56,00 .. 371,52 ms" (no client connected)
And when running the test program from the bottom of this message,
pacmd list-sink-inputs always outputs "requested latency: 56,00 ms".

Testing randomly I found that changing "tlength =
pa_usec_to_bytes(atoi(argv[3]) * 1e3, &ss)," for ".tlength = 2 *
pa_usec_to_bytes(atoi(argv[3]) * 1e3, &ss)," I always get 20 ms less
than what I would expect. So "./pulse-test 48000 2 120" makes pacmd
list-sink-inputs return "requested latency: 100,00 ms".

I'm running PulseAudio 0.9.19 on openSUSE 11.2. Perhaps it's a bug
already fixed in a later versions?


Thanks.


#include <stdio.h>
#include <pulse/simple.h>
#include <pulse/error.h>

int main(int argc, char *argv[]) {
  const pa_sample_spec ss = {
      .format = PA_SAMPLE_S16LE,
      .rate = atoi(argv[1]),
      .channels = atoi(argv[2])
  };

  const pa_buffer_attr buffer_attr = {
       .maxlength = -1,
       .tlength = pa_usec_to_bytes(atoi(argv[3]) * 1e3, &ss),
       .prebuf = -1,
       .minreq = -1,
       .fragsize = -1
  };

  int error = 0;

  pa_simple *s = pa_simple_new(NULL, "test", PA_STREAM_PLAYBACK, NULL,
"test", &ss, NULL, &buffer_attr, &error);
  printf("error: %s\n", pa_strerror(error));
  sleep(15);
}



More information about the pulseaudio-discuss mailing list