Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: James Courtier-Dutton <James@superbug.demon.co.uk>
Cc: ALSA development <alsa-devel@alsa-project.org>
Subject: Re: DMA feature question.
Date: Mon, 28 Jun 2004 18:48:26 +0200	[thread overview]
Message-ID: <s5heknzd3xh.wl@alsa2.suse.de> (raw)
In-Reply-To: <40E0564A.3030905@superbug.demon.co.uk>

At Mon, 28 Jun 2004 18:32:58 +0100,
James Courtier-Dutton wrote:
> 
> 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?

4k on i386.

>  Does it vary depending on which type 
> of CPU is in use?

Yes, but 4k is minimal, so far.

>  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.

Then a single page should suffice.
(of course you can add a code to check the page size to be sure.)


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

      reply	other threads:[~2004-06-28 16:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-26 14:44 DMA feature question James Courtier-Dutton
2004-06-28 15:57 ` Takashi Iwai
2004-06-28 17:32   ` James Courtier-Dutton
2004-06-28 16:48     ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5heknzd3xh.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=James@superbug.demon.co.uk \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox