[alsa-devel] Can I mmap buffer allocated using SNDRV_DMA_TYPE_CONTINUOUS?

Pharaoh . pharaoh137 at gmail.com
Thu Jul 12 16:19:47 CEST 2007


Okay got it...I am currently using the mmap APIs given in
arm/mm/consistant.c and they seem to work as expected. Basically I am
not preallocating using ALSA provided API, rather I am using dma
allocation functions given in the same file and the buffer mmaps well.

-pharaoh.

On 7/12/07, Takashi Iwai <tiwai at suse.de> wrote:
> At Thu, 12 Jul 2007 19:24:24 +0530,
> Pharaoh . wrote:
> >
> > okay, I am on ARM..so better I do not use preallocation scheme with
> > CONTINUOUS flag in case I want to mmap my dma buffer. In fact, I tried
> > mmaping it, but it didn't work as expected.
>
> On ARM, the mmap support is a bit tricky, so far.
> The preallocation itself should work with SNDRV_DMA_TYPE_TYPE_DEV.
> But you'd need the mmap PCM ops to call dma_mmap_coherent() there
> instead of the default ALSA mmap handler.
>
>
> Takashi
>
> >
> > On 7/12/07, Takashi Iwai <tiwai at suse.de> wrote:
> > > At Wed, 11 Jul 2007 18:17:49 +0530,
> > > Pharaoh . wrote:
> > > >
> > > > On 7/11/07, Pharaoh . <pharaoh137 at gmail.com> wrote:
> > > > >
> > > > > Hi,
> > > > > I have allocated the DMA buffer using snd_pcm_lib_malloc_pages() and
> > > > > it was preallocated as:
> > > > >
> > > > > snd_pcm_lib_preallocate_pages_for_all(pcm,
> > > > >
> SNDRV_DMA_TYPE_CONTINUOUS,
> > > > >                                              snd_dma_continuous_data
> > > > >                                              (GFP_KERNEL),
> > > > >                                              128 * 1024, 128 *
> 1024);
> > > > >
> > > > > Can I mmap such a dma buffer? I think yes...
> > > > >
> > > > > -pharaoh.
> > > > >
> > > >
> > > >
> > > > I dont think it can be mmapped.
> > >
> > > It can be basically, but not on all architectures.
> > > For example, ARM has a problem with coherency.
> > >
> > >
> > > Takashi
> > >
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel at alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> >
>


More information about the Alsa-devel mailing list