All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Dylan Reid <dgreid@chromium.org>, alsa-devel@alsa-project.org
Subject: Re: [PATCH v2] ALSA: hda - Apply codec delay to wallclock.
Date: Thu, 11 Apr 2013 19:17:10 -0600	[thread overview]
Message-ID: <51676096.9000003@linux.intel.com> (raw)
In-Reply-To: <s5hvc7uh0we.wl%tiwai@suse.de>


>> For playback audio_timestamp = wallclk - codec_delay_in_nsec
>> for capture audio_timestamp = wallclk + codec_delay_in_nsec
>
> Hmm...  I'm confused, too.  From a pretty generic view,
>
> - hwptr = the samples (frames) transferred on the (memory) buffer
> - hwptr + PCM delay = the point being currently captured
>
> Which position does the wall clock correspond?

you now have 3 positions:

For capture:
hwptr = sample in memory
hwptr+ delay = sample recorded on link (tracked by LPIB and wallclock)
hwptr+ delay + codec_delay = sample recorded by A/D

For playback
hwptr = next sample in memory to be DMA'ed
hwptr - delay = sample pushed on link (tracked by LPIB and wallclock)
hwptr - delay - codec_delay = sample played in A/D

the wallclock is only at the soc/chipset level, it doesn't know anything 
about the peripheral.
Makes sense?
-Pierre

  reply	other threads:[~2013-04-12  1:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09  1:20 [PATCH v2] ALSA: hda - Apply codec delay to wallclock Dylan Reid
2013-04-09  6:03 ` Takashi Iwai
2013-04-10  3:55 ` Pierre-Louis Bossart
2013-04-10  5:30   ` Dylan Reid
2013-04-10 14:29     ` Pierre-Louis Bossart
2013-04-10 15:16       ` Takashi Iwai
2013-04-12  1:17         ` Pierre-Louis Bossart [this message]
2013-04-12  8:55           ` Takashi Iwai
2013-04-13  8:55             ` Takashi Iwai
2013-04-15  8:02               ` 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=51676096.9000003@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.