diff -Naur esound-0.2.32.orig/acconfig.h esound-0.2.32/acconfig.h --- esound-0.2.32.orig/acconfig.h 2003-08-01 09:56:21.000000000 -0400 +++ esound-0.2.32/acconfig.h 2004-02-02 08:53:54.000000000 -0500 @@ -8,6 +8,8 @@ #undef DRIVER_ALSA #undef DRIVER_NEWALSA #undef DRIVER_ALSA_09 +#undef DRIVER_ALSA_09_AFTER_RC4 +#undef ALSA_PCM_NEW_HW_PARAMS_API #undef DRIVER_DART #undef DRIVER_COREAUDIO #undef DRIVER_NONE diff -Naur esound-0.2.32.orig/audio_alsa09.c esound-0.2.32/audio_alsa09.c --- esound-0.2.32.orig/audio_alsa09.c 2003-03-20 03:34:19.000000000 -0500 +++ esound-0.2.32/audio_alsa09.c 2004-02-02 08:58:18.000000000 -0500 @@ -94,7 +94,11 @@ snd_pcm_hw_params_t *hwparams; int err; int periods; - +#ifdef DRIVER_ALSA_09_AFTER_RC4 + int t_dir, t_speed; + snd_pcm_uframes_t t_bufsize; +#endif + err = snd_pcm_open(&handle, dev, mode, SND_PCM_NONBLOCK); if (err < 0) { if (alsadbg) @@ -136,15 +140,24 @@ alsaerr = -1; return handle; } - +#ifndef DRIVER_ALSA_09_AFTER_RC4 err = snd_pcm_hw_params_set_rate_near(handle, hwparams, speed, 0); +#else + t_dir=0; + t_speed=speed; + err = snd_pcm_hw_params_set_rate_near(handle, hwparams, &t_speed, &t_dir); +#endif if (err < 0) { if (alsadbg) fprintf(stderr, "%s\n", snd_strerror(err)); alsaerr = -1; return handle; } +#ifndef DRIVER_ALSA_09_AFTER_RC4 if (err != speed) { +#else + if (t_speed != speed) { +#endif if (alsadbg) fprintf(stderr, "Rate not avaliable %i != %i\n", speed, err); alsaerr = -1; @@ -176,8 +189,12 @@ alsaerr = -1; return handle; } - +#ifndef DRIVER_ALSA_09_AFTER_RC4 err = snd_pcm_hw_params_set_buffer_size_near(handle, hwparams, BUFFERSIZE); +#else + t_bufsize=BUFFERSIZE; + err = snd_pcm_hw_params_set_buffer_size_near(handle, hwparams, &t_bufsize); +#endif if (err < 0) { if (alsadbg) fprintf(stderr, "Buffersize:%s\n", snd_strerror(err)); diff -Naur esound-0.2.32.orig/configure.in esound-0.2.32/configure.in --- esound-0.2.32.orig/configure.in 2003-09-03 12:23:23.000000000 -0400 +++ esound-0.2.32/configure.in 2004-02-02 08:53:54.000000000 -0500 @@ -269,6 +269,23 @@ AC_CHECK_FUNC(snd_cards,,[AC_CHECK_LIB(sound,snd_cards)]) AC_CHECK_FUNC(snd_cards,,[AC_CHECK_LIB(asound,snd_cards)]) AC_CHECK_FUNC(snd_pcm_pause,,[AC_CHECK_LIB(asound,snd_pcm_pause)]) + + dnl Check if ALSA uses new API + CFLAGS="${CFLAGS} -Werror" + AC_TRY_LINK([ + #include + ], [ + snd_pcm_t *pcm; + snd_pcm_hw_params_t *params; + unsigned int val; + int dir; + /* intentionally uses non-pointers, trying to replicate bug 129709 */ + snd_pcm_hw_params_set_rate_near(pcm, params, val, dir); + ], , [ + AC_DEFINE(DRIVER_ALSA_09_AFTER_RC4) + AC_DEFINE(ALSA_PCM_NEW_HW_PARAMS_API) + ]) + fi else AC_DEFINE(DRIVER_NONE)