[alsa-devel] [PATCH v5 01/10] ALSA: core: don't override timestamp unconditionally

Takashi Iwai tiwai at suse.de
Mon Feb 9 16:05:48 CET 2015


At Fri,  6 Feb 2015 15:55:50 -0600,
Pierre-Louis Bossart wrote:
> 
> 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 at linux.intel.com>

Applied, thanks.


Takashi


> ---
>  sound/core/pcm_native.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
> index ff3abc3..7bbc34d 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;
> -- 
> 1.9.1
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 


More information about the Alsa-devel mailing list