From 6a42c7656927dca6103abe9a5418394d5af28ea4 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sat, 27 Mar 2021 16:12:42 +0000 Subject: [PATCH] Stop using snd_pcm_status_get_driver_htstamp in the alsa precision timing function. It seems to have changed (?). --- audio_alsa.c | 17 ++++++++++++----- configure.ac | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/audio_alsa.c b/audio_alsa.c index 45a51321..1360619d 100644 --- a/audio_alsa.c +++ b/audio_alsa.c @@ -1455,12 +1455,19 @@ int precision_delay_and_status(snd_pcm_state_t *state, snd_pcm_sframes_t *delay, int ret = snd_pcm_status(alsa_handle, alsa_snd_pcm_status); if (ret == 0) { -// must be 1.1 or later to use snd_pcm_status_get_driver_htstamp -//#if SND_LIB_MINOR == 0 snd_pcm_status_get_htstamp(alsa_snd_pcm_status, &update_timestamp); -//#else -// snd_pcm_status_get_driver_htstamp(alsa_snd_pcm_status, &update_timestamp); -//#endif + +/* +// must be 1.1 or later to use snd_pcm_status_get_driver_htstamp +#if SND_LIB_MINOR != 0 + snd_htimestamp_t driver_htstamp; + snd_pcm_status_get_driver_htstamp(alsa_snd_pcm_status, &driver_htstamp); + uint64_t driver_htstamp_ns = driver_htstamp.tv_sec; + driver_htstamp_ns = driver_htstamp_ns * 1000000000; + driver_htstamp_ns = driver_htstamp_ns + driver_htstamp.tv_nsec; + debug(1,"driver_htstamp: %f.", driver_htstamp_ns * 0.000000001); +#endif +*/ *state = snd_pcm_status_get_state(alsa_snd_pcm_status); diff --git a/configure.ac b/configure.ac index 36697d7a..21ba3cec 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.50]) -AC_INIT([shairport-sync], [3.3.8d5], [4265913+mikebrady@users.noreply.github.com]) +AC_INIT([shairport-sync], [3.3.8d6], [4265913+mikebrady@users.noreply.github.com]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([shairport.c]) AC_CONFIG_HEADERS([config.h])