[alsa-devel] POSIX clocks and ALSA

Heikki Lindholm holindho at cs.helsinki.fi
Mon Nov 26 17:04:56 CET 2007


Jaroslav Kysela kirjoitti:
> On Mon, 26 Nov 2007, Heikki Lindholm wrote:
> 
>> I had a look at the proposal and the thread at
>> http://thread.gmane.org/gmane.linux.alsa.devel/45237/focus=45573
> 
> My initial implementation following proposal is bellow for review and 
> comments. I also changed timestamps for ALSA timers to use monotonic 
> clocks (can be switched back using a module parameter).
> 
> 					Jaroslav
> 
> diff -r 5e8cab953031 core/pcm_lib.c
> --- a/core/pcm_lib.c	Mon Nov 26 09:00:56 2007 +0100
<...>
> diff -r 5e8cab953031 include/asound.h
> --- a/include/asound.h	Mon Nov 26 09:00:56 2007 +0100
> +++ b/include/asound.h	Mon Nov 26 15:02:57 2007 +0100
> @@ -435,6 +435,13 @@ struct snd_xfern {
>  };
>  
>  enum {
> +	SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0,	/* gettimeofday equivalent */
> +	SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY1,	/* for compatibility, equal to zero */
> +	SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,	/* posix_clock_monotonic equivalent */
> +	SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
> +};

Looks good otherwise, but I'd still like to argue about this 
compatibility point: compatibility with what exactly? When was 
PCM_TSTAMP ioctl deprecated? Before 1.0.0? Has anyone *ever* used it? 
And so, is there any point in adding something not-so-pretty to a new 
feature right from the start. Just declare legacy TSTAMP ioctl users 
scr*wed! :)

The good thing is that this change has, AFAICS, nothing contradicting 
with redesigning the timestamp API, so that could be left open and this 
stuff still applied.

-- Heikki Lindholm



More information about the Alsa-devel mailing list