Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jaroslav Kysela <perex@suse.cz>
Cc: Giuliano Pochini <pochini@shiny.it>,
	alsa-devel <alsa-devel@lists.sourceforge.net>
Subject: Re: period crossing page boundary
Date: Thu, 20 Mar 2003 15:45:14 +0100	[thread overview]
Message-ID: <s5hvfyeqepx.wl@alsa2.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0303201517030.1318-100000@pnote.perex-int.cz>

At Thu, 20 Mar 2003 15:24:20 +0100 (CET),
Jaroslav wrote:
> 
> On Thu, 20 Mar 2003, Giuliano Pochini wrote:
> 
> > 
> > >> Ok, but how do I build the sg list when bufsize!=sz*periods ? Take
> > >> the example above: have I to build 4 periods and let the last one
> > >> smaller than 22052 ?
> > >
> > > it depends on the hardware.
> > 
> > There are no hw constraints IFAIK, but the hw does not provide the
> > current dma address. It tells me how many bytes it transferred from
> > the trigger-start command, so I need a way to translate that number
> > into a frame pointer inside the buffer. To do that I must know
> > exactly how long is the buffer to build the sg list and to stranslate
> > the byte count in the pointer callback. (it's not enough see below)
> > What does alsa expect from .pointer() ? [0-bufsz] or [0-pe*sz] ?
> 
> 0 ... buffer_size
 
more accurately, 0 to (buffer_size - 1) :)

> > > if you need to set up a buffer-descriptor list like via82xx, the above
> > > h/w constraint (integer periods) will be most likely necessary.
> > > then the buffer size will be aligned to the period size
> > > automatically.
> > 
> > It's a quick and simple way to make things work, but it should't
> > be necessary.
> > The driver currently behaves correctly in two cases:
> > 
> > a - period size is a multiple of PAGE_SIZE
> > b - PAGE_SIZE is a multiple of period size
> >
> > In both cases periods*periodsize matches buffer_size. But if
> > periods*periodsize==buffer_size and !a and !b (eg. pe=4, psz=6K,
> > bufsz=24K), it doesn't work:
> > 
> > page0 per0[0-4095]
> > page1 per0[4096-6143] per1[0-2048]
> > page2 per1[2048-6143]
> > ...
> 
> Note that you'll have to call snd_pcm_period_elapsed() only after the 
> whole period is elapsed and not fragment of it.

and just make sure: if the buffer is linear, does this period size
work?


Takashi


-------------------------------------------------------
This SF.net email is sponsored by: Tablet PC.  
Does your code think in ink? You could win a Tablet PC. 
Get a free Tablet PC hat just for playing. What are you waiting for? 
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en

      reply	other threads:[~2003-03-20 14:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-19 12:24 period crossing page boundary Giuliano Pochini
2003-03-19 17:06 ` Takashi Iwai
2003-03-19 21:06   ` Giuliano Pochini
2003-03-19 20:16     ` Jaroslav Kysela
2003-03-20  9:04       ` Giuliano Pochini
2003-03-20 10:37         ` Takashi Iwai
2003-03-20 14:13           ` Giuliano Pochini
2003-03-20 14:24             ` Jaroslav Kysela
2003-03-20 14:45               ` 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=s5hvfyeqepx.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=perex@suse.cz \
    --cc=pochini@shiny.it \
    /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