diff --git a/alsa-lib-hg-fixes.diff b/alsa-lib-hg-fixes.diff
index bed5a04..145f7e9 100644
--- a/alsa-lib-hg-fixes.diff
+++ b/alsa-lib-hg-fixes.diff
@@ -1,6 +1,257 @@
+diff -r 3cfb9808fb42 Makefile.am
+--- a/Makefile.am Mon Feb 26 09:21:12 2007 +0100
++++ b/Makefile.am Thu Mar 22 01:43:32 2007 +0200
+@@ -1,4 +1,7 @@ SUBDIRS=doc include src modules
+-SUBDIRS=doc include src modules
++SUBDIRS=doc include src
++if BUILD_MODULES
++SUBDIRS += modules
++endif
+ if BUILD_PCM_PLUGIN_SHM
+ SUBDIRS += aserver
+ endif
+diff -r 3cfb9808fb42 configure.in
+--- a/configure.in Mon Feb 26 09:21:12 2007 +0100
++++ b/configure.in Wed Mar 28 14:01:28 2007 +0200
+@@ -80,7 +80,8 @@ dnl Check for versioned symbols
+ dnl Check for versioned symbols
+ AC_MSG_CHECKING(for versioned symbols)
+ AC_ARG_WITH(versioned,
+- [ --with-versioned=yes,no shared library will (not) be compiled with versioned symbols],
++ AS_HELP_STRING([--with-versioned],
++ [shared library will be compiled with versioned symbols (default = yes)]),
+ versioned="$withval", versioned="yes")
+ if test "$versioned" = "yes"; then
+ # it seems that GNU ld versions since 2.10 are not broken
+@@ -120,7 +121,8 @@ dnl Check for debug...
+ dnl Check for debug...
+ AC_MSG_CHECKING(for debug)
+ AC_ARG_WITH(debug,
+- [ --with-debug=yes,no library will (not) be compiled with asserts],
++ AS_HELP_STRING([--with-debug],
++ [library will be compiled with asserts (default = yes)]),
+ debug="$withval", debug="yes")
+ if test "$debug" = "yes"; then
+ AC_MSG_RESULT(yes)
+@@ -132,7 +134,8 @@ dnl Temporary directory
+ dnl Temporary directory
+ AC_MSG_CHECKING(for tmpdir)
+ AC_ARG_WITH(tmpdir,
+- [ --with-tmpdir=directory directory to put tmp socket files (/tmp)],
++ AS_HELP_STRING([--with-tmpdir=directory],
++ [directory to put tmp socket files (/tmp)]),
+ tmpdir="$withval", tmpdir="/tmp")
+ AC_MSG_RESULT($tmpdir)
+ AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir", [directory to put tmp socket files])
+@@ -140,7 +143,8 @@ dnl Check for softfloat...
+ dnl Check for softfloat...
+ AC_MSG_CHECKING(for softfloat)
+ AC_ARG_WITH(softfloat,
+- [ --with-softfloat do you have floating point unit on this machine? (optional)],
++ AS_HELP_STRING([--with-softfloat],
++ [do you have floating point unit on this machine? (optional)]),
+ [ AC_DEFINE(HAVE_SOFT_FLOAT, "1", [Avoid calculation in float])
+ softfloat=yes ],)
+ if test "$softloat" = "yes" ; then
+@@ -148,6 +152,44 @@ else
+ else
+ AC_MSG_RESULT(no)
+ fi
++
++ALSA_DEPLIBS=""
++if test "$softfloat" != "yes"; then
++ ALSA_DEPLIBS="-lm"
++fi
++
++dnl Check for libdl
++AC_MSG_CHECKING(for libdl)
++AC_ARG_WITH(libdl,
++ AS_HELP_STRING([--with-libdl], [Use libdl for plugins (default = yes)]),
++ [ have_libdl="$withval" ], [ have_libdl="yes" ])
++if test "$have_libdl" = "yes"; then
++ AC_CHECK_LIB([dl], [dlsym], [HAVE_LIBDL="yes"])
++ if test "$HAVE_LIBDL" = "yes" ; then
++ ALSA_DEPLIBS="$ALSA_DEPLIBS -ldl"
++ AC_DEFINE([HAVE_LIBDL], 1, [Have libdl])
++ fi
++else
++ AC_MSG_RESULT(no)
++fi
++AM_CONDITIONAL(BUILD_MODULES, test "$HAVE_LIBDL"="yes")
++
++dnl Check for pthread
++AC_MSG_CHECKING(for pthread)
++AC_ARG_WITH(pthread,
++ AS_HELP_STRING([--with-pthread], [Use pthread (default = yes)]),
++ [ have_pthread="$withval" ], [ have_pthread="yes" ])
++if test "$have_pthread" = "yes"; then
++ AC_CHECK_LIB([pthread], [pthread_join], [HAVE_LIBPTHREAD="yes"])
++ if test "$HAVE_LIBPTHREAD" = "yes"; then
++ ALSA_DEPLIBS="$ALSA_DEPLIBS -lpthread"
++ AC_DEFINE([HAVE_LIBPTHREAD], 1, [Have libpthread])
++ fi
++else
++ AC_MSG_RESULT(no)
++fi
++
++AC_SUBST(ALSA_DEPLIBS)
+
+ dnl Check for architecture
+ AC_MSG_CHECKING(for architecture)
+@@ -189,7 +231,7 @@ dnl Check for resmgr support...
+ dnl Check for resmgr support...
+ AC_MSG_CHECKING(for resmgr support)
+ AC_ARG_ENABLE(resmgr,
+- [ --enable-resmgr support resmgr (optional)],
++ AS_HELP_STRING([--enable-resmgr], [support resmgr (optional)]),
+ resmgr="$enableval", resmgr="no")
+ AC_MSG_RESULT($resmgr)
+ if test "$resmgr" = "yes"; then
+@@ -201,7 +243,7 @@ dnl Check for aload* support...
+ dnl Check for aload* support...
+ AC_MSG_CHECKING(for aload* support)
+ AC_ARG_ENABLE(aload,
+- [ --disable-aload disable reading /dev/aload*],
++ AS_HELP_STRING([--disable-aload], [disable reading /dev/aload*]),
+ aload="$enableval", aload="yes")
+ AC_MSG_RESULT($aload)
+ if test "$aload" = "yes"; then
+@@ -211,7 +253,8 @@ dnl Check for non-standard /dev director
+ dnl Check for non-standard /dev directory
+ AC_MSG_CHECKING([for ALSA device file directory])
+ AC_ARG_WITH(alsa-devdir,
+- [ --with-alsa-devdir=dir directory with ALSA device files (default /dev/snd)],
++ AS_HELP_STRING([--with-alsa-devdir=dir],
++ [directory with ALSA device files (default /dev/snd)]),
+ [alsa_dev_dir="$withval"],
+ [alsa_dev_dir="/dev/snd"])
+ dnl make sure it has a trailing slash
+@@ -223,7 +266,8 @@ AC_MSG_RESULT([$alsa_dev_dir])
+
+ AC_MSG_CHECKING([for aload* device file directory])
+ AC_ARG_WITH(aload-devdir,
+- [ --with-aload-devdir=dir directory with aload* device files (default /dev)],
++ AS_HELP_STRING([--with-aload-devdir=dir],
++ [directory with aload* device files (default /dev)]),
+ [aload_dev_dir="$withval"],
+ [aload_dev_dir="/dev"])
+ if echo "$aload_dev_dir" | grep -v '/$' > /dev/null; then
+@@ -234,25 +278,25 @@ AC_MSG_RESULT([$aload_dev_dir])
+
+ dnl Build conditions
+ AC_ARG_ENABLE(mixer,
+- [ --disable-mixer Disable the mixer component],
++ AS_HELP_STRING([--disable-mixer], [disable the mixer component]),
+ [build_mixer="$enableval"], [build_mixer="yes"])
+ AC_ARG_ENABLE(pcm,
+- [ --disable-pcm Disable the PCM component],
++ AS_HELP_STRING([--disable-pcm], [disable the PCM component]),
+ [build_pcm="$enableval"], [build_pcm="yes"])
+ AC_ARG_ENABLE(rawmidi,
+- [ --disable-rawmidi Disable the raw MIDI component],
++ AS_HELP_STRING([--disable-rawmidi], [disable the raw MIDI component]),
+ [build_rawmidi="$enableval"], [build_rawmidi="yes"])
+ AC_ARG_ENABLE(hwdep,
+- [ --disable-hwdep Disable the hwdep component],
++ AS_HELP_STRING([--disable-hwdep], [disable the hwdep component]),
+ [build_hwdep="$enableval"], [build_hwdep="yes"])
+ AC_ARG_ENABLE(seq,
+- [ --disable-seq Disable the sequencer component],
++ AS_HELP_STRING([--disable-seq], [disable the sequencer component]),
+ [build_seq="$enableval"], [build_seq="yes"])
+ AC_ARG_ENABLE(instr,
+- [ --disable-instr Disable the instrument component],
++ AS_HELP_STRING([--disable-instr], [disable the instrument component]),
+ [build_instr="$enableval"], [build_instr="yes"])
+ AC_ARG_ENABLE(alisp,
+- [ --disable-alisp Disable the alisp component],
++ AS_HELP_STRING([--disable-alisp], [disable the alisp component]),
+ [build_alisp="$enableval"], [build_alisp="yes"])
+
+ if test "$build_seq" != "yes"; then
+@@ -287,7 +331,8 @@ dnl PCM Plugins
+
+ if test "$build_pcm" = "yes"; then
+ AC_ARG_WITH(pcm-plugins,
+- [ --with-pcm-plugins= Build PCM plugins ],
++ AS_HELP_STRING([--with-pcm-plugins=],
++ [build PCM plugins (default = all)]),
+ [pcm_plugins="$withval"], [pcm_plugins="all"])
+ else
+ pcm_plugins=""
+@@ -318,6 +363,21 @@ fi
+
+ if test "$build_pcm_ioplug" = "yes"; then
+ build_pcm_extplug="yes"
++fi
++
++if test "$HAVE_LIBDL" != "yes"; then
++ build_pcm_meter="no"
++ build_pcm_ladspa="no"
++ build_pcm_pcm_ioplug="no"
++ build_pcm_pcm_extplug="no"
++fi
++
++if test "$HAVE_LIBPTHREAD" != "yes"; then
++ build_pcm_share="no"
++fi
++
++if test "$softfloat" != "yes"; then
++ build_pcm_lfloat="no"
+ fi
+
+ AM_CONDITIONAL(BUILD_PCM_PLUGIN, test x$build_pcm_plugin = xyes)
+@@ -371,9 +431,47 @@ fi
+
+ dnl Create PCM plugin symbol list for static library
+ rm -f "$srcdir"/src/pcm/pcm_symbols_list.c
++touch "$srcdir"/src/pcm/pcm_symbols_list.c
+ for t in $PCM_PLUGIN_LIST; do
+ if eval test \$build_pcm_$t = yes; then
+ echo \&_snd_module_pcm_$t, >> "$srcdir"/src/pcm/pcm_symbols_list.c
++ fi
++done
++
++dnl Control Plugins
++
++AC_ARG_WITH(ctl-plugins,
++ AS_HELP_STRING([--with-ctl-plugins=],
++ [build control plugins (default = all)]),
++ [ctl_plugins="$withval"], [ctl_plugins="all"])
++
++CTL_PLUGIN_LIST="shm ext"
++
++build_ctl_plugin="no"
++for t in $CTL_PLUGIN_LIST; do
++ eval build_ctl_$t="no"
++done
++
++ctl_plugins=`echo $ctl_plugins | sed 's/,/ /g'`
++for p in $ctl_plugins; do
++ for t in $CTL_PLUGIN_LIST; do
++ if test "$p" = "$t" -o "$p" = "all"; then
++ eval build_ctl_$t="yes"
++ build_ctl_plugin="yes"
++ fi
++ done
++done
++
++AM_CONDITIONAL(BUILD_CTL_PLUGIN, test x$build_ctl_plugin = xyes)
++AM_CONDITIONAL(BUILD_CTL_PLUGIN_SHM, test x$build_ctl_shm = xyes)
++AM_CONDITIONAL(BUILD_CTL_PLUGIN_EXT, test x$build_ctl_ext = xyes)
++
++dnl Create ctl plugin symbol list for static library
++rm -f "$srcdir"/src/control/ctl_symbols_list.c
++touch "$srcdir"/src/control/ctl_symbols_list.c
++for t in $CTL_PLUGIN_LIST; do
++ if eval test \$build_ctl_$t = yes; then
++ echo \&_snd_module_control_$t, >> "$srcdir"/src/control/ctl_symbols_list.c
+ fi
+ done
+
diff -r 3cfb9808fb42 include/global.h
--- a/include/global.h Mon Feb 26 09:21:12 2007 +0100
-+++ b/include/global.h Mon Jan 22 11:45:18 2007 +0100
++++ b/include/global.h Mon Jan 22 12:45:18 2007 +0200
@@ -130,7 +130,7 @@ int snd_shm_area_destroy(struct snd_shm_
int snd_user_file(const char *file, char **result);
@@ -10,10 +261,384 @@ diff -r 3cfb9808fb42 include/global.h
struct timeval {
time_t tv_sec; /* seconds */
long tv_usec; /* microseconds */
+diff -r 3cfb9808fb42 include/local.h
+--- a/include/local.h Mon Feb 26 09:21:12 2007 +0100
++++ b/include/local.h Thu Mar 22 01:43:32 2007 +0200
+@@ -36,6 +36,11 @@
+ #include "config.h"
+ #ifdef SUPPORT_RESMGR
+ #include
++#endif
++#ifdef HAVE_LIBDL
++#include
++#else
++#define RTLD_NOW 0
+ #endif
+
+ #define _snd_config_iterator list_head
+diff -r 3cfb9808fb42 include/pcm_plugin.h
+--- a/include/pcm_plugin.h Mon Feb 26 09:21:12 2007 +0100
++++ b/include/pcm_plugin.h Thu Mar 22 01:49:05 2007 +0200
+@@ -156,7 +156,8 @@ int _snd_pcm_route_open(snd_pcm_t **pcmp
+ * Rate plugin for linear formats
+ */
+ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
+- snd_pcm_format_t sformat, unsigned int srate, const char *converter,
++ snd_pcm_format_t sformat, unsigned int srate,
++ const snd_config_t *converter,
+ snd_pcm_t *slave, int close_slave);
+ int _snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
+ snd_config_t *root, snd_config_t *conf,
+diff -r 3cfb9808fb42 src/Makefile.am
+--- a/src/Makefile.am Mon Feb 26 09:21:12 2007 +0100
++++ b/src/Makefile.am Thu Mar 22 01:43:32 2007 +0200
+@@ -41,7 +41,7 @@ libasound_la_LIBADD += alisp/libalisp.la
+ libasound_la_LIBADD += alisp/libalisp.la
+ endif
+ SUBDIRS += compat conf
+-libasound_la_LIBADD += compat/libcompat.la -lm -ldl -lpthread
++libasound_la_LIBADD += compat/libcompat.la @ALSA_DEPLIBS@
+
+ libasound_la_LDFLAGS = -version-info $(COMPATNUM) $(VSYMS)
+
+diff -r 3cfb9808fb42 src/async.c
+--- a/src/async.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/async.c Thu Mar 22 01:43:32 2007 +0200
+@@ -151,9 +151,11 @@ int snd_async_del_handler(snd_async_hand
+ if (!list_empty(&handler->hlist))
+ goto _end;
+ switch (handler->type) {
++#ifdef BUILD_PCM
+ case SND_ASYNC_HANDLER_PCM:
+ err = snd_pcm_async(handler->u.pcm, -1, 1);
+ break;
++#endif
+ case SND_ASYNC_HANDLER_CTL:
+ err = snd_ctl_async(handler->u.ctl, -1, 1);
+ break;
+diff -r 3cfb9808fb42 src/conf.c
+--- a/src/conf.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/conf.c Thu Mar 22 01:43:32 2007 +0200
+@@ -415,12 +415,13 @@ beginning:
+
+
+ #include
+-#include
+ #include
+ #include
+-#include
+ #include
+ #include "local.h"
++#ifdef HAVE_LIBPTHREAD
++#include
++#endif
+
+ #ifndef DOC_HIDDEN
+
+@@ -3080,7 +3081,9 @@ int snd_config_update_r(snd_config_t **_
+ return 1;
+ }
+
++#ifdef HAVE_LIBPTHREAD
+ static pthread_mutex_t snd_config_update_mutex = PTHREAD_MUTEX_INITIALIZER;
++#endif
+
+ /**
+ * \brief Updates #snd_config by rereading the global configuration files (if needed).
+@@ -3099,9 +3102,13 @@ int snd_config_update(void)
+ {
+ int err;
+
++#ifdef HAVE_LIBPTHREAD
+ pthread_mutex_lock(&snd_config_update_mutex);
++#endif
+ err = snd_config_update_r(&snd_config, &snd_config_global_update, NULL);
++#ifdef HAVE_LIBPTHREAD
+ pthread_mutex_unlock(&snd_config_update_mutex);
++#endif
+ return err;
+ }
+
+@@ -3128,15 +3135,18 @@ int snd_config_update_free(snd_config_up
+ */
+ int snd_config_update_free_global(void)
+ {
++#ifdef HAVE_LIBPTHREAD
+ pthread_mutex_lock(&snd_config_update_mutex);
++#endif
+ if (snd_config)
+ snd_config_delete(snd_config);
+ snd_config = NULL;
+ if (snd_config_global_update)
+ snd_config_update_free(snd_config_global_update);
+ snd_config_global_update = NULL;
++#ifdef HAVE_LIBPTHREAD
+ pthread_mutex_unlock(&snd_config_update_mutex);
+-
++#endif
+ /* FIXME: better to place this in another place... */
+ snd_dlobj_cache_cleanup();
+
+diff -r 3cfb9808fb42 src/conf/cards/USB-Audio.conf
+--- a/src/conf/cards/USB-Audio.conf Mon Feb 26 09:21:12 2007 +0100
++++ b/src/conf/cards/USB-Audio.conf Wed Mar 21 13:03:01 2007 +0200
+@@ -9,7 +9,7 @@
+ # cards.USB-Audio.pcm.use_dmix."NoiseBlaster 3000" no
+ #
+ # If your device requires such a definition to work correctly, please report it
+-# to .
++# to .
+
+
+ # If a device has sample formats not supported by dmix, dmix can be disabled
+diff -r 3cfb9808fb42 src/confmisc.c
+--- a/src/confmisc.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/confmisc.c Thu Mar 22 01:43:32 2007 +0200
+@@ -946,6 +946,8 @@ SND_DLSYM_BUILD_VERSION(snd_func_card_na
+ SND_DLSYM_BUILD_VERSION(snd_func_card_name, SND_CONFIG_DLSYM_VERSION_EVALUATE);
+ #endif
+
++#ifdef BUILD_PCM
++
+ /**
+ * \brief Returns the pcm identification of a device.
+ * \param dst The function puts the handle to the result configuration node
+@@ -1198,6 +1200,8 @@ int snd_func_private_pcm_subdevice(snd_c
+ #ifndef DOC_HIDDEN
+ SND_DLSYM_BUILD_VERSION(snd_func_private_pcm_subdevice, SND_CONFIG_DLSYM_VERSION_EVALUATE);
+ #endif
++
++#endif /* BUILD_PCM */
+
+ /**
+ * \brief Copies the specified configuration node.
+diff -r 3cfb9808fb42 src/control/Makefile.am
+--- a/src/control/Makefile.am Mon Feb 26 09:21:12 2007 +0100
++++ b/src/control/Makefile.am Wed Mar 28 13:34:25 2007 +0200
+@@ -1,8 +1,13 @@ EXTRA_LTLIBRARIES = libcontrol.la
+ EXTRA_LTLIBRARIES = libcontrol.la
+
+ libcontrol_la_SOURCES = cards.c namehint.c hcontrol.c \
+- control.c control_hw.c control_shm.c \
+- control_ext.c setup.c control_symbols.c
++ control.c control_hw.c setup.c control_symbols.c
++if BUILD_CTL_PLUGIN_SHM
++libcontrol_la_SOURCES += control_shm.c
++endif
++if BUILD_CTL_PLUGIN_EXT
++libcontrol_la_SOURCES += control_ext.c
++endif
+
+ noinst_HEADERS = control_local.h
+
+diff -r 3cfb9808fb42 src/control/control.c
+--- a/src/control/control.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/control/control.c Thu Mar 22 01:43:32 2007 +0200
+@@ -47,7 +47,6 @@ and IEC958 structure.
+ #include
+ #include
+ #include
+-#include
+ #include
+ #include "control_local.h"
+
+diff -r 3cfb9808fb42 src/control/control_ext.c
+--- a/src/control/control_ext.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/control/control_ext.c Wed Mar 28 14:24:22 2007 +0200
+@@ -33,6 +33,11 @@
+ #include
+ #include "control_local.h"
+ #include "control_external.h"
++
++#ifndef PIC
++/* entry for static linking */
++const char *_snd_module_control_ext = "";
++#endif
+
+ static int snd_ctl_ext_close(snd_ctl_t *handle)
+ {
+diff -r 3cfb9808fb42 src/control/control_symbols.c
+--- a/src/control/control_symbols.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/control/control_symbols.c Wed Mar 28 13:33:21 2007 +0200
+@@ -22,10 +22,11 @@
+
+ extern const char *_snd_module_control_hw;
+ extern const char *_snd_module_control_shm;
++extern const char *_snd_module_control_ext;
+
+ static const char **snd_control_open_objects[] = {
+ &_snd_module_control_hw,
+- &_snd_module_control_shm
++#include "ctl_symbols_list.c"
+ };
+
+ void *snd_control_open_symbols(void)
+diff -r 3cfb9808fb42 src/control/hcontrol.c
+--- a/src/control/hcontrol.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/control/hcontrol.c Thu Mar 22 01:43:32 2007 +0200
+@@ -48,11 +48,13 @@ to reduce overhead accessing the real co
+ #include
+ #include
+ #include
+-#include
+ #ifndef DOC_HIDDEN
+ #define __USE_GNU
+ #endif
+ #include "control_local.h"
++#ifdef HAVE_LIBPTHREAD
++#include
++#endif
+
+ #ifndef DOC_HIDDEN
+ #define NOT_FOUND 1000000000
+@@ -420,17 +422,22 @@ static void snd_hctl_sort(snd_hctl_t *hc
+ static void snd_hctl_sort(snd_hctl_t *hctl)
+ {
+ unsigned int k;
++#ifdef HAVE_LIBPTHREAD
+ static pthread_mutex_t sync_lock = PTHREAD_MUTEX_INITIALIZER;
++#endif
+
+ assert(hctl);
+ assert(hctl->compare);
+ INIT_LIST_HEAD(&hctl->elems);
+
++#ifdef HAVE_LIBPTHREAD
+ pthread_mutex_lock(&sync_lock);
++#endif
+ compare_hctl = hctl;
+ qsort(hctl->pelems, hctl->count, sizeof(*hctl->pelems), hctl_compare);
++#ifdef HAVE_LIBPTHREAD
+ pthread_mutex_unlock(&sync_lock);
+-
++#endif
+ for (k = 0; k < hctl->count; k++)
+ list_add_tail(&hctl->pelems[k]->list, &hctl->elems);
+ }
+diff -r 3cfb9808fb42 src/dlmisc.c
+--- a/src/dlmisc.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/dlmisc.c Thu Mar 22 01:43:32 2007 +0200
+@@ -28,7 +28,6 @@
+ */
+
+ #define _GNU_SOURCE
+-#include
+ #include "list.h"
+ #include "local.h"
+
+@@ -53,13 +52,19 @@ void *snd_dlopen(const char *name, int m
+ if (name == NULL)
+ return &snd_dlsym_start;
+ #else
++#ifdef HAVE_LIBDL
+ if (name == NULL) {
+ Dl_info dlinfo;
+ if (dladdr(snd_dlopen, &dlinfo) > 0)
+ name = dlinfo.dli_fname;
+ }
+ #endif
++#endif
++#ifdef HAVE_LIBDL
+ return dlopen(name, mode);
++#else
++ return NULL;
++#endif
+ }
+
+ /**
+@@ -76,7 +81,11 @@ int snd_dlclose(void *handle)
+ if (handle == &snd_dlsym_start)
+ return 0;
+ #endif
++#ifdef HAVE_LIBDL
+ return dlclose(handle);
++#else
++ return 0;
++#endif
+ }
+
+ /**
+@@ -91,6 +100,7 @@ int snd_dlclose(void *handle)
+ */
+ static int snd_dlsym_verify(void *handle, const char *name, const char *version)
+ {
++#ifdef HAVE_LIBDL
+ int res;
+ char *vname;
+
+@@ -107,6 +117,9 @@ static int snd_dlsym_verify(void *handle
+ if (res < 0)
+ SNDERR("unable to verify version for symbol %s", name);
+ return res;
++#else
++ return 0;
++#endif
+ }
+
+ /**
+@@ -139,10 +152,16 @@ void *snd_dlsym(void *handle, const char
+ return NULL;
+ }
+ #endif
+- err = snd_dlsym_verify(handle, name, version);
+- if (err < 0)
+- return NULL;
++#ifdef HAVE_LIBDL
++ if (version) {
++ err = snd_dlsym_verify(handle, name, version);
++ if (err < 0)
++ return NULL;
++ }
+ return dlsym(handle, name);
++#else
++ return NULL;
++#endif
+ }
+
+ /*
+diff -r 3cfb9808fb42 src/hwdep/hwdep.c
+--- a/src/hwdep/hwdep.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/hwdep/hwdep.c Thu Mar 22 01:43:32 2007 +0200
+@@ -33,7 +33,6 @@
+ #include
+ #include
+ #include
+-#include
+ #include
+ #include "hwdep_local.h"
+
+diff -r 3cfb9808fb42 src/mixer/simple_abst.c
+--- a/src/mixer/simple_abst.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/mixer/simple_abst.c Thu Mar 22 01:43:32 2007 +0200
+@@ -82,14 +82,14 @@ static int try_open(snd_mixer_class_t *c
+ free(xlib);
+ return -ENXIO;
+ }
+- event_func = dlsym(h, "alsa_mixer_simple_event");
++ event_func = snd_dlsym(h, "alsa_mixer_simple_event", NULL);
+ if (event_func == NULL) {
+ SNDERR("Symbol 'alsa_mixer_simple_event' was not found in '%s'", xlib);
+ snd_dlclose(h);
+ free(xlib);
+ return -ENXIO;
+ }
+- init_func = dlsym(h, "alsa_mixer_simple_init");
++ init_func = snd_dlsym(h, "alsa_mixer_simple_init", NULL);
+ if (init_func == NULL) {
+ SNDERR("Symbol 'alsa_mixer_simple_init' was not found in '%s'", xlib);
+ snd_dlclose(h);
diff -r 3cfb9808fb42 src/pcm/pcm.c
--- a/src/pcm/pcm.c Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/pcm.c Tue Mar 13 15:26:22 2007 +0100
-@@ -6313,15 +6313,6 @@ snd_pcm_sframes_t snd_pcm_mmap_commit(sn
++++ b/src/pcm/pcm.c Thu Mar 22 01:43:32 2007 +0200
+@@ -634,7 +634,6 @@ playback devices.
+ #include
+ #include
+ #include
+-#include
+ #include
+ #include
+ #include
+@@ -6313,15 +6312,6 @@ snd_pcm_sframes_t snd_pcm_mmap_commit(sn
}
#ifndef DOC_HIDDEN
@@ -31,7 +656,7 @@ diff -r 3cfb9808fb42 src/pcm/pcm.c
{
diff -r 3cfb9808fb42 src/pcm/pcm_direct.c
--- a/src/pcm/pcm_direct.c Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/pcm_direct.c Mon Mar 12 11:31:18 2007 +0100
++++ b/src/pcm/pcm_direct.c Mon Mar 12 12:31:18 2007 +0200
@@ -885,7 +885,7 @@ int snd_pcm_direct_initialize_slave(snd_
SND_PCM_FORMAT_S24_3LE,
};
@@ -43,7 +668,7 @@ diff -r 3cfb9808fb42 src/pcm/pcm_direct.c
format = dmix_formats[i];
diff -r 3cfb9808fb42 src/pcm/pcm_dmix.c
--- a/src/pcm/pcm_dmix.c Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/pcm_dmix.c Tue Mar 13 15:26:22 2007 +0100
++++ b/src/pcm/pcm_dmix.c Tue Mar 13 16:26:22 2007 +0200
@@ -757,8 +757,8 @@ static snd_pcm_fast_ops_t snd_pcm_dmix_f
.rewind = snd_pcm_dmix_rewind,
.forward = snd_pcm_dmix_forward,
@@ -56,7 +681,7 @@ diff -r 3cfb9808fb42 src/pcm/pcm_dmix.c
.writen = snd_pcm_mmap_writen,
diff -r 3cfb9808fb42 src/pcm/pcm_dshare.c
--- a/src/pcm/pcm_dshare.c Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/pcm_dshare.c Tue Mar 13 15:26:22 2007 +0100
++++ b/src/pcm/pcm_dshare.c Tue Mar 13 16:26:22 2007 +0200
@@ -562,8 +562,8 @@ static snd_pcm_fast_ops_t snd_pcm_dshare
.rewind = snd_pcm_dshare_rewind,
.forward = snd_pcm_dshare_forward,
@@ -69,7 +694,7 @@ diff -r 3cfb9808fb42 src/pcm/pcm_dshare.c
.writen = snd_pcm_mmap_writen,
diff -r 3cfb9808fb42 src/pcm/pcm_dsnoop.c
--- a/src/pcm/pcm_dsnoop.c Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/pcm_dsnoop.c Tue Mar 13 15:26:22 2007 +0100
++++ b/src/pcm/pcm_dsnoop.c Tue Mar 13 16:26:22 2007 +0200
@@ -452,8 +452,8 @@ static snd_pcm_fast_ops_t snd_pcm_dsnoop
.rewind = snd_pcm_dsnoop_rewind,
.forward = snd_pcm_dsnoop_forward,
@@ -82,7 +707,7 @@ diff -r 3cfb9808fb42 src/pcm/pcm_dsnoop.c
.writen = snd_pcm_dsnoop_writen,
diff -r 3cfb9808fb42 src/pcm/pcm_file.c
--- a/src/pcm/pcm_file.c Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/pcm_file.c Tue Mar 13 15:26:22 2007 +0100
++++ b/src/pcm/pcm_file.c Tue Mar 13 16:26:22 2007 +0200
@@ -373,8 +373,8 @@ static snd_pcm_fast_ops_t snd_pcm_file_f
.rewind = snd_pcm_file_rewind,
.forward = snd_pcm_file_forward,
@@ -95,7 +720,7 @@ diff -r 3cfb9808fb42 src/pcm/pcm_file.c
.writen = snd_pcm_file_writen,
diff -r 3cfb9808fb42 src/pcm/pcm_generic.c
--- a/src/pcm/pcm_generic.c Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/pcm_generic.c Tue Mar 13 15:26:22 2007 +0100
++++ b/src/pcm/pcm_generic.c Tue Mar 13 16:26:22 2007 +0200
@@ -197,14 +197,6 @@ snd_pcm_sframes_t snd_pcm_generic_rewind
return snd_pcm_rewind(generic->slave, frames);
}
@@ -164,7 +789,7 @@ diff -r 3cfb9808fb42 src/pcm/pcm_generic.c
int snd_pcm_generic_unlink(snd_pcm_t *pcm)
diff -r 3cfb9808fb42 src/pcm/pcm_generic.h
--- a/src/pcm/pcm_generic.h Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/pcm_generic.h Tue Mar 13 15:26:22 2007 +0100
++++ b/src/pcm/pcm_generic.h Tue Mar 13 16:26:22 2007 +0200
@@ -50,9 +50,8 @@ int snd_pcm_generic_delay(snd_pcm_t *pcm
int snd_pcm_generic_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
snd_pcm_sframes_t snd_pcm_generic_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
@@ -178,8 +803,16 @@ diff -r 3cfb9808fb42 src/pcm/pcm_generic.h
snd_pcm_sframes_t snd_pcm_generic_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
diff -r 3cfb9808fb42 src/pcm/pcm_hooks.c
--- a/src/pcm/pcm_hooks.c Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/pcm_hooks.c Tue Mar 13 15:26:22 2007 +0100
-@@ -151,8 +151,8 @@ static snd_pcm_fast_ops_t snd_pcm_hooks_
++++ b/src/pcm/pcm_hooks.c Thu Mar 22 01:43:32 2007 +0200
+@@ -27,7 +27,6 @@
+ *
+ */
+
+-#include
+ #include "pcm_local.h"
+ #include "pcm_generic.h"
+
+@@ -151,8 +150,8 @@ static snd_pcm_fast_ops_t snd_pcm_hooks_
.rewind = snd_pcm_generic_rewind,
.forward = snd_pcm_generic_forward,
.resume = snd_pcm_generic_resume,
@@ -191,7 +824,7 @@ diff -r 3cfb9808fb42 src/pcm/pcm_hooks.c
.writen = snd_pcm_generic_writen,
diff -r 3cfb9808fb42 src/pcm/pcm_hw.c
--- a/src/pcm/pcm_hw.c Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/pcm_hw.c Tue Mar 13 15:26:22 2007 +0100
++++ b/src/pcm/pcm_hw.c Tue Mar 13 16:26:22 2007 +0200
@@ -686,41 +686,35 @@ static int snd_pcm_hw_resume(snd_pcm_t *
return 0;
}
@@ -270,7 +903,7 @@ diff -r 3cfb9808fb42 src/pcm/pcm_hw.c
.writen = snd_pcm_hw_writen,
diff -r 3cfb9808fb42 src/pcm/pcm_ioplug.c
--- a/src/pcm/pcm_ioplug.c Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/pcm_ioplug.c Tue Mar 13 15:26:22 2007 +0100
++++ b/src/pcm/pcm_ioplug.c Tue Mar 13 16:26:22 2007 +0200
@@ -747,8 +747,8 @@ static snd_pcm_fast_ops_t snd_pcm_ioplug
.hwsync = snd_pcm_ioplug_hwsync,
.delay = snd_pcm_ioplug_delay,
@@ -281,9 +914,20 @@ diff -r 3cfb9808fb42 src/pcm/pcm_ioplug.c
.unlink = NULL,
.rewind = snd_pcm_ioplug_rewind,
.forward = snd_pcm_ioplug_forward,
+diff -r 3cfb9808fb42 src/pcm/pcm_ladspa.c
+--- a/src/pcm/pcm_ladspa.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/pcm/pcm_ladspa.c Thu Mar 22 01:43:32 2007 +0200
+@@ -33,7 +33,6 @@
+ */
+
+ #include
+-#include
+ #include
+ #include
+ #include "pcm_local.h"
diff -r 3cfb9808fb42 src/pcm/pcm_local.h
--- a/src/pcm/pcm_local.h Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/pcm_local.h Tue Mar 13 15:26:22 2007 +0100
++++ b/src/pcm/pcm_local.h Thu Mar 22 01:49:05 2007 +0200
@@ -152,8 +152,8 @@ typedef struct {
int (*hwsync)(snd_pcm_t *pcm);
int (*delay)(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
@@ -302,9 +946,18 @@ diff -r 3cfb9808fb42 src/pcm/pcm_local.h
#define _snd_pcm_link_descriptor _snd_pcm_poll_descriptor /* FIXME */
#define _snd_pcm_async_descriptor _snd_pcm_poll_descriptor /* FIXME */
+@@ -757,7 +756,7 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp,
+
+ int snd_pcm_wait_nocheck(snd_pcm_t *pcm, int timeout);
+
+-const char *snd_pcm_rate_get_default_converter(snd_config_t *root);
++const snd_config_t *snd_pcm_rate_get_default_converter(snd_config_t *root);
+
+ #define SND_PCM_HW_PARBIT_ACCESS (1U << SND_PCM_HW_PARAM_ACCESS)
+ #define SND_PCM_HW_PARBIT_FORMAT (1U << SND_PCM_HW_PARAM_FORMAT)
diff -r 3cfb9808fb42 src/pcm/pcm_multi.c
--- a/src/pcm/pcm_multi.c Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/pcm_multi.c Tue Mar 13 15:26:22 2007 +0100
++++ b/src/pcm/pcm_multi.c Thu Mar 22 02:16:41 2007 +0200
@@ -45,7 +45,7 @@ typedef struct {
snd_pcm_t *pcm;
unsigned int channels_count;
@@ -528,11 +1181,10 @@ diff -r 3cfb9808fb42 src/pcm/pcm_multi.c
+static int snd_pcm_multi_link_slaves(snd_pcm_t *pcm, snd_pcm_t *master)
{
snd_pcm_multi_t *multi = pcm->private_data;
-- unsigned int i;
+ unsigned int i;
-
- if (count < (int)multi->slaves_count)
- return -ENOMEM;
-+ unsigned int i, j;
+ int err;
+
+ for (i = 0; i < multi->slaves_count; ++i) {
@@ -599,9 +1251,63 @@ diff -r 3cfb9808fb42 src/pcm/pcm_multi.c
.unlink = snd_pcm_multi_unlink,
.avail_update = snd_pcm_multi_avail_update,
.mmap_commit = snd_pcm_multi_mmap_commit,
+diff -r 3cfb9808fb42 src/pcm/pcm_plug.c
+--- a/src/pcm/pcm_plug.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/pcm/pcm_plug.c Thu Mar 22 01:53:45 2007 +0200
+@@ -50,7 +50,7 @@ typedef struct {
+ snd_pcm_format_t sformat;
+ int schannels;
+ int srate;
+- const char *rate_converter;
++ const snd_config_t *rate_converter;
+ enum snd_pcm_plug_route_policy route_policy;
+ snd_pcm_route_ttable_entry_t *ttable;
+ int ttable_ok, ttable_last;
+@@ -1015,7 +1015,7 @@ int snd_pcm_plug_open(snd_pcm_t **pcmp,
+ int snd_pcm_plug_open(snd_pcm_t **pcmp,
+ const char *name,
+ snd_pcm_format_t sformat, int schannels, int srate,
+- const char *rate_converter,
++ const snd_config_t *rate_converter,
+ enum snd_pcm_plug_route_policy route_policy,
+ snd_pcm_route_ttable_entry_t *ttable,
+ unsigned int tt_ssize,
+@@ -1092,6 +1092,9 @@ pcm.name {
+ }
+ }
+ rate_converter STR # type of rate converter
++ # or
++ rate_converter [ STR1 STR2 ... ]
++ # type of rate converter
+ # default value is taken from defaults.pcm.rate_converter
+ }
+ \endcode
+@@ -1133,7 +1136,7 @@ int _snd_pcm_plug_open(snd_pcm_t **pcmp,
+ unsigned int cused, sused;
+ snd_pcm_format_t sformat = SND_PCM_FORMAT_UNKNOWN;
+ int schannels = -1, srate = -1;
+- const char *rate_converter = NULL;
++ const snd_config_t *rate_converter = NULL;
+
+ snd_config_for_each(i, next, conf) {
+ snd_config_t *n = snd_config_iterator_entry(i);
+@@ -1177,12 +1180,7 @@ int _snd_pcm_plug_open(snd_pcm_t **pcmp,
+ #endif
+ #ifdef BUILD_PCM_PLUGIN_RATE
+ if (strcmp(id, "rate_converter") == 0) {
+- const char *str;
+- if ((err = snd_config_get_string(n, &str)) < 0) {
+- SNDERR("Invalid type for %s", id);
+- return -EINVAL;
+- }
+- rate_converter = str;
++ rate_converter = n;
+ continue;
+ }
+ #endif
diff -r 3cfb9808fb42 src/pcm/pcm_plugin.c
--- a/src/pcm/pcm_plugin.c Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/pcm_plugin.c Tue Mar 13 15:26:22 2007 +0100
++++ b/src/pcm/pcm_plugin.c Tue Mar 13 16:26:22 2007 +0200
@@ -566,8 +566,8 @@ snd_pcm_fast_ops_t snd_pcm_plugin_fast_o
.rewind = snd_pcm_plugin_rewind,
.forward = snd_pcm_plugin_forward,
@@ -612,9 +1318,238 @@ diff -r 3cfb9808fb42 src/pcm/pcm_plugin.c
.unlink = snd_pcm_generic_unlink,
.writei = snd_pcm_plugin_writei,
.writen = snd_pcm_plugin_writen,
+diff -r 3cfb9808fb42 src/pcm/pcm_rate.c
+--- a/src/pcm/pcm_rate.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/pcm/pcm_rate.c Wed Mar 28 14:29:58 2007 +0200
+@@ -29,7 +29,6 @@
+ */
+ #include
+ #include
+-#include
+ #include "pcm_local.h"
+ #include "pcm_plugin.h"
+ #include "pcm_rate.h"
+@@ -1252,19 +1251,55 @@ static snd_pcm_ops_t snd_pcm_rate_ops =
+ /**
+ * \brief Get a default converter string
+ * \param root Root configuration node
+- * \retval A const string if found, or NULL
++ * \retval A const config item if found, or NULL
+ */
+-const char *snd_pcm_rate_get_default_converter(snd_config_t *root)
++const snd_config_t *snd_pcm_rate_get_default_converter(snd_config_t *root)
+ {
+ snd_config_t *n;
+ /* look for default definition */
+- if (snd_config_search(root, "defaults.pcm.rate_converter", &n) >= 0) {
+- const char *str;
+- if (snd_config_get_string(n, &str) >= 0)
+- return str;
+- }
++ if (snd_config_search(root, "defaults.pcm.rate_converter", &n) >= 0)
++ return n;
+ return NULL;
+ }
++
++#ifdef PIC
++static int is_builtin_plugin(const char *type)
++{
++ return strcmp(type, "linear") == 0;
++}
++
++static const char *default_rate_plugins[] = {
++ "speexrate", "linear", NULL
++};
++
++static int rate_open_func(snd_pcm_rate_t *rate, const char *type)
++{
++ char open_name[64];
++ snd_pcm_rate_open_func_t open_func;
++
++ snprintf(open_name, sizeof(open_name), "_snd_pcm_rate_%s_open", type);
++ open_func = snd_dlobj_cache_lookup(open_name);
++ if (!open_func) {
++ void *h;
++ char lib_name[128], *lib = NULL;
++ if (!is_builtin_plugin(type)) {
++ snprintf(lib_name, sizeof(lib_name),
++ "%s/libasound_module_rate_%s.so", PKGLIBDIR, type);
++ lib = lib_name;
++ }
++ h = snd_dlopen(lib, RTLD_NOW);
++ if (!h)
++ return -ENOENT;
++ open_func = snd_dlsym(h, open_name, NULL);
++ if (!open_func) {
++ snd_dlclose(h);
++ return -ENOENT;
++ }
++ snd_dlobj_cache_add(open_name, h, open_func);
++ }
++ return open_func(SND_PCM_RATE_PLUGIN_VERSION, &rate->obj, &rate->ops);
++}
++#endif
+
+ /**
+ * \brief Creates a new rate PCM
+@@ -1280,15 +1315,17 @@ const char *snd_pcm_rate_get_default_con
+ * of compatibility reasons. The prototype might be freely
+ * changed in future.
+ */
+-int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat,
+- unsigned int srate, const char *type, snd_pcm_t *slave, int close_slave)
++int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
++ snd_pcm_format_t sformat, unsigned int srate,
++ const snd_config_t *converter,
++ snd_pcm_t *slave, int close_slave)
+ {
+ snd_pcm_t *pcm;
+ snd_pcm_rate_t *rate;
+- snd_pcm_rate_open_func_t open_func;
+- char open_name[64];
++ const char *type = NULL;
+ int err;
+ #ifndef PIC
++ snd_pcm_rate_open_func_t open_func;
+ extern int SND_PCM_RATE_PLUGIN_ENTRY(linear) (unsigned int version, void **objp, snd_pcm_rate_ops_t *ops);
+ #endif
+
+@@ -1306,49 +1343,55 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp,
+ rate->sformat = sformat;
+ snd_atomic_write_init(&rate->watom);
+
+- if (! type || ! *type)
+- type = "linear";
+-
+-#ifdef PIC
+- snprintf(open_name, sizeof(open_name), "_snd_pcm_rate_%s_open", type);
+- open_func = snd_dlobj_cache_lookup(open_name);
+- if (! open_func) {
+- void *h;
+- char lib_name[128], *lib = NULL;
+- if (strcmp(type, "linear")) {
+- snprintf(lib_name, sizeof(lib_name),
+- "%s/libasound_module_rate_%s.so", PKGLIBDIR, type);
+- lib = lib_name;
+- }
+- h = snd_dlopen(lib, RTLD_NOW);
+- if (! h) {
+- SNDERR("Cannot open library for type %s", type);
+- free(rate);
+- return -ENOENT;
+- }
+- open_func = dlsym(h, open_name);
+- if (! open_func) {
+- SNDERR("Cannot find function %s", open_name);
+- snd_dlclose(h);
+- free(rate);
+- return -ENOENT;
+- }
+- snd_dlobj_cache_add(open_name, h, open_func);
+- }
+-#else
+- open_func = SND_PCM_RATE_PLUGIN_ENTRY(linear);
+-#endif
+-
+ err = snd_pcm_new(&pcm, SND_PCM_TYPE_RATE, name, slave->stream, slave->mode);
+ if (err < 0) {
+ free(rate);
+ return err;
+ }
++
++#ifdef PIC
++ err = -ENOENT;
++ if (!converter) {
++ const char **types;
++ for (types = default_rate_plugins; *types; types++) {
++ err = rate_open_func(rate, *types);
++ if (!err) {
++ type = *types;
++ break;
++ }
++ }
++ } else if (!snd_config_get_string(converter, &type))
++ err = rate_open_func(rate, type);
++ else if (snd_config_get_type(converter) == SND_CONFIG_TYPE_COMPOUND) {
++ snd_config_iterator_t i, next;
++ snd_config_for_each(i, next, converter) {
++ snd_config_t *n = snd_config_iterator_entry(i);
++ if (snd_config_get_string(n, &type) < 0)
++ break;
++ err = rate_open_func(rate, type);
++ if (!err)
++ break;
++ }
++ } else {
++ SNDERR("Invalid type for rate converter");
++ snd_pcm_close(pcm);
++ return -EINVAL;
++ }
++ if (err < 0) {
++ SNDERR("Cannot find rate converter");
++ snd_pcm_close(pcm);
++ return -ENOENT;
++ }
++#else
++ type = "linear";
++ open_func = SND_PCM_RATE_PLUGIN_ENTRY(linear);
+ err = open_func(SND_PCM_RATE_PLUGIN_VERSION, &rate->obj, &rate->ops);
+ if (err < 0) {
+ snd_pcm_close(pcm);
+ return err;
+ }
++#endif
++
+ if (! rate->ops.init || ! (rate->ops.convert || rate->ops.convert_s16) ||
+ ! rate->ops.input_frames || ! rate->ops.output_frames) {
+ SNDERR("Inproper rate plugin %s initialization", type);
+@@ -1387,7 +1430,10 @@ pcm.name {
+ rate INT # Slave rate
+ [format STR] # Slave format
+ }
+- [converter STR] # Converter type, default is taken from
++ converter STR # optional
++ # or
++ converter [ STR1 STR2 ... ] # optional
++ # Converter type, default is taken from
+ # defaults.pcm.rate_converter
+ }
+ \endcode
+@@ -1424,7 +1470,7 @@ int _snd_pcm_rate_open(snd_pcm_t **pcmp,
+ snd_config_t *slave = NULL, *sconf;
+ snd_pcm_format_t sformat = SND_PCM_FORMAT_UNKNOWN;
+ int srate = -1;
+- const char *type = NULL;
++ const snd_config_t *converter = NULL;
+
+ snd_config_for_each(i, next, conf) {
+ snd_config_t *n = snd_config_iterator_entry(i);
+@@ -1438,12 +1484,7 @@ int _snd_pcm_rate_open(snd_pcm_t **pcmp,
+ continue;
+ }
+ if (strcmp(id, "converter") == 0) {
+- const char *str;
+- if ((err = snd_config_get_string(n, &str)) < 0) {
+- SNDERR("invalid converter string");
+- return -EINVAL;
+- }
+- type = str;
++ converter = n;
+ continue;
+ }
+ SNDERR("Unknown field %s", id);
+@@ -1470,7 +1511,7 @@ int _snd_pcm_rate_open(snd_pcm_t **pcmp,
+ if (err < 0)
+ return err;
+ err = snd_pcm_rate_open(pcmp, name, sformat, (unsigned int) srate,
+- type, spcm, 1);
++ converter, spcm, 1);
+ if (err < 0)
+ snd_pcm_close(spcm);
+ return err;
diff -r 3cfb9808fb42 src/pcm/plugin_ops.h
--- a/src/pcm/plugin_ops.h Mon Feb 26 09:21:12 2007 +0100
-+++ b/src/pcm/plugin_ops.h Fri Mar 09 15:59:18 2007 +0100
++++ b/src/pcm/plugin_ops.h Fri Mar 09 16:59:18 2007 +0200
@@ -85,6 +85,8 @@ static inline u_int32_t sx24s(u_int32_t
#define _put_triple(ptr,val) _put_triple_be(ptr,val)
#define _put_triple_s(ptr,val) _put_triple_le(ptr,val)
@@ -850,3 +1785,59 @@ diff -r 3cfb9808fb42 src/pcm/plugin_ops.h
#undef _put_triple_be
+#undef shift_down
+diff -r 3cfb9808fb42 src/rawmidi/rawmidi.c
+--- a/src/rawmidi/rawmidi.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/rawmidi/rawmidi.c Thu Mar 22 01:43:32 2007 +0200
+@@ -139,7 +139,6 @@ This example shows open and read/write r
+ #include
+ #include
+ #include
+-#include
+ #include "rawmidi_local.h"
+
+ /**
+diff -r 3cfb9808fb42 src/seq/seq.c
+--- a/src/seq/seq.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/seq/seq.c Thu Mar 22 01:43:32 2007 +0200
+@@ -777,7 +777,6 @@ void event_filter(snd_seq_t *seq, snd_se
+
+ */
+
+-#include
+ #include
+ #include "seq_local.h"
+
+diff -r 3cfb9808fb42 src/timer/timer.c
+--- a/src/timer/timer.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/timer/timer.c Thu Mar 22 01:43:32 2007 +0200
+@@ -72,7 +72,6 @@ This example shows opening a timer devic
+ #include
+ #include
+ #include
+-#include
+ #include
+ #include
+ #include "timer_local.h"
+diff -r 3cfb9808fb42 src/timer/timer_query.c
+--- a/src/timer/timer_query.c Mon Feb 26 09:21:12 2007 +0100
++++ b/src/timer/timer_query.c Thu Mar 22 01:43:32 2007 +0200
+@@ -31,7 +31,6 @@
+ #include
+ #include
+ #include
+-#include
+ #include
+ #include "timer_local.h"
+
+diff -r 3cfb9808fb42 utils/alsa.pc.in
+--- a/utils/alsa.pc.in Mon Feb 26 09:21:12 2007 +0100
++++ b/utils/alsa.pc.in Thu Mar 22 01:43:32 2007 +0200
+@@ -8,7 +8,7 @@ Version: @VERSION@
+ Version: @VERSION@
+ Requires:
+ Libs: -L${libdir} -lasound
+-Libs.private: -lm -ldl -lpthread
++Libs.private: @ALSA_DEPLIBS@
+ # -I${includedir}/alsa below is just for backward compatibility
+ # (it was set so mistakely in the older version)
+ Cflags: -I${includedir} -I${includedir}/alsa
diff --git a/alsa.changes b/alsa.changes
index 97e0c95..7632128 100644
--- a/alsa.changes
+++ b/alsa.changes
@@ -1,3 +1,12 @@
+-------------------------------------------------------------------
+Thu Mar 29 17:22:18 CEST 2007 - tiwai@suse.de
+
+- add ncurses-devel to BuildRequires
+- update alsa-lib 2007.03.28 snapshot
+ * fix shared lib builds
+ * more confined plugin selections
+ * use speexrate as the default plugin if available
+
-------------------------------------------------------------------
Wed Mar 14 16:42:02 CET 2007 - tiwai@suse.de
diff --git a/alsa.spec b/alsa.spec
index e434b0f..1e46422 100644
--- a/alsa.spec
+++ b/alsa.spec
@@ -11,7 +11,7 @@
# norootforbuild
Name: alsa
-BuildRequires: doxygen
+BuildRequires: doxygen ncurses-devel
%define package_version 1.0.14rc3
License: GNU General Public License (GPL)
Group: System/Libraries
@@ -21,7 +21,7 @@ PreReq: %insserv_prereq %fillup_prereq
Autoreqprov: on
Summary: Advanced Linux Sound Architecture
Version: 1.0.13
-Release: 33
+Release: 36
Source1: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-%{package_version}.tar.bz2
# Source2: ftp://ftp.alsa-project.org/pub/util/alsa-utils-%{package_version}.tar.bz2
Source2: ftp://ftp.alsa-project.org/pub/util/alsa-utils-1.0.14rc2.tar.bz2
@@ -369,6 +369,12 @@ exit 0
%doc alsa-lib*/doc/doxygen/html/*
%changelog
+* Thu Mar 29 2007 - tiwai@suse.de
+- add ncurses-devel to BuildRequires
+- update alsa-lib 2007.03.28 snapshot
+ * fix shared lib builds
+ * more confined plugin selections
+ * use speexrate as the default plugin if available
* Wed Mar 14 2007 - tiwai@suse.de
- update alsa-lib-1.0.14rc3
* include last fixes