All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Stefan Schoenleitner <dev.c0debabe@gmail.com>
Cc: alsa-devel <alsa-devel@alsa-project.org>
Subject: Re: underruns and POLLERR when copying audio frames
Date: Tue, 20 Jul 2010 15:41:15 +0200	[thread overview]
Message-ID: <4C45A77B.4070802@ladisch.de> (raw)
In-Reply-To: <4C4581D9.8020309@gmail.com>

Stefan Schoenleitner wrote:
> I have some code that basically captures audio frames from one device
> and then writes it for playback to another device.

How do you synchronize the clocks of both devices?

> Ideally mmapped IO could be used for such a task,

Why would mmap be more ideal?

> My idea would be to just increment avail_min to something bigger, so
> that more frames are being buffered before playback starts.
> Would this work ?

Yes; to avoid underruns, try to have buffer as full as possible, and try
to use a bigger buffer.  However, this will increase latency.

To avoid overruns in the capture device, use a bigger buffer, which will
_not_ increase latency.

> 2. Another idea would be to do some buffering on my own in the application.

This is bascially the same as the first idea, except that you have to
manage this buffer yourself.  This might be worthwile if the devices do
not have big enough buffers.


Regards,
Clemens

  reply	other threads:[~2010-07-20 13:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-20 11:00 underruns and POLLERR when copying audio frames Stefan Schoenleitner
2010-07-20 13:41 ` Clemens Ladisch [this message]
2010-07-20 22:50   ` Stefan Schoenleitner
2010-07-21  7:07     ` Clemens Ladisch
2010-07-21 10:20       ` Stefan Schoenleitner
2010-08-02  3:02         ` pl bossart

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=4C45A77B.4070802@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=dev.c0debabe@gmail.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.