All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Revell <rlrevell@joe-job.com>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: fmoraes@nc.rr.com, alsa-devel <alsa-devel@lists.sourceforge.net>
Subject: Re: buffer/period constraint
Date: Wed, 21 Jul 2004 03:52:38 -0400	[thread overview]
Message-ID: <1090396358.901.52.camel@mindpipe> (raw)
In-Reply-To: <Pine.HPX.4.33n.0407210857590.27864-100000@studcom.urz.uni-halle.de>

On Wed, 2004-07-21 at 03:05, Clemens Ladisch wrote:
> fmoraes@nc.rr.com wrote:
> > [...]
> > I've seen some cases where the buffer size is 1 or 2 frames bigger
> > than n*period_size,
> 
> The hardware must generate interrupts at period boundaries.  In these
> cases, the interrupts would happen at different positions in the
> buffer, over time.
> 
> > so I am not sure how the driver is supposed to handle that.
> 
> The driver mustn't allow this unless the hardware can manage it.
> 
> > Second, is there an easy way to find the current position of the
> > DMA being used?
> 
> In the good ol' times of the ISA bus, the DMA controller knew the
> current position.  On the PCI bus, the DMA is controlled by the card
> itself, so the card should have a register for the current position.
> If there isn't such a register, you have to count interrupts (and hope
> that none are lost).
> 

Look at snd_pcm_update_hw_ptr_interrupt() in
alsa-kernel/core/pcm_lib.c.  This gets called by
snd_pcm_period_elapsed(), which gets called by your interrupt handler. 
If you are trying to reverse engineer the allowed period sizes, this is
a good place to start - do something that you think should set the
period to N and then check the hw_ptr value in that function against
what you think it should be.

If you have to count interrupts, it is pretty easy to figure out whether
you are missing some.  It does happen, a lot.  I hacked the emu10k1
driver to do this, the code is pretty ugly but it does the trick.

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=4721&alloc_id=10040&op=click

      reply	other threads:[~2004-07-21  7:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-20 16:15 buffer/period constraint fmoraes
2004-07-20 16:32 ` Giuliano Pochini
2004-07-21  7:05 ` Clemens Ladisch
2004-07-21  7:52   ` Lee Revell [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=1090396358.901.52.camel@mindpipe \
    --to=rlrevell@joe-job.com \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=clemens@ladisch.de \
    --cc=fmoraes@nc.rr.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.