Re: clarification on mmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Mon, 23 Feb 2009 22:21:24 +0530,
Harsha, Priya wrote:
> 
> Thank you. Can I use .ack callback to know that the mmaped buffer
> has been filled by the user?

Not really.  It's just for explicit read/write modes.

> How would I know how much the user has
> written into the buffer that time?

You can check appl_ptr at any time.  This corresponds to the position
the app has filled.


Takashi

> Would I need to have the pointers
> calculated and tracked myself or is there a field in the structures
> that I can read and find out? 
> 
> -----Original Message-----
> From: Takashi Iwai [mailto:tiwai@xxxxxxx] 
> Sent: Monday, February 23, 2009 8:57 PM
> To: Harsha, Priya
> Cc: alsa-devel@xxxxxxxxxxxxxxxx
> Subject: Re: clarification on mmap
> 
> At Mon, 23 Feb 2009 18:59:11 +0530,
> Harsha, Priya wrote:
> > 
> > Hi,
> > 
> > I have a question on mmap. If I give my .info to be _MMAP and
> > _MMAP_VALID. Will ALSA framework internally take care of mmap-ing
> > the kernel buffer that has been pre-allocated in the .probe call? Do
> > I need to do anything special to mmap a kernel buffer into user
> > space? Just accessing the runtime->dma_area would allow me to access
> > user data right? 
> 
> Yes.  The buffers allocated via preallocator are supposed to be
> mmappable, so you can simply pass _MMAP* flag there.
> 
> 
> Takashi
> 
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux