Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d59b814 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Takashi Iwai
Browse files

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: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent e4940626
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);
	}
 _tstamp_end:
	status->appl_ptr = runtime->control->appl_ptr;
	status->hw_ptr = runtime->status->hw_ptr;