[pulseaudio-discuss] Example using async API

Lennart Poettering lennart at poettering.net
Mon Oct 5 13:56:43 PDT 2009

On Fri, 02.10.09 18:30, Peter Onion (Peter.Onion at btinternet.com) wrote:

> It seems a bit fussy about how much data you write with each
> pa_stream_write, but it might be my code that is generating the samples
> that is wrong!

It's up to you how much your write. However, it is definitely a good
idea to write at least what has been requested (or is reqturned by
pa_stream_get_writable_size()). If you write less you won't get
another request callback for that, so you might experience drop
outs. You may also write more, which often makes a lot of sense,
i.e. if your app works with a different block size. If you write more
than requested it will be buffered on the server side.


writing less: seldomly makes sense
writing exactly what requested: makes sense if your app's block size is 1 sample
writing more: makes sense if your app's block size is > 1 sample.


Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4

More information about the pulseaudio-discuss mailing list