From mboxrd@z Thu Jan 1 00:00:00 1970 From: Clemens Ladisch Subject: Re: ASoC: mmap or read/write? Date: Thu, 18 Oct 2012 11:09:38 +0200 Message-ID: <507FC752.1050005@ladisch.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by alsa0.perex.cz (Postfix) with ESMTP id D374F2625FC for ; Thu, 18 Oct 2012 11:10:56 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Prasant J Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org 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