All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Revell <rlrevell@joe-job.com>
To: Davy Durham <pubaddr@davyandbeth.com>
Cc: mjander@users.sourceforge.net,
	alsa-devel <alsa-devel@lists.sourceforge.net>
Subject: Re: buffers, periods, cycles.. oh my!
Date: Sat, 04 Sep 2004 22:13:18 -0400	[thread overview]
Message-ID: <1094350398.6575.573.camel@krustophenia.net> (raw)
In-Reply-To: <413A6E07.90403@davyandbeth.com>

On Sat, 2004-09-04 at 21:38, Davy Durham wrote:
> Manuel Jander wrote:
> >One second of buffer time... that would be around 176KB ! I very doubt
> >that any soundcard would handle that. If you want such a large buffer, i
> >guess you will need a own buffer implementation in your app. Are you
> >really sure that you need such a large buffer ? Remember that disk
> >drivers and filesystem I/O layers provide additional buffers, so you
> >don't have to bother about actual hardware latencies.
> >
> >  
> >
> Well I figured that if it's a software buffering implementation then 
> what does the software much care about how much buffer time I ask for.
> Now, I'm pretty sure I've got an 8k buffer working, so whatever the 
> buffering mechanism is, it's not straight DMA which was limited by 4k 
> you said.

I believe you are each referring to a different buffer.  "Buffer" in
ALSA terminology almost always refers to the DMA buffer, which is the
one that is divided into periods, etc.  Your app would read() (or
better, mmap()) the capture data from the DMA buffer into a much larger
buffer in memory, then it would get written out from there to the disk. 
This should be done by two different threads so that delays in disk
output will not cause you to lose audio data.

8K buffer works because you have 2 (or more) periods per buffer, and
your app can only "see" one period at a time, because the hardware will
be DMA'ing to/from the other half.

Lee




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

  reply	other threads:[~2004-09-05  2:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-28  5:46 buffers, periods, cycles.. oh my! Davy Durham
     [not found] ` <1093718182.2150.26.camel@localhost>
2004-08-28 23:52   ` Davy Durham
2004-08-29  0:08   ` Davy Durham
2004-08-29 16:48     ` Paul Davis
2004-08-30 21:53       ` Davy Durham
     [not found]         ` <1094237841.2082.22.camel@localhost>
2004-09-05  1:38           ` Davy Durham
2004-09-05  2:13             ` Lee Revell [this message]
2004-08-29 16:50     ` Manuel Jander

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=1094350398.6575.573.camel@krustophenia.net \
    --to=rlrevell@joe-job.com \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=mjander@users.sourceforge.net \
    --cc=pubaddr@davyandbeth.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.