[alsa-devel] [PATCH v2] ALSA: hda/ca0132 - Update latency based on DSP state.

Takashi Iwai tiwai at suse.de
Fri Apr 5 17:22:26 CEST 2013


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 <dgreid at chromium.org>
> >
> > 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;


More information about the Alsa-devel mailing list