From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Courtier-Dutton Subject: Re: DMA feature question. Date: Mon, 28 Jun 2004 18:32:58 +0100 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: <40E0564A.3030905@superbug.demon.co.uk> References: <40DD8BD0.40705@superbug.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by alsa.alsa-project.org (ALSA's E-mail Delivery System) with ESMTP id 7473E290 for ; Mon, 28 Jun 2004 18:29:34 +0200 (MEST) In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Takashi Iwai Cc: ALSA development List-Id: alsa-devel@alsa-project.org Takashi Iwai wrote: >>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. The terms "Massive security hole!" comes to mind! > > 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 > > Is a page 1024 bytes or 4096 bytes? Does it vary depending on which type of CPU is in use? Is there a sensible minimum size to set it. I only need to allow for a max of 16 periods per buffer. (does anyone need >16 periods per buffer ? ) There are 4 channels, with 8 bytes per period, that gives 16*4*8 = 512 bytes. Thanks, I will use snd_dma_alloc_pages(). For your info, this is for the AudigyLS driver. Cheers James ------------------------------------------------------- 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