From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: Query regarding snd_pcm_lib_preallocate_pages_for_all() Date: Wed, 14 Nov 2007 09:14:41 +0100 Message-ID: References: <61445c750711131042qed654b8s17454534fdaa68e7@mail.gmail.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 mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 1DF782437B for ; Wed, 14 Nov 2007 13:07:45 +0100 (CET) In-Reply-To: <61445c750711131042qed654b8s17454534fdaa68e7@mail.gmail.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: "Pharaoh ." Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Wed, 14 Nov 2007 00:12:07 +0530, Pharaoh . wrote: > > Hi, > > I am trying to use snd_pcm_lib_preallocate_pages_for_all() on an arm based > platform for preallocating the DMA buffer. > I am using it as > > snd_pcm_lib_preallocate_pages_for_all(pcm, > SNDRV_DMA_TYPE_DEV, > NULL, > 64 * 1024, 64 * 1024); > > since I dont know what should be passed as the 3'rd param. I tried passing > my device pointer i.e. card->dev after > correctly populating it but I get an error as 'DMA coherent mask in not set' > and buffer is not allocated. For ARM, avoid the present buffer-preallocation and mmap functions in ALSA core. Instead you can allocate the buffers directly via normal dma_alloc_coherent() in your driver. And, mmap it via dma_mmap_coherent() by defining the own mmap callback for PCM ops. See other arm/* drivers for rerecence. Takashi