<div dir="ltr">Found this just after I sent the email: <div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">To make sure that a particular stream doesn't stop to play when a server side buffer underrun happens on it while the other synchronized streams continue playing and hence deviate, you need to pass a "prebuf" pa_buffer_attr of 0 when connecting it.</blockquote><div><br></div></div><div>from <a href="http://freedesktop.org/software/pulseaudio/doxygen/streams.html#sync_streams">http://freedesktop.org/software/pulseaudio/doxygen/streams.html#sync_streams</a></div><div><br></div><div>I tried setting `prebuf` to 0 instead of `(uint_t) -1` and it looks like that did the trick.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 4, 2015 at 8:06 PM, Andrew Kelley <span dir="ltr"><<a href="mailto:superjoe30@gmail.com" target="_blank">superjoe30@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have a program which plays an audio file with some filtering using the PulseAudio asynchronous API. When the CPU usage spikes elsewhere in my computer, for example if I do `make -j` to use up all processing power, the filter code runs a little slow and might cause a buffer underrun. Sometimes this causes PulseAudio to stop calling the write callback. I checked and I am certainly calling `begin_write` and `write` for each time that the write callback is called.<div><br></div><div>How can I ensure that PulseAudio continues to call the write callback?</div></div>
</blockquote></div><br></div>