Re: [LAD] ALSA latency and MMAP

From: Clemens Ladisch <clemens@email-addr-hidden>
Date: Mon Sep 07 2009 - 11:53:49 EEST

Paul Davis wrote:
> if you use read/write, you deliver/receive the data to/from the kernel
> at the time of calling. but there is then an extra buffer inside the
> ALSA midlevel driver code that holds the data till it is needed (in
> both directions).

There is no extra buffer for these functions; snd_pcm_write/read* copy
the data to/from the same hardware buffer that would be used by the mmap
functions.

The only case where there is a separate buffer is when the data written
by the application is not the same as the data to be written to the
hardware, i.e., when using dmix or sample format conversion. But when
using those plugins, the read/write and mmap functions still all use
the same buffer.

Using mmap does not give any latency advantage when the application
copies the data from some other buffer into the hardware buffer, i.e.,
if it does the same as snd_pcm_write.

Best regards,
Clemens
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Mon Sep 7 12:15:02 2009

This archive was generated by hypermail 2.1.8 : Mon Sep 07 2009 - 12:15:02 EEST