ALSA: pcm: generate default audio timestamp
PATCH 1/2 ALSA: pcm: generate default audio timestamp
If there is no get_time_info() available or the requested audio timestamp type is AUDIO_TSTAMP_TYPE_DEFAULT then need to set audio_tstamp_report.actual_type = AUDIO_TSTAMP_TYPE_DEFAULT (in the else clause near the start of snd_pcm_update_hw_ptr0()) in order for update_audio_tstamp() to generate the audio timestamp from the number of frames.
--- sound/core/pcm_lib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/core/pcm_lib.c +3 -1
@@ -289,8 +289,10 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,/* re-test in case tstamp type is not supported in hardware and was demoted to DEFAULT */ if (runtime->audio_tstamp_report.actual_type ==SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT )snd_pcm_gettime (runtime, &curr_tstamp); - }else + }else { + runtime->audio_tstamp_report.actual_type =SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT ;snd_pcm_gettime (runtime, &curr_tstamp); + } }if (pos ==SNDRV_PCM_POS_XRUN ) {
Signature · 1 line
2.31.1
Quoted 9 lines · Alan Young
If there is no
get_time_info()available or the requested audio timestamp type isAUDIO_TSTAMP_TYPE_DEFAULTthen need to set audio_tstamp_report.actual_type =AUDIO_TSTAMP_TYPE_DEFAULT(in the else clause near the start ofsnd_pcm_update_hw_ptr0()) in order forupdate_audio_tstamp()to generate the audio timestamp from the number of frames.Fixes 3179f6200188 ("ALSA: core: add .get_time_info")Signed-off-by [email protected]
It makes sense.
Signature · 2 lines
Jaroslav Kysela <[email protected]> Linux Sound Maintainer; ALSA Project; Red Hat, Inc.