On 15.05.2018 21:12, Pierre-Louis Bossart wrote: > On 5/15/18 8:12 AM, Arun Raghavan wrote: >> On Tue, 15 May 2018, at 11:30 AM, Georg Chini wrote: >>> The commit "alsa-util: Set ALSA report_delay flag in >>> pa_alsa_safe_delay()" >>> broke the build on ALSA versions below 1.1.0 because the time stamp >>> configuration function was introduced in 1.1.0. >>> >>> This patch makes the usage of snd_pcm_status_set_audio_htstamp_config() >>> dependent on ALSA version. >>> --- >>> Â src/modules/alsa/alsa-util.c | 8 +++++++- >>> Â 1 file changed, 7 insertions(+), 1 deletion(-) >>> >>> diff --git a/src/modules/alsa/alsa-util.c >>> b/src/modules/alsa/alsa-util.c >>> index b91a0e98..41134ea5 100644 >>> --- a/src/modules/alsa/alsa-util.c >>> +++ b/src/modules/alsa/alsa-util.c >>> @@ -1187,7 +1187,9 @@ int pa_alsa_safe_delay(snd_pcm_t *pcm, >>> snd_pcm_status_t *status, snd_pcm_sframes >>> Â Â Â Â Â size_t abs_k; >>> Â Â Â Â Â int err; >>> Â Â Â Â Â snd_pcm_sframes_t avail = 0; >>> +#if (SND_LIB_VERSION >= ((1<<16)|(1<<8)|0)) /* API additions in 1.1.0 >>> */ >>> Â Â Â Â Â snd_pcm_audio_tstamp_config_t tstamp_config; >>> +#endif >>> Â Â Â Â Â Â pa_assert(pcm); >>> Â Â Â Â Â pa_assert(delay); >>> @@ -1201,11 +1203,15 @@ int pa_alsa_safe_delay(snd_pcm_t *pcm, >>> snd_pcm_status_t *status, snd_pcm_sframes >>> Â Â Â Â Â Â * avail, delay and timestamp values in a single kernel call to >>> improve >>> Â Â Â Â Â Â * timer-based scheduling */ >>> Â +#if (SND_LIB_VERSION >= ((1<<16)|(1<<8)|0)) /* API additions in >>> 1.1.0 */ >>> + >>> Â Â Â Â Â /* The time stamp configuration needs to be set so that the >>> -Â Â Â Â * ALSA code will use the internal delay reported by the driver */ >>> +Â Â Â Â * ALSA code will use the internal delay reported by the driver. >>> +Â Â Â Â * The time stamp configuration was introduced in alsa version >>> 1.1.0. */ >>> Â Â Â Â Â tstamp_config.type_requested = 1; /* ALSA default time stamp >>> type */ >>> Â Â Â Â Â tstamp_config.report_delay = 1; >>> Â Â Â Â Â snd_pcm_status_set_audio_htstamp_config(status, &tstamp_config); >>> +#endif >>> Â Â Â Â Â Â if ((err = snd_pcm_status(pcm, status)) < 0) >>> Â Â Â Â Â Â Â Â Â return err; >>> -- >> >> Looks good. > > Takashi and I mentioned it's not quite right but what can I say... I don't understand - Takashi explicitly stated that the flag needs to be set. So what do you think is not quite right and how should it be?