Re: [LAD] ALSA latency and MMAP

From: Jussi Laako <jussi@email-addr-hidden>
Date: Thu Sep 24 2009 - 00:16:45 EEST

Clemens Ladisch wrote:
> To decrease that output buffering latency, make sure that there is less
> valid data in the buffer when you are writing. This is initially
> determined by the amount of data you put into the buffer before starting
> streaming, and can be later adjusted with snd_pcm_forward/rewind().

How it should work on ALSA as well as OSS for low latency:

1) Set period size to something suitable
2) Set number of periods to 2
3) Write two periods of silence to output
3.5) Optionally trigger-start both input and output
4) Block on input until period available
5) Process the input
6) Write period to the output
By this time, first of originally written periods has been played and
second is playing, now the second half of the "double buffer" gets
filled. Input buffer doesn't ever have more than one period.

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Thu Sep 24 04:15:02 2009

This archive was generated by hypermail 2.1.8 : Thu Sep 24 2009 - 04:15:04 EEST