Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Giuliano Pochini <pochini@shiny.it>
To: Derek Jones <DJones@Interalia.ca>
Cc: alsa-devel@lists.sourceforge.net
Subject: RE: ALSA PCM DMA questions
Date: Fri, 20 May 2005 10:53:03 +0200 (CEST)	[thread overview]
Message-ID: <XFMail.20050520105303.pochini@shiny.it> (raw)
In-Reply-To: <083AB380E3924D4795740AAE9A27DCABDB962B@cgy2000.interalia.ca>


On 19-May-2005 Derek Jones wrote:

> After the DMA transfer completes, I call snd_pcm_period_elaped(substream).
> I'm guessing that this moves a buffer pointer. What I cannot figure out
> is how to determine where I am in the buffer so that I can start the next
> DMA from the correct position.

Does your hw require restart the DMA after each block ?  This is bad. It's
nearly impossible to do that without a small delay. BTW, the hw should
provide a way to know what it is playing/recording. It it doesn't, you have
to count IRQs. If you have to restart the DMA every time, it's simple: just
store the current block number when you start it for later use.


> When the entire buffer has been DMA'ed, is the buffer overwritten with new
> PCM data from userland

During playback, part of the buffer (one or more periods) is filled with
new data. snd_pcm_period_elapsed() triggers it.


> or does the DMA buffer work like a circular buffer with userland data
> being transferred into the buffer at each PCM period.

Yes.


--
Giuliano.


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click

      reply	other threads:[~2005-05-20  8:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-19 21:53 ALSA PCM DMA questions Derek Jones
2005-05-20  8:53 ` Giuliano Pochini [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=XFMail.20050520105303.pochini@shiny.it \
    --to=pochini@shiny.it \
    --cc=DJones@Interalia.ca \
    --cc=alsa-devel@lists.sourceforge.net \
    /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