From: Takashi Iwai Subject: Re: clarification on mmap Date: Tue, 24 Feb 2009 07:49:21 +0100 Message-ID: References: <200902211659.48009.linux@dadeos.co.uk> <98769532B4BB14429434178695419EAE31FCFB62@bgsmsx501.gar.corp.intel.com> <98769532B4BB14429434178695419EAE31FCFCB0@bgsmsx501.gar.corp.intel.com> <98769532B4BB14429434178695419EAE31FD01A2@bgsmsx501.gar.corp.intel.com> <98769532B4BB14429434178695419EAE31FD024D@bgsmsx501.gar.corp.intel.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 (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id D157024579 for ; Tue, 24 Feb 2009 07:49:21 +0100 (CET) In-Reply-To: <98769532B4BB14429434178695419EAE31FD024D@bgsmsx501.gar.corp.intel.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: "Harsha, Priya" Cc: "alsa-devel@alsa-project.org" List-Id: alsa-devel@alsa-project.org At Tue, 24 Feb 2009 10:43:54 +0530, Harsha, Priya wrote: > > I have another question on the same. > > What are the runtime->transfer_ack_begin and transfer_ack_end used > for? I don't know, too, why these were introduced :) It's nowhere used. We should remove them, I think. > Will this help me understand when the runtime->dma_area are > updated be it MMAPed buffer or not. No, they are callbacks called from snd_pcm_period_elapsed(). And snd_pcm_period_elapsed() is the function the driver must call to update the buffer. Takashi > > Thanks, > Harsha > > > -----Original Message----- > From: alsa-devel-bounces@alsa-project.org [mailto:alsa-devel-bounces@alsa-project.org] On Behalf Of Harsha, Priya > Sent: Tuesday, February 24, 2009 10:24 AM > To: Takashi Iwai > Cc: alsa-devel@alsa-project.org > Subject: Re: [alsa-devel] clarification on mmap > > Thanks Takashi. Then what would be the best way to know when the mmaped buffer has been filled. So that I can take action to send it to the hardware? > > Should I use the runtime->control->appl_ptr or runtime->status->appl_ptr to get the position the app has filled? > > -----Original Message----- > From: Takashi Iwai [mailto:tiwai@suse.de] > Sent: Tuesday, February 24, 2009 12:55 AM > To: Harsha, Priya > Cc: alsa-devel@alsa-project.org > Subject: Re: clarification on mmap > > 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@suse.de] > > Sent: Monday, February 23, 2009 8:57 PM > > To: Harsha, Priya > > Cc: alsa-devel@alsa-project.org > > 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@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >