On Monday, June 18, 2012 11:18:45 AM Andrew Eikum wrote:
Is there any guarantee that Pulse /will/ give us a sufficient buffer? From the API docs[1], it just "tries to assure" that we have the requested buffer size, which actually means nothing.
It "tries to assure that at least tlength bytes are always available in the per-stream server-side playback buffer". You get the buffer size you ask for with tlength, and the server does what it can to make sure that's how many bytes are waiting in the buffer (by sending write requests at the appropriate times to keep it filled, specifying the unused portion of the buffer as writable, etc).
It doesn't mean the buffer itself can be smaller than what you asked for, just that the number of bytes waiting in it may be. The buffer size can increase up to maxlength, and that can be something like 2 or more seconds.
And even worse, Pulse's API doesn't let us set both the buffer size and the latency[2].
The buffer size can grow as-needed, up to maxlength. The initial size won't restrict you in any way. If you set maxlength to -1, Pulse will set it to the max size supported by the server.
There should be no issue with PulseAudio supporting buffer sizes as large as mmdevapi would want.