[alsa-devel] Query regarding snd_pcm_lib_preallocate_pages_for_all()

Takashi Iwai tiwai at suse.de
Wed Nov 14 09:14:41 CET 2007


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


More information about the Alsa-devel mailing list