--- mypulse.c 2009-12-21 19:34:22.564248142 +0100 +++ ao_pulse.c 2009-12-21 19:54:07.409247246 +0100 @@ -39,6 +39,9 @@ "server", "sink" }; +/* This is the smallest audio sound we are expected to play immediately +without buffering. */ +#define PA_MIN_AUDIO_LENTH 100 static ao_info ao_pulse_info = { AO_TYPE_LIVE, @@ -140,7 +143,12 @@ const char *fn = NULL; ao_pulse_internal *internal; struct pa_sample_spec ss; - + pa_buffer_attr buffAttr; + buffAttr.maxlength = (uint32_t)-1; + buffAttr.tlength = PA_MIN_AUDIO_LENTH; + buffAttr.prebuf = (uint32_t)-1; + buffAttr.minreq = (uint32_t)-1; + buffAttr.fragsize = (uint32_t)-1; assert(device && device->internal && format); internal = (ao_pulse_internal *) device->internal; @@ -166,7 +174,7 @@ snprintf(t2, sizeof(t2), "libao[%s] playback stream", fn); } - if (!(internal->simple = pa_simple_new(internal->server, fn ? t : "libao", PA_STREAM_PLAYBACK, internal->sink, fn ? t2 : "libao playback stream", &ss, NULL, NULL, NULL))) + if (!(internal->simple = pa_simple_new(internal->server, fn ? t : "libao", PA_STREAM_PLAYBACK, internal->sink, fn ? t2 : "libao playback stream", &ss, NULL, &buffAttr, NULL))) return 0; device->driver_byte_format = AO_FMT_NATIVE;