From: Takashi Iwai Subject: Re: SNDRV_PCM_INFO_MMAP - what do I need for it? Date: Wed, 16 Jan 2008 18:37:35 +0100 Message-ID: References: <478E2025.8010509@freescale.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 22C8A2433E for ; Wed, 16 Jan 2008 18:37:36 +0100 (CET) In-Reply-To: <478E2025.8010509@freescale.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Timur Tabi Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Wed, 16 Jan 2008 09:17:57 -0600, Timur Tabi wrote: > > My 8610 ASoC driver has this: > > static const struct snd_pcm_hardware fsl_dma_hardware = { > > .info = SNDRV_PCM_INFO_INTERLEAVED, > > This means that MMAP is not enabled. > > I understand what MMAP is, but not from an ALSA driver perspective. If I change > the above line to this: > > .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP | > SNDRV_PCM_INFO_MMAP_VALID, > > what does ALSA do differently? Do I need to define any new functions? From an > application perspective, what is different? It means that the driver supports mmap access to the PCM buffer. In some cases, you need to implement a proper mmap callback. For example, when the coheret (dma) pages are allocated via dma_alloc_coherent and used for the PCM buffer, you need mmap callback for ARM, at least because the default mmap handler in the PCM core doesn't work for ARM. In this case, prepare your own mmap callback and pass it to pcm ops. It should call simply dma_mmap_coherent() appropriately. > Also, does DMIX need MMAP support? Yes, mandatory. Takashi