All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Brandon Yates <Brandon.Yates@adaptivedigital.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: Variable Delay through ALSA driver
Date: Wed, 18 Sep 2013 22:16:12 -0500	[thread overview]
Message-ID: <523A6C7C.3010608@linux.intel.com> (raw)
In-Reply-To: <B02206F4ACA2904A8270028316B8DAFF01149AB8@mercury.corp.adaptivedigital.com>

On 9/17/13 3:07 PM, Brandon Yates wrote:
> I have an application using the ALSA API that writes to playback device
> and simultaneously reads from capture device.  My processing loop is :
>
> 1)Read from microphone (blocking)
> 2)Process Data
> 3)Write to speaker
>
> I am measuring the delay from the time I play a series of frames to the
> speaker until I detect the echo of this coming back in through the
> microphone.  This delay seems to be changing every time I initialize the
> devices with ALSA. I have measured in the range of 60-160ms delay.  I
> know things like period size effect delay, but using the exact same
> software and hardware configuration I would expect this to be constant
> across runs.  What are some parameters that can help me make the delay
> deterministic?

snd_pcm_link can help make sure your playback and capture devices start 
at the same time, if supported in hardware (HDAudio works well). 
Otherwise you need a cross-correlation to find out the delay and 
compensate for it in software.
-Pierre

  reply	other threads:[~2013-09-19  3:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-17 20:07 Variable Delay through ALSA driver Brandon Yates
2013-09-19  3:16 ` Pierre-Louis Bossart [this message]
2013-10-25  6:56   ` Using codecs with AND without cpu_dai Mike Looijmans

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=523A6C7C.3010608@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=Brandon.Yates@adaptivedigital.com \
    --cc=alsa-devel@alsa-project.org \
    /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.