All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Manuel Jander <mjander@embedded.cl>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Scatter Gather and odd period sizes.
Date: Mon, 17 Mar 2003 17:14:26 +0100	[thread overview]
Message-ID: <s5hwuiyt1gd.wl@alsa2.suse.de> (raw)
In-Reply-To: <3E742357.5050107@embedded.cl>

At Sun, 16 Mar 2003 03:10:15 -0400,
Manuel Jander wrote:
> 
> Hello,
> 
> I'm writing Scatter Gather support for the Aureal Vortex,
> and the problem is that i get period sizes that dont match
> the page size. That is not so bad, but the page count doesnt
> match the period count either.
> 
> How are the pages mapped on the buffer ?? I dont see any chance
> that could work. Why arent the page count at least equal to the
> period count ?

you can define such a hw_constraint function.
but...

normal ALSA drivers use a phyiscally or virtually linear pcm buffer.
most of drivers allocate a phyically continous buffer, and the drivers
supporting sg-buffer, such as emu10k1 or via82xx, map the distinct
kernel pages (its size depending on the architecture, 4Kbyte on i386)
onto the virtually linear address.  emu10k1 and trident have its own
page table and can use the sg-buffer simply as a linear buffer.
meanwhile, via82xx (and intel8x0) have the buffer-descriptor, and on
ALSA driver, the periods are split to 4k byte boundary if the size
isn't aligned to 4k page size.

however, a driver does NOT have to use a linear buffer;  this
condition is necessary only for supporting mmap.  if your driver
doesn't support mmap, it's ok to use a completely non-contiguous
buffer.  you'll need to define copy/silence callbacks appropriately
for copying the play/capture data and setting the silence data.

i'm not sure how the aureal driver works.  IIRC, it can use up to 4 x
4k pages, right?  if its size is really only 4 pages, i'd recommend to
use a simple phyically linear buffer.


Takashi


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en

  reply	other threads:[~2003-03-17 16:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-16  7:10 Scatter Gather and odd period sizes Manuel Jander
2003-03-17 16:14 ` Takashi Iwai [this message]
     [not found] <200303171612.AA25887592@embedded.cl>
2003-03-18 11:33 ` Takashi Iwai

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=s5hwuiyt1gd.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=mjander@embedded.cl \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.