From: Clemens Ladisch <clemens@ladisch.de>
To: louis@museresearch.com
Cc: alsa-devel@alsa-project.org
Subject: Re: Handling non-buffer-sized MMAP requests
Date: Mon, 13 Dec 2010 09:56:25 +0100 [thread overview]
Message-ID: <4D05DFB9.3080407@ladisch.de> (raw)
In-Reply-To: <6e2495d80bd7915f371b984cc4b4a503.squirrel@master.museresearch.com>
louis@museresearch.com wrote:
> Hi everyone, I'm having some difficulty improving a full-duplex MMAP ALSA
> routine. ALSA sometimes reports more samples available for input than my
> buffer can take, or asks for more samples than I have available. Is this
> a buffer overrun/underrun?
Yes. (And this should happen only when you've disabled stopping on
an xrun, so you've asked for it. :-)
> If I restart the streams in the case that too
> much input is available (on the assumption that it's an xrun) it seems to
> happen at the drop of a hat and makes things worse. If I discard the
> excess input, that doesn't work well either.
>
> What is the appropriate way to deal with this situation?
The best way would be to prevent this situation from happening, i.e.,
read the captured data from the buffer before it overflows.
(In the case of capturing, latency does _not_ depend on the buffer size,
so you should make the buffer as big as possible.)
Regards,
Clemens
next prev parent reply other threads:[~2010-12-13 8:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-09 21:34 Handling non-buffer-sized MMAP requests louis
2010-12-13 8:56 ` Clemens Ladisch [this message]
2010-12-17 18:56 ` louis
2010-12-18 0:32 ` Raymond Yau
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=4D05DFB9.3080407@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=louis@museresearch.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.