From: Takashi Iwai Subject: Re: Trouble understanding ALSA's DMA buffers Date: Tue, 12 Jun 2007 18:45:26 +0200 Message-ID: References: <466DA941.40309@freescale.com> <8d6898730706111329y666c7abdv5b464cbe4e9bb3b@mail.gmail.com> <466ECB91.2030609@freescale.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 40A6F1037F7 for ; Tue, 12 Jun 2007 18:45:27 +0200 (CEST) In-Reply-To: <466ECB91.2030609@freescale.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: Timur Tabi Cc: alsa-devel@alsa-project.org, Nobin Mathew List-Id: alsa-devel@alsa-project.org At Tue, 12 Jun 2007 11:36:33 -0500, Timur Tabi wrote: > > Takashi Iwai wrote: > > > Yes. And the "ping-poing" is the case that you have two periods in a > > ring buffer. > > Ok, I understand the 'periods' concept now, thanks. > > So when/where does ALSA copy data to the DMA buffer? Isn't there supposed to be some kind > of callback where ALSA calls the driver and says, "here's some data, please copy it to > your DMA buffer?" > > Or does ALSA do all the copying itself whenever the driver calls snd_pcm_period_elapsed()? It depends on the implementation, but usually the latter case. The whole data-transfer task is done by ALSA PCM middle layer, and each driver has to take care of the DMA setup -- as long as your hardware can have a buffer on RAM. If you need to copy the data to hardware buffer manually in some way, the things become complicated... Takashi