From: Pierre-Louis Bossart Date: Fri, 6 Feb 2015 21:55:52 +0000 (-0600) Subject: ALSA: hda: read trigger_timestamp immediately after starting DMA X-Git-Tag: firefly_0821_release~176^2~2367^2~9 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ed610af86a717152be5aa5e29410c5183992b4f2;p=firefly-linux-kernel-4.4.55.git ALSA: hda: read trigger_timestamp immediately after starting DMA Make sure wallclock counter and trigger timestamp are read very close to each other for better alignment. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c index 27dcb142f596..dfcb5e929f9f 100644 --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c @@ -657,6 +657,9 @@ static int azx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) azx_writel(chip, SSYNC, azx_readl(chip, SSYNC) & ~sbits); if (start) { azx_timecounter_init(substream, 0, 0); + snd_pcm_gettime(substream->runtime, &substream->runtime->trigger_tstamp); + substream->runtime->trigger_tstamp_latched = true; + if (nsync > 1) { cycle_t cycle_last;