[pulseaudio-discuss] Low latency applications

Tanu Kaskinen tanuk at iki.fi
Tue Jun 7 05:58:53 PDT 2011


On Tue, 2011-06-07 at 15:33 +0300, Lasse Kärkkäinen wrote:
> Hi,
> 
> I tried to get as low latency as possible but there is a very 
> significant delay. Could someone please have a look at this simple (and 
> hacky) audio loopback test and point out if it could be changed to run 
> at lower latency? Do not mind the shortcuts taken or the obvious 
> distortion that occurs because capture and playback aren't synchronized 
> - this is simply a minimalistic latency test.
> 
> http://codepad.org/nKNT4SyG
> 
> Another similar test application written directly for ALSA runs with 
> very low latency on the same system (with pasuspender), so it is not a 
> hardware or driver issue. For the record, I am using generic USB 
> microphone for capture and HDA-Intel for playback.

The buffer attributes aren't right. Set fragsize to 0 and maxlength to
-1. If you set fragsize to -1 like you do now, you get the default
latency for capture, which is probably pretty large.

Playback latency can be improved a lot by using pa_stream_begin_write().
I don't know the exact reason why the minimum latency is so large (more
than 100ms) when you don't use that.

-- 
Tanu



More information about the pulseaudio-discuss mailing list