diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2015-02-06 22:55:50 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-02-09 16:01:21 +0100 |
commit | 0d59b814353d397ff5d00ac33acd536030252a98 (patch) | |
tree | f0204a290125e413b8ad4b07c89bcc231bd784c4 /sound/core | |
parent | ALSA: off by one bug in snd_riptide_joystick_probe() (diff) | |
download | linux-0d59b814353d397ff5d00ac33acd536030252a98.tar.xz linux-0d59b814353d397ff5d00ac33acd536030252a98.zip |
ALSA: pcm: don't override timestamp unconditionally
timestamp in RUNNING mode is already taken in update_hw_ptr routine,
getting a new timestamp introduces offset between hw_ptr, audio_tstamp
and system time
Add else condition to read timestamp as fallback and only when
enabled
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/pcm_native.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 932234d87927..4ecd35fbfe3f 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -720,8 +720,11 @@ int snd_pcm_status(struct snd_pcm_substream *substream, runtime->status->audio_tstamp; goto _tstamp_end; } + } else { + /* get tstamp only in fallback mode and only if enabled */ + if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) + snd_pcm_gettime(runtime, &status->tstamp); } - snd_pcm_gettime(runtime, &status->tstamp); _tstamp_end: status->appl_ptr = runtime->control->appl_ptr; status->hw_ptr = runtime->status->hw_ptr; |