From: Takashi Iwai Subject: Re: What is the format of dma_area? Date: Fri, 07 Oct 2005 12:08:15 +0200 Message-ID: References: <4345E865.9060102@billgatliff.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mx2.suse.de (ns2.suse.de [195.135.220.15]) by alsa.jcu.cz (ALSA's E-mail Delivery System) with ESMTP id 6447A173 for ; Fri, 7 Oct 2005 12:08:20 +0200 (MEST) In-Reply-To: <4345E865.9060102@billgatliff.com> 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: Bill Gatliff Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 06 Oct 2005 22:15:49 -0500, Bill Gatliff wrote: > > Guys: > > > I'm trying to write a PCM driver that uses an AC97 codec, on an ARM > host, but no DMA. (Please pardon some of my terminology, I'm a bit of > an ALSA noob). > > My trigger() looks something like this: > > int *buffer; > int bytes; > ... > switch (cmd) { > case SNDRV_PCM_TRIGGER_START: > bytes = frames_to_bytes(substream->runtime, > substream->runtime->period_size); > buffer = substream->runtime->dma_area; > ... > > Then, I copy *buffer++ out to the codec one 32-bit chunk (truncated to > 20 bits) at a time. > > One thing I don't understand is how dma_area is formatted. Is it a > stream of integers, like this? > > int dma_area[channels][samples]; It's called "non-interleaved" format in general. > ... or like this? > > int dma_area[samples][channels]; It's "interleaved" format. It's up to you and hardware. Set the appropriate bit flag in pcm hardware info field. Takashi ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl