Re: alsa-lib-1.0.16 compile error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Mon, 3 Mar 2008 12:48:11 -0600 (CST),
Stephen Stocker wrote:
> 
> On Mon, 3 Mar 2008, Takashi Iwai wrote:
> 
> > At Sat, 1 Mar 2008 03:58:16 -0600 (CST),
> > Stephen Stocker wrote:
> >>
> >>   Hi.
> >>
> >>   I'm running kernel 2.4.24-ck1, gcc 3.3.4. Trying to compile the
> >>   alsa-lib-1.0.16, I get the following error.
> >
> > Does the patch below fix?
> >
> >
> > Takashi
> >
> > diff -r 14ce0fc9a26d src/pcm/pcm_local.h
> > --- a/src/pcm/pcm_local.h	Fri Feb 29 12:42:57 2008 +0100
> > +++ b/src/pcm/pcm_local.h	Mon Mar 03 18:11:21 2008 +0100
> > @@ -944,13 +944,17 @@ typedef union snd_tmp_double {
> > /* get the current timestamp */
> > static inline void gettimestamp(snd_htimestamp_t *tstamp, int monotonic)
> > {
> > +#ifdef HAVE_CLOCK_GETTIME
> > 	if (monotonic) {
> > 		clock_gettime(CLOCK_MONOTONIC, tstamp);
> > 	} else {
> > +#else
> > 		struct timeval tv;
> >
> > 		gettimeofday(&tv, 0);
> > 		tstamp->tv_sec = tv.tv_sec;
> > 		tstamp->tv_nsec = tv.tv_usec * 1000L;
> > +#ifdef HAVE_CLOCK_GETTIME
> > 	}
> > +#endif
> > }
> >
> 
>    Hi,
>    I'm still getting an error, but slightly different after applying the 
> patch. I'm not sure how to shorten it here without losing some vital 
> message, so here's the complete error:

Looks like your glibc has no CLOCK_MONOTONIC definition although it
has clock_gettime() function.  That's bad.

Try the patch below instead.


Takashi

diff -r 14ce0fc9a26d src/pcm/pcm_file.c
--- a/src/pcm/pcm_file.c	Fri Feb 29 12:42:57 2008 +0100
+++ b/src/pcm/pcm_file.c	Tue Mar 04 11:57:27 2008 +0100
@@ -469,7 +469,7 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, 
 	pcm->poll_fd = slave->poll_fd;
 	pcm->poll_events = slave->poll_events;
 	pcm->mmap_shadow = 1;
-#ifdef HAVE_CLOCK_GETTIME
+#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
 	pcm->monotonic = clock_gettime(CLOCK_MONOTONIC, &timespec) == 0;
 #else
 	pcm->monotonic = 0;
diff -r 14ce0fc9a26d src/pcm/pcm_hw.c
--- a/src/pcm/pcm_hw.c	Fri Feb 29 12:42:57 2008 +0100
+++ b/src/pcm/pcm_hw.c	Tue Mar 04 11:57:27 2008 +0100
@@ -994,7 +994,7 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp,
 	if (SNDRV_PROTOCOL_INCOMPATIBLE(ver, SNDRV_PCM_VERSION_MAX))
 		return -SND_ERROR_INCOMPATIBLE_VERSION;
 
-#ifdef HAVE_CLOCK_GETTIME
+#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
 	if (SNDRV_PROTOCOL_VERSION(2, 0, 9) <= ver) {
 		struct timespec timespec;
 		if (clock_gettime(CLOCK_MONOTONIC, &timespec) == 0) {
diff -r 14ce0fc9a26d src/pcm/pcm_local.h
--- a/src/pcm/pcm_local.h	Fri Feb 29 12:42:57 2008 +0100
+++ b/src/pcm/pcm_local.h	Tue Mar 04 11:57:27 2008 +0100
@@ -944,13 +944,17 @@ typedef union snd_tmp_double {
 /* get the current timestamp */
 static inline void gettimestamp(snd_htimestamp_t *tstamp, int monotonic)
 {
+#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
 	if (monotonic) {
 		clock_gettime(CLOCK_MONOTONIC, tstamp);
 	} else {
+#endif
 		struct timeval tv;
 
 		gettimeofday(&tv, 0);
 		tstamp->tv_sec = tv.tv_sec;
 		tstamp->tv_nsec = tv.tv_usec * 1000L;
+#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
 	}
+#endif
 }

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux