tc->cycle_last = last;
}
-static u64 azx_subtract_codec_delay(struct snd_pcm_substream *substream,
+static u64 azx_adjust_codec_delay(struct snd_pcm_substream *substream,
u64 nsec)
{
struct azx_pcm *apcm = snd_pcm_substream_chip(substream);
codec_nsecs = div_u64(codec_frames * 1000000000LL,
substream->runtime->rate);
+ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+ return nsec + codec_nsecs;
+
return (nsec > codec_nsecs) ? nsec - codec_nsecs : 0;
}
nsec = timecounter_read(&azx_dev->azx_tc);
nsec = div_u64(nsec, 3); /* can be optimized */
- nsec = azx_subtract_codec_delay(substream, nsec);
+ nsec = azx_adjust_codec_delay(substream, nsec);
*ts = ns_to_timespec(nsec);