From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giuliano Pochini Subject: RE: ALSA PCM DMA questions Date: Fri, 20 May 2005 10:53:03 +0200 (CEST) Message-ID: References: <083AB380E3924D4795740AAE9A27DCABDB962B@cgy2000.interalia.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <083AB380E3924D4795740AAE9A27DCABDB962B@cgy2000.interalia.ca> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Derek Jones Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org On 19-May-2005 Derek Jones wrote: > After the DMA transfer completes, I call snd_pcm_period_elaped(substrea= m). > I'm guessing that this moves a buffer pointer. What I cannot figure out > is how to determine where I am in the buffer so that I can start the ne= xt > DMA from the correct position. Does your hw require restart the DMA after each block ? This is bad. It'= s nearly impossible to do that without a small delay. BTW, the hw should provide a way to know what it is playing/recording. It it doesn't, you ha= ve to count IRQs. If you have to restart the DMA every time, it's simple: ju= st store the current block number when you start it for later use. > When the entire buffer has been DMA'ed, is the buffer overwritten with = new > PCM data from userland During playback, part of the buffer (one or more periods) is filled with new data. snd_pcm_period_elapsed() triggers it. > or does the DMA buffer work like a circular buffer with userland data > being transferred into the buffer at each PCM period. Yes. -- Giuliano. ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=3D7412&alloc_id=3D16344&op=3Dclick