From: Takashi Iwai Subject: Re: [PATCH v2] ALSA: hda/ca0132 - Update latency based on DSP state. Date: Fri, 05 Apr 2013 17:22:26 +0200 Message-ID: References: <1365108909-13587-1-git-send-email-dgreid@chromium.org> <515EE730.6080705@linux.intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id A6E9D265FFA for ; Fri, 5 Apr 2013 17:22:27 +0200 (CEST) In-Reply-To: <515EE730.6080705@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Pierre-Louis Bossart Cc: Dylan Reid , alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 05 Apr 2013 10:01:04 -0500, Pierre-Louis Bossart wrote: > > > >> The DSP in the CA0132 codec adds a variable latency to audio depending > >> on what processing is being done. Add a new patch op to return that > >> latency for capture and playback streams. The latency is determined > >> by which blocks are enabled and knowing how much latency is added by > >> each block. > >> > >> Signed-off-by: Dylan Reid > > > > Thanks, applied. > > This conflicts with the audio timestamp stuff I contributed last year. > If the hardware supports a WALLCLK, and HDA does, the timestamp is just > a read of the counter plus a translation to ns. If it doesn't, the > timestamp corresponds to the delay. If you modify the definition of the > delay then the timestamp will be off on some platforms. I thought that the timestamp and the runtime delay are basically independent parameters. Why must the former be disabled? It'd be easy to disable the wallclock, as a patch below. But I don't understand the reason... thanks, Takashi --- diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 31754d2..14d285a 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -2002,6 +2002,8 @@ static int azx_pcm_open(struct snd_pcm_substream *substream) until we figure out how to handle digital inputs */ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) runtime->hw.info &= ~SNDRV_PCM_INFO_HAS_WALL_CLOCK; + else if (hinfo->ops.get_delay) + runtime->hw.info &= ~SNDRV_PCM_INFO_HAS_WALL_CLOCK; spin_lock_irqsave(&chip->reg_lock, flags); azx_dev->substream = substream;