[alsa-devel] ASoC: mmap or read/write?

Clemens Ladisch clemens at ladisch.de
Thu Oct 18 11:09:38 CEST 2012


Prasant J wrote:
> I'm writing an alsa application for recording & playing 16 channel audio.
>
> The application is intended to run on an embedded platform & the
> resources are highly constrained.

Then I wonder how you manage to handle 16 channels.
What hardware is this?

> My application is not performing well with read/write methods.

How much CPU usage?

> Does the mmap method has any advantages over read/write?

No, except when then samples are generated in/consumed from the
device's buffer directly without copying them around, and even then
it's unlikely that the time needed for copying actually matters.

> Is there any thumb rule to decide when to use mmap or read/write?

Yes; use read/write.


Regards,
Clemens


More information about the Alsa-devel mailing list