[alsa-devel] POSIX clocks and ALSA

Jaroslav Kysela perex at perex.cz
Tue Dec 4 17:26:19 CET 2007


On Mon, 26 Nov 2007, Heikki Lindholm wrote:

> 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? 

Looking at sources, we talking about a 0.9.0rc8 change.

> 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! :)

This ioctl is used only by alsa-lib and the post 0.9.0rc8 code checks for 
PCM API version, so we should not have any problem except with the binary 
compatibility with 0.9.0rc libraries.

Ok, I'll remove GETTIMEOFDAY1 and commit code to HG tree.

						Jaroslav

-----
Jaroslav Kysela <perex at perex.cz>
Linux Kernel Sound Maintainer
ALSA Project


More information about the Alsa-devel mailing list