All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Dylan Reid <dgreid@chromium.org>
Cc: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Subject: Re: [PATCH v2] ALSA: hda/ca0132 - Update latency based on DSP state.
Date: Fri, 05 Apr 2013 16:24:11 -0500	[thread overview]
Message-ID: <515F40FB.4010907@linux.intel.com> (raw)
In-Reply-To: <CAEUnVG4Zu63G+aYm+v90aFwnmW3oHnJGr4VOsK_fd2FBrgY7BA@mail.gmail.com>


> Is the 'audio' timestamp the one calculated in snd_pcm_update_hw_ptr0,
> based on either the hardware or the delay (INFO_HAS_WALL_CLOCK)?

Yes, correct.

>> In other words, if you add the codec delay, it's fine but it needs to be
>> accounted for in a symmetrical manner, otherwise the audio timestamp and the
>> delay will be off by a fixed amount. Correcting the wallclock value and
>> substracting the codec delay in azx_get_wallclk() would realign accounting
>> methods.
>
> Would this problem manifest on systems that don't support wall clock?
> Because the time based on delay will contain the codec delay?

If wall clock is supported, audio timestamp doesn't account for codec delay
If Wall clock is not suported, audio timestamp does account for codec 
delay with your patches.

> There are two distinct use cases:
>
> Wanting to know how the audio clock is drifting with respect to the
> system clock. (don't care about codec delay)
> Wanting to know when a sample will be rendered for AEC or A/V sync.
> (codec delay critical)
>
> Can we keep them from affecting one another?  This seems possible if
> the timestamp and delay are reported separately.

My suggestion is that the audio timestamp always accounts for codec 
delays, which will allow you to track drift and track rendering time. 
Btw for capture wallclocks are disabled for now since we don't really 
know how to use them for digital inputs, and we really need to have a 
consistent behavior for capture and playback.
-Pierre

  reply	other threads:[~2013-04-05 21:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-04 20:55 [PATCH v2] ALSA: hda/ca0132 - Update latency based on DSP state Dylan Reid
2013-04-05  5:40 ` Takashi Iwai
2013-04-05 15:01   ` Pierre-Louis Bossart
2013-04-05 15:22     ` Takashi Iwai
2013-04-05 16:28       ` Pierre-Louis Bossart
2013-04-05 17:01         ` Dylan Reid
2013-04-05 17:20           ` Pierre-Louis Bossart
2013-04-05 18:13             ` Dylan Reid
2013-04-05 21:24               ` Pierre-Louis Bossart [this message]
2013-04-05 21:44                 ` Dylan Reid

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=515F40FB.4010907@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=dgreid@chromium.org \
    --cc=tiwai@suse.de \
    /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.