All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Guilhem Tardy <guilhem_tardy@yahoo.com>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: pcm_lib.c & pcm_memory.c
Date: Tue, 23 Jul 2002 11:32:08 +0200	[thread overview]
Message-ID: <s5hbs8ypz6v.wl@alsa2.suse.de> (raw)
In-Reply-To: <20020722183540.63433.qmail@web11501.mail.yahoo.com>

At Mon, 22 Jul 2002 11:35:40 -0700 (PDT),
Guilhem Tardy wrote:
> 
> Hi all,
> 
> I would have a few questions regarding buffer mgt:
> 
> When is substream->dma_area used for capture or playback? (probably never, as
> snd_pcm_lib_malloc_pages() seems to imply that one should only use
> substream->runtime->dma_area)
 
it's used when the data is copied via copy_from/to_user(), or when the
buffer is mmapped.

please note that you don't need this always.  if you define copy and
silence callbacks, and if they don't handle any dma buffer on the cpu
side (e.g. buffers on a card), then you don't need this.
in such a case, mmap cannot be used.


> Where should captured audio data be copied into runtime->dma_area? Is it up to
> the driver or do capture_copy() and capture_silence() functions take the same
> role as for playback?

yes.  if copy and silence callbacks are defined, then it's up to the
driver.


> When does the pointer to the next playback/capture audio period rewind? I
> noticed that for more than 2 periods_max, this can happen anytime (eg. after 2,
> 3, ...) even before we reached the end of the buffer.

it must be after the hw_ptr reaches the end of the buffer.
please check snd_pcm_update_hw_ptr_interrupt() in pcm_lib.c.


Takashi


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

  reply	other threads:[~2002-07-23  9:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-22 18:35 pcm_lib.c & pcm_memory.c Guilhem Tardy
2002-07-23  9:32 ` Takashi Iwai [this message]
     [not found]   ` <20020724135330.42595.qmail@web11503.mail.yahoo.com>
2002-07-24 14:13     ` Takashi Iwai
2002-07-24 14:27       ` Guilhem Tardy
2002-07-25 19:27   ` Guilhem Tardy

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=s5hbs8ypz6v.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=guilhem_tardy@yahoo.com \
    /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.