From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: DMA feature question. Date: Mon, 28 Jun 2004 17:57:48 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <40DD8BD0.40705@superbug.demon.co.uk> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from Cantor.suse.de (cantor.suse.de [195.135.220.2]) by alsa.alsa-project.org (ALSA's E-mail Delivery System) with ESMTP id 568F624B for ; Mon, 28 Jun 2004 17:57:49 +0200 (MEST) In-Reply-To: <40DD8BD0.40705@superbug.demon.co.uk> Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: James Courtier-Dutton Cc: ALSA development List-Id: alsa-devel@alsa-project.org At Sat, 26 Jun 2004 15:44:32 +0100, James Courtier-Dutton wrote: > > I have a sound card that requires access to 2 DMA areas per substream. > 1) Is for the audio samples buffer. I can already do that with: > > err = snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV, > snd_dma_pci_data(emu->pci), 32*1024, 32*1024); > > > 2) Is for a table of periods.. > This table will contain:- > { u32 Pointer_into_samples_buffer, > u32 number_of_bytes } > So, each record in the table is 8 bytes long, and identify each period > in the buffer. > > So, the table will contain a list of the different periods. > So, if there are 8 periods, the table will have 8 entries, each 8 bytes > long, so I will need a DMA map for 64 bytes. > > Is there any way to use the snd_pcm_lib_preallocate_pages() for this > "table or periods". No. It's for the DMA buffer only. > If not, I will just have to make (1) a bit bigger, and place the "table > of periods" in there. I don't think it's a good idea. The buffer will be mmapped to the user-space, and obviously you don't want to expose it. I'd suggest to allocate a table (one page should be large enough) via snd_dma_alloc_pages() statically at the driver initialization, and sets the max. number of periods according to the page size. Takashi ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com