[pulseaudio-discuss] latency - from command line and from code

David Henningsson david.henningsson at canonical.com
Mon Jun 10 09:37:57 PDT 2013


On 06/09/2013 01:34 AM, Perry Kivolowitz wrote:
> Hi All,
>
> I have spent a delightful day Googling and reading and have come up
> empty - probably due to my own fault, true.
>
> My test application uses pa_simple to read and write to a USB audio device.
>
> Output appears precisely one second after input begins.
>
> Can you help with pointers to:
> a) a method of configuring latency via argument in configuration files and
> b) a method of configuring latency via custom application
>
> My goal is minimize latency to its lowest level possible (I can adjust
> it within my application, above pulseaudio).
>
> My basic unit of sample data is 128 samples at 48 kHz.
>
> Thank you so much.
>

Hi,

The latency is set in the call to pa_simple_new, the pa_buffer_attr 
parameter, and in that struct, then set tlength to your desired playback 
latency (in bytes). For input you set the fragsize parameter instead.

As for how to write configuration files and custom applications, your 
questions are better directed to mailinglists of the toolkit that you're 
using (glib, gtk, qt etc).

-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic


More information about the pulseaudio-discuss mailing list