There are no samples to play at that point so this is useless. The non-zero buffer_attr.prebuf ensures that the PulseAudio daemon will start streaming automatically (like ALSA sw_params start_threshold). --- pulse/pcm_pulse.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c index 24fd4da..0165120 100644 --- a/pulse/pcm_pulse.c +++ b/pulse/pcm_pulse.c @@ -204,8 +204,8 @@ static void stream_success_cb(pa_stream * p, int success, void *userdata) static int pulse_start(snd_pcm_ioplug_t * io) { snd_pcm_pulse_t *pcm = io->private_data; - pa_operation *o, *u; - int err = 0, err_o = 0, err_u = 0; + pa_operation *o; + int err = 0, err_o = 0;
assert(pcm);
@@ -224,18 +224,12 @@ static int pulse_start(snd_pcm_ioplug_t * io) goto finish; }
- u = pa_stream_trigger(pcm->stream, stream_success_cb, pcm); - pcm->underrun = 0; err_o = pulse_wait_operation(pcm->p, o); - if (u) - err_u = pulse_wait_operation(pcm->p, u);
pa_operation_unref(o); - if (u) - pa_operation_unref(u);
- if (err_o < 0 || err_u < 0) { + if (err_o < 0) { err = -EIO; goto finish; }