aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2014-10-03 14:24:17 +0000
committerNicolas Dechesne <nicolas.dechesne@linaro.org>2014-10-03 14:24:17 +0000
commitce044e34dc846856d91f6023e4074dd3f4ab8816 (patch)
treeabacddd1ae38d38f929760f18422251a2a3717e0
parent7786e88c56b91bcac3295c58b7a4ad6642990b8c (diff)
Imported Upstream version 1.0.28upstream/1.0.28upstream
-rw-r--r--Makefile.am2
-rw-r--r--Makefile.in4
-rw-r--r--alsalisp/Makefile.am2
-rw-r--r--alsalisp/Makefile.in4
-rw-r--r--aserver/Makefile.am2
-rw-r--r--aserver/Makefile.in4
-rwxr-xr-xconfigure174
-rw-r--r--configure.ac (renamed from configure.in)95
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/Makefile.in4
-rw-r--r--doc/pictures/Makefile.in2
-rw-r--r--include/Makefile.am4
-rw-r--r--include/Makefile.in6
-rw-r--r--include/asoundlib-head.h13
-rw-r--r--include/asoundlib.h2
-rw-r--r--include/config.h.in8
-rw-r--r--include/global.h2
-rw-r--r--include/iatomic.h1044
-rw-r--r--include/local.h25
-rw-r--r--include/sound/Makefile.in2
-rw-r--r--include/sound/hdspm.h2
-rw-r--r--include/use-case.h4
-rw-r--r--include/version.h4
-rwxr-xr-xlibtool2
-rw-r--r--modules/Makefile.in2
-rw-r--r--modules/mixer/Makefile.in2
-rw-r--r--modules/mixer/simple/Makefile.am2
-rw-r--r--modules/mixer/simple/Makefile.in4
-rw-r--r--src/Makefile.am9
-rw-r--r--src/Makefile.in16
-rw-r--r--src/alisp/Makefile.am2
-rw-r--r--src/alisp/Makefile.in4
-rw-r--r--src/alisp/alisp.c3
-rw-r--r--src/compat/Makefile.am8
-rw-r--r--src/compat/Makefile.in556
-rw-r--r--src/compat/empty.c0
-rw-r--r--src/compat/hsearch_r.c236
-rw-r--r--src/conf.c15
-rw-r--r--src/conf/Makefile.in2
-rw-r--r--src/conf/alsa.conf3
-rw-r--r--src/conf/alsa.conf.d/Makefile.in2
-rw-r--r--src/conf/cards/ATIIXP-SPDMA.conf1
-rw-r--r--src/conf/cards/ATIIXP.conf1
-rw-r--r--src/conf/cards/Audigy.conf1
-rw-r--r--src/conf/cards/Audigy2.conf1
-rw-r--r--src/conf/cards/Aureon51.conf1
-rw-r--r--src/conf/cards/Aureon71.conf1
-rw-r--r--src/conf/cards/CA0106.conf1
-rw-r--r--src/conf/cards/CMI8738-MC6.conf1
-rw-r--r--src/conf/cards/CMI8738-MC8.conf1
-rw-r--r--src/conf/cards/CMI8788.conf2
-rw-r--r--src/conf/cards/CS46xx.conf1
-rw-r--r--src/conf/cards/EMU10K1.conf1
-rw-r--r--src/conf/cards/EMU10K1X.conf1
-rw-r--r--src/conf/cards/FM801.conf1
-rw-r--r--src/conf/cards/FireWave.conf1
-rw-r--r--src/conf/cards/HDA-Intel.conf93
-rw-r--r--src/conf/cards/ICE1712.conf1
-rw-r--r--src/conf/cards/ICE1724.conf1
-rw-r--r--src/conf/cards/ICH.conf1
-rw-r--r--src/conf/cards/ICH4.conf1
-rw-r--r--src/conf/cards/Loopback.conf75
-rw-r--r--src/conf/cards/Makefile.am1
-rw-r--r--src/conf/cards/Makefile.in14
-rw-r--r--src/conf/cards/NFORCE.conf1
-rw-r--r--src/conf/cards/SB-XFi.conf1
-rw-r--r--src/conf/cards/SI7018.conf1
-rw-r--r--src/conf/cards/USB-Audio.conf36
-rw-r--r--src/conf/cards/VIA8233.conf1
-rw-r--r--src/conf/cards/VIA8233A.conf1
-rw-r--r--src/conf/cards/VIA8237.conf1
-rw-r--r--src/conf/pcm/Makefile.am2
-rw-r--r--src/conf/pcm/Makefile.in4
-rw-r--r--src/conf/pcm/surround21.conf61
-rw-r--r--src/conf/ucm/DAISY-I2S/Makefile.in2
-rw-r--r--src/conf/ucm/Makefile.in2
-rw-r--r--src/conf/ucm/PandaBoard/Makefile.in2
-rw-r--r--src/conf/ucm/PandaBoardES/Makefile.in2
-rw-r--r--src/conf/ucm/SDP4430/Makefile.in2
-rw-r--r--src/conf/ucm/tegraalc5632/Makefile.in2
-rw-r--r--src/control/Makefile.am2
-rw-r--r--src/control/Makefile.in4
-rw-r--r--src/control/control_hw.c4
-rw-r--r--src/control/namehint.c22
-rw-r--r--src/control/tlv.c2
-rw-r--r--src/hwdep/Makefile.am2
-rw-r--r--src/hwdep/Makefile.in4
-rw-r--r--src/mixer/Makefile.am2
-rw-r--r--src/mixer/Makefile.in4
-rw-r--r--src/pcm/Makefile.am2
-rw-r--r--src/pcm/Makefile.in4
-rw-r--r--src/pcm/pcm.c4
-rw-r--r--src/pcm/pcm_direct.c2
-rw-r--r--src/pcm/pcm_direct.h4
-rw-r--r--src/pcm/pcm_dmix.c2
-rw-r--r--src/pcm/pcm_dshare.c2
-rw-r--r--src/pcm/pcm_dsnoop.c2
-rw-r--r--src/pcm/pcm_file.c29
-rw-r--r--src/pcm/pcm_hw.c2
-rw-r--r--src/pcm/pcm_iec958.c37
-rw-r--r--src/pcm/pcm_ioplug.c2
-rw-r--r--src/pcm/pcm_ladspa.c6
-rw-r--r--src/pcm/pcm_local.h8
-rw-r--r--src/pcm/pcm_meter.c9
-rw-r--r--src/pcm/pcm_multi.c38
-rw-r--r--src/pcm/pcm_null.c48
-rw-r--r--src/pcm/pcm_plug.c48
-rw-r--r--src/pcm/pcm_plugin.c4
-rw-r--r--src/pcm/pcm_plugin.h6
-rw-r--r--src/pcm/pcm_rate.c92
-rw-r--r--src/pcm/pcm_route.c329
-rw-r--r--src/pcm/scopes/Makefile.in2
-rw-r--r--src/rawmidi/Makefile.am2
-rw-r--r--src/rawmidi/Makefile.in4
-rw-r--r--src/seq/Makefile.am2
-rw-r--r--src/seq/Makefile.in4
-rw-r--r--src/timer/Makefile.am2
-rw-r--r--src/timer/Makefile.in4
-rw-r--r--src/ucm/Makefile.am2
-rw-r--r--src/ucm/Makefile.in4
-rw-r--r--test/Makefile.am4
-rw-r--r--test/Makefile.in16
-rw-r--r--test/chmap.c1
-rw-r--r--test/lsb/Makefile.in2
-rw-r--r--utils/Makefile.am2
-rw-r--r--utils/Makefile.in4
-rw-r--r--version2
127 files changed, 1098 insertions, 2288 deletions
diff --git a/Makefile.am b/Makefile.am
index f0c39c1d..52f7654a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,7 +17,7 @@ EXTRA_DIST=ChangeLog INSTALL TODO NOTES configure gitcompile libtool \
depcomp version MEMORY-LEAK m4/attributes.m4
AUTOMAKE_OPTIONS=foreign
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
rpm: dist
$(MAKE) -C utils rpm
diff --git a/Makefile.in b/Makefile.in
index dee9bcb6..799fb943 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -59,7 +59,7 @@ DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
ltconfig ltmain.sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -280,7 +280,7 @@ EXTRA_DIST = ChangeLog INSTALL TODO NOTES configure gitcompile libtool \
depcomp version MEMORY-LEAK m4/attributes.m4
AUTOMAKE_OPTIONS = foreign
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
all: all-recursive
.SUFFIXES:
diff --git a/alsalisp/Makefile.am b/alsalisp/Makefile.am
index 6df915a1..8e3e0159 100644
--- a/alsalisp/Makefile.am
+++ b/alsalisp/Makefile.am
@@ -5,4 +5,4 @@ alsalisp_LDADD = ../src/libasound.la
all: alsalisp
-INCLUDES=-I$(top_srcdir)/include -I$(top_srcdir)/src/alisp
+AM_CPPFLAGS=-I$(top_srcdir)/include -I$(top_srcdir)/src/alisp
diff --git a/alsalisp/Makefile.in b/alsalisp/Makefile.in
index f56d58fe..55e02117 100644
--- a/alsalisp/Makefile.in
+++ b/alsalisp/Makefile.in
@@ -56,7 +56,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -245,7 +245,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
alsalisp_SOURCES = alsalisp.c
alsalisp_LDADD = ../src/libasound.la
-INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src/alisp
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src/alisp
all: all-am
.SUFFIXES:
diff --git a/aserver/Makefile.am b/aserver/Makefile.am
index 116f578b..fbdb94cf 100644
--- a/aserver/Makefile.am
+++ b/aserver/Makefile.am
@@ -5,7 +5,7 @@ aserver_LDADD = ../src/libasound.la
all: aserver
-INCLUDES=-I$(top_srcdir)/include -I$(top_srcdir)/src/pcm
+AM_CPPFLAGS=-I$(top_srcdir)/include -I$(top_srcdir)/src/pcm
../src/libasound.la:
$(MAKE) -C ../src libasound.la
diff --git a/aserver/Makefile.in b/aserver/Makefile.in
index 493bf1a2..e2744e95 100644
--- a/aserver/Makefile.in
+++ b/aserver/Makefile.in
@@ -56,7 +56,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/depcomp COPYING
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -247,7 +247,7 @@ top_srcdir = @top_srcdir@
aserver_SOURCES = aserver.c
# aserver_LDADD = -lasound
aserver_LDADD = ../src/libasound.la
-INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src/pcm
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src/pcm
all: all-am
.SUFFIXES:
diff --git a/configure b/configure
index ed41e87f..25cfbbea 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69.
+# Generated by GNU Autoconf 2.69 for alsa-lib 1.0.28.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -585,12 +585,12 @@ MFLAGS=
MAKEFLAGS=
# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-PACKAGE_URL=
+PACKAGE_NAME='alsa-lib'
+PACKAGE_TARNAME='alsa-lib'
+PACKAGE_VERSION='1.0.28'
+PACKAGE_STRING='alsa-lib 1.0.28'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
ac_unique_file="src/control/control.c"
ac_default_prefix=/usr
@@ -733,8 +733,6 @@ SND_LIB_SUBMINOR
SND_LIB_MINOR
SND_LIB_MAJOR
SND_LIB_VERSION
-ALSA_HSEARCH_R_FALSE
-ALSA_HSEARCH_R_TRUE
OTOOL64
OTOOL
LIPO
@@ -945,7 +943,7 @@ sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
includedir='${prefix}/include'
oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE}'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
infodir='${datarootdir}/info'
htmldir='${docdir}'
dvidir='${docdir}'
@@ -1445,7 +1443,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
+\`configure' configures alsa-lib 1.0.28 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1493,7 +1491,7 @@ Fine tuning of the installation directories:
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/alsa-lib]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
@@ -1514,7 +1512,9 @@ _ACEOF
fi
if test -n "$ac_init_help"; then
-
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of alsa-lib 1.0.28:";;
+ esac
cat <<\_ACEOF
Optional Features:
@@ -1663,7 +1663,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-configure
+alsa-lib configure 1.0.28
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2028,7 +2028,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by $as_me, which was
+It was created by alsa-lib $as_me 1.0.28, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2379,6 +2379,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
if test -f "$ac_dir/install-sh"; then
@@ -2925,9 +2926,8 @@ fi
# Define the identity of the package.
-
- PACKAGE=alsa-lib
- VERSION=1.0.27.2
+ PACKAGE='alsa-lib'
+ VERSION='1.0.28'
cat >>confdefs.h <<_ACEOF
@@ -11883,19 +11883,6 @@ $as_echo "$ac_cv_prog_gcc_traditional" >&6; }
fi
fi
-ac_fn_c_check_func "$LINENO" "hsearch_r" "ac_cv_func_hsearch_r"
-if test "x$ac_cv_func_hsearch_r" = xyes; then :
- HAVE_HSEARCH_R=yes
-fi
-
- if test "x$HAVE_HSEARCH_R" != xyes; then
- ALSA_HSEARCH_R_TRUE=
- ALSA_HSEARCH_R_FALSE='#'
-else
- ALSA_HSEARCH_R_TRUE='#'
- ALSA_HSEARCH_R_FALSE=
-fi
-
for ac_func in uselocale
do :
ac_fn_c_check_func "$LINENO" "uselocale" "ac_cv_func_uselocale"
@@ -12434,54 +12421,13 @@ fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for architecture" >&5
-$as_echo_n "checking for architecture... " >&6; }
-case "$host" in
-i?86*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: x86" >&5
-$as_echo "x86" >&6; }
- ;;
-x86_64*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: x86" >&5
-$as_echo "x86" >&6; }
- ;;
-alpha*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: alpha" >&5
-$as_echo "alpha" >&6; }
- ;;
-powerpc*|ppc*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ppc" >&5
-$as_echo "ppc" >&6; }
- CPPFLAGS="$CPPFLAGS -D__ppc__"
- ;;
-ia64*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ia64" >&5
-$as_echo "ia64" >&6; }
- CPPFLAGS="$CPPFLAGS -D__ia64__"
- ;;
-mips*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: mips" >&5
-$as_echo "mips" >&6; }
- CPPFLAGS="$CPPFLAGS -D__mips__"
- ;;
-arm*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: arm" >&5
-$as_echo "arm" >&6; }
- CPPFLAGS="$CPPFLAGS -D__arm__"
- ;;
-*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $host_cpu" >&5
-$as_echo "$host_cpu" >&6; }
- echo "No atomic operations supported.."
- ;;
-esac
-
-for ac_header in wordexp.h
+for ac_header in wordexp.h endian.h sys/endian.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "wordexp.h" "ac_cv_header_wordexp_h" "$ac_includes_default"
-if test "x$ac_cv_header_wordexp_h" = xyes; then :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_WORDEXP_H 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -12827,6 +12773,36 @@ else
pcm_plugins=""
fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GCC supports builtin atomic intrinsics" >&5
+$as_echo_n "checking whether GCC supports builtin atomic intrinsics... " >&6; }
+if test -z "$gcc_have_atomics"; then
+ gcc_have_atomics=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+int i;
+ __atomic_load_n(&i, __ATOMIC_SEQ_CST);
+ __atomic_add_fetch(&i, 0, __ATOMIC_SEQ_CST);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_have_atomics=yes
+else
+ gcc_have_atomics=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_have_atomics" >&5
+$as_echo "$gcc_have_atomics" >&6; }
+
PCM_PLUGIN_LIST="copy linear route mulaw alaw adpcm rate plug multi shm file null empty share meter hooks lfloat ladspa dmix dshare dsnoop asym iec958 softvol extplug ioplug mmap_emul"
build_pcm_plugin="no"
@@ -12869,6 +12845,10 @@ if test "$softfloat" = "yes"; then
build_pcm_ladspa="no"
fi
+if test "$gcc_have_atomics" != "yes"; then
+ build_pcm_meter="no"
+fi
+
if test x$build_pcm_plugin = xyes; then
BUILD_PCM_PLUGIN_TRUE=
BUILD_PCM_PLUGIN_FALSE='#'
@@ -13229,7 +13209,7 @@ if test ! -L "$srcdir"/include/alsa ; then
ln -sf . "$srcdir"/include/alsa
fi
-ac_config_files="$ac_config_files Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg include/Makefile include/sound/Makefile src/Versions src/Makefile src/control/Makefile src/mixer/Makefile src/pcm/Makefile src/pcm/scopes/Makefile src/rawmidi/Makefile src/timer/Makefile src/hwdep/Makefile src/seq/Makefile src/ucm/Makefile src/compat/Makefile src/alisp/Makefile src/conf/Makefile src/conf/alsa.conf.d/Makefile src/conf/cards/Makefile src/conf/pcm/Makefile src/conf/ucm/Makefile src/conf/ucm/DAISY-I2S/Makefile src/conf/ucm/PandaBoard/Makefile src/conf/ucm/PandaBoardES/Makefile src/conf/ucm/SDP4430/Makefile src/conf/ucm/tegraalc5632/Makefile modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile alsalisp/Makefile aserver/Makefile test/Makefile test/lsb/Makefile utils/Makefile utils/alsa-lib.spec utils/alsa.pc"
+ac_config_files="$ac_config_files Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg include/Makefile include/sound/Makefile src/Versions src/Makefile src/control/Makefile src/mixer/Makefile src/pcm/Makefile src/pcm/scopes/Makefile src/rawmidi/Makefile src/timer/Makefile src/hwdep/Makefile src/seq/Makefile src/ucm/Makefile src/alisp/Makefile src/conf/Makefile src/conf/alsa.conf.d/Makefile src/conf/cards/Makefile src/conf/pcm/Makefile src/conf/ucm/Makefile src/conf/ucm/DAISY-I2S/Makefile src/conf/ucm/PandaBoard/Makefile src/conf/ucm/PandaBoardES/Makefile src/conf/ucm/SDP4430/Makefile src/conf/ucm/tegraalc5632/Makefile modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile alsalisp/Makefile aserver/Makefile test/Makefile test/lsb/Makefile utils/Makefile utils/alsa-lib.spec utils/alsa.pc"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -13372,10 +13352,6 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${ALSA_HSEARCH_R_TRUE}" && test -z "${ALSA_HSEARCH_R_FALSE}"; then
- as_fn_error $? "conditional \"ALSA_HSEARCH_R\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${VERSIONED_SYMBOLS_TRUE}" && test -z "${VERSIONED_SYMBOLS_FALSE}"; then
as_fn_error $? "conditional \"VERSIONED_SYMBOLS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -13945,7 +13921,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by $as_me, which was
+This file was extended by alsa-lib $as_me 1.0.28, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -14011,7 +13987,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-config.status
+alsa-lib config.status 1.0.28
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -14437,7 +14413,6 @@ do
"src/hwdep/Makefile") CONFIG_FILES="$CONFIG_FILES src/hwdep/Makefile" ;;
"src/seq/Makefile") CONFIG_FILES="$CONFIG_FILES src/seq/Makefile" ;;
"src/ucm/Makefile") CONFIG_FILES="$CONFIG_FILES src/ucm/Makefile" ;;
- "src/compat/Makefile") CONFIG_FILES="$CONFIG_FILES src/compat/Makefile" ;;
"src/alisp/Makefile") CONFIG_FILES="$CONFIG_FILES src/alisp/Makefile" ;;
"src/conf/Makefile") CONFIG_FILES="$CONFIG_FILES src/conf/Makefile" ;;
"src/conf/alsa.conf.d/Makefile") CONFIG_FILES="$CONFIG_FILES src/conf/alsa.conf.d/Makefile" ;;
@@ -15818,6 +15793,35 @@ fi
echo "Creating asoundlib.h..."
cp "$srcdir"/include/asoundlib-head.h include/asoundlib.h
+test "$ac_cv_header_endian_h" = "yes" && echo "#include <endian.h>" >> include/asoundlib.h
+if test "$ac_cv_header_sys_endian_h" = "yes"; then
+cat >> include/asoundlib.h <<EOF
+#include <sys/endian.h>
+#ifndef __BYTE_ORDER
+#define __BYTE_ORDER BYTE_ORDER
+#endif
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#endif
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN BIG_ENDIAN
+#endif
+EOF
+fi
+cat >> include/asoundlib.h <<EOF
+
+#ifndef __GNUC__
+#define __inline__ inline
+#endif
+
+#include <alsa/asoundef.h>
+#include <alsa/version.h>
+#include <alsa/global.h>
+#include <alsa/input.h>
+#include <alsa/output.h>
+#include <alsa/error.h>
+#include <alsa/conf.h>
+EOF
test "$build_pcm" = "yes" && echo "#include <alsa/pcm.h>" >> include/asoundlib.h
test "$build_rawmidi" = "yes" && echo "#include <alsa/rawmidi.h>" >> include/asoundlib.h
test "$build_pcm" = "yes" && echo "#include <alsa/timer.h>" >> include/asoundlib.h
diff --git a/configure.in b/configure.ac
index 00fff2b8..b8353a09 100644
--- a/configure.in
+++ b/configure.ac
@@ -1,7 +1,8 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT(src/control/control.c)
+AC_INIT(alsa-lib, 1.0.28)
+AC_CONFIG_SRCDIR([src/control/control.c])
AC_CONFIG_MACRO_DIR([m4])
dnl *************************************************
@@ -12,7 +13,7 @@ dnl add API = c+1:0:a+1
dnl remove API = c+1:0:0
dnl *************************************************
AC_CANONICAL_HOST
-AM_INIT_AUTOMAKE(alsa-lib, 1.0.27.2)
+AM_INIT_AUTOMAKE
eval LIBTOOL_VERSION_INFO="2:0:0"
dnl *************************************************
AM_CONDITIONAL([INSTALL_M4], [test -n "${ACLOCAL}"])
@@ -64,8 +65,6 @@ AC_HEADER_TIME
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
-AC_CHECK_FUNC([hsearch_r], [HAVE_HSEARCH_R=yes])
-AM_CONDITIONAL([ALSA_HSEARCH_R], [test "x$HAVE_HSEARCH_R" != xyes])
AC_CHECK_FUNCS([uselocale])
SAVE_LIBRARY_VERSION
@@ -311,42 +310,8 @@ fi
AC_SUBST(ALSA_DEPLIBS)
-dnl Check for architecture
-AC_MSG_CHECKING(for architecture)
-case "$host" in
-i?86*)
- AC_MSG_RESULT(x86)
- ;;
-x86_64*)
- AC_MSG_RESULT(x86)
- ;;
-alpha*)
- AC_MSG_RESULT(alpha)
- ;;
-powerpc*|ppc*)
- AC_MSG_RESULT(ppc)
- CPPFLAGS="$CPPFLAGS -D__ppc__"
- ;;
-ia64*)
- AC_MSG_RESULT(ia64)
- CPPFLAGS="$CPPFLAGS -D__ia64__"
- ;;
-mips*)
- AC_MSG_RESULT(mips)
- CPPFLAGS="$CPPFLAGS -D__mips__"
- ;;
-arm*)
- AC_MSG_RESULT(arm)
- CPPFLAGS="$CPPFLAGS -D__arm__"
- ;;
-*)
- AC_MSG_RESULT($host_cpu)
- echo "No atomic operations supported.."
- ;;
-esac
-
-dnl Check for wordexp.h
-AC_CHECK_HEADERS([wordexp.h])
+dnl Check for headers
+AC_CHECK_HEADERS([wordexp.h endian.h sys/endian.h])
dnl Check for resmgr support...
AC_MSG_CHECKING(for resmgr support)
@@ -490,6 +455,21 @@ else
pcm_plugins=""
fi
+dnl check atomics for pcm_meter
+
+AC_MSG_CHECKING([whether GCC supports builtin atomic intrinsics])
+if test -z "$gcc_have_atomics"; then
+ gcc_have_atomics=no
+ AC_TRY_LINK([],
+ [int i;
+ __atomic_load_n(&i, __ATOMIC_SEQ_CST);
+ __atomic_add_fetch(&i, 0, __ATOMIC_SEQ_CST);
+ ],
+ [gcc_have_atomics=yes],
+ [gcc_have_atomics=no])
+fi
+AC_MSG_RESULT($gcc_have_atomics)
+
PCM_PLUGIN_LIST="copy linear route mulaw alaw adpcm rate plug multi shm file null empty share meter hooks lfloat ladspa dmix dshare dsnoop asym iec958 softvol extplug ioplug mmap_emul"
build_pcm_plugin="no"
@@ -533,6 +513,10 @@ if test "$softfloat" = "yes"; then
build_pcm_ladspa="no"
fi
+if test "$gcc_have_atomics" != "yes"; then
+ build_pcm_meter="no"
+fi
+
AM_CONDITIONAL([BUILD_PCM_PLUGIN], [test x$build_pcm_plugin = xyes])
AM_CONDITIONAL([BUILD_PCM_PLUGIN_COPY], [test x$build_pcm_copy = xyes])
AM_CONDITIONAL([BUILD_PCM_PLUGIN_LINEAR], [test x$build_pcm_linear = xyes])
@@ -659,7 +643,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
src/pcm/Makefile src/pcm/scopes/Makefile \
src/rawmidi/Makefile src/timer/Makefile \
src/hwdep/Makefile src/seq/Makefile src/ucm/Makefile \
- src/compat/Makefile src/alisp/Makefile \
+ src/alisp/Makefile \
src/conf/Makefile src/conf/alsa.conf.d/Makefile \
src/conf/cards/Makefile \
src/conf/pcm/Makefile \
@@ -677,6 +661,35 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
dnl Create asoundlib.h dynamically according to configure options
echo "Creating asoundlib.h..."
cp "$srcdir"/include/asoundlib-head.h include/asoundlib.h
+test "$ac_cv_header_endian_h" = "yes" && echo "#include <endian.h>" >> include/asoundlib.h
+if test "$ac_cv_header_sys_endian_h" = "yes"; then
+cat >> include/asoundlib.h <<EOF
+#include <sys/endian.h>
+#ifndef __BYTE_ORDER
+#define __BYTE_ORDER BYTE_ORDER
+#endif
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#endif
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN BIG_ENDIAN
+#endif
+EOF
+fi
+cat >> include/asoundlib.h <<EOF
+
+#ifndef __GNUC__
+#define __inline__ inline
+#endif
+
+#include <alsa/asoundef.h>
+#include <alsa/version.h>
+#include <alsa/global.h>
+#include <alsa/input.h>
+#include <alsa/output.h>
+#include <alsa/error.h>
+#include <alsa/conf.h>
+EOF
test "$build_pcm" = "yes" && echo "#include <alsa/pcm.h>" >> include/asoundlib.h
test "$build_rawmidi" = "yes" && echo "#include <alsa/rawmidi.h>" >> include/asoundlib.h
test "$build_pcm" = "yes" && echo "#include <alsa/timer.h>" >> include/asoundlib.h
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 406fde76..e087f424 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -2,7 +2,7 @@ SUBDIRS=pictures
EXTRA_DIST=README.1st asoundrc.txt doxygen.cfg index.doxygen
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
doc:
test -e doxygen.cfg || sed s:[@]top_srcdir[@]:..:g doxygen.cfg.in > doxygen.cfg
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 3ddea4f7..5b9b738a 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -54,7 +54,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/doxygen.cfg.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -251,7 +251,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = pictures
EXTRA_DIST = README.1st asoundrc.txt doxygen.cfg index.doxygen
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
all: all-recursive
.SUFFIXES:
diff --git a/doc/pictures/Makefile.in b/doc/pictures/Makefile.in
index 77b7fa03..eb72218e 100644
--- a/doc/pictures/Makefile.in
+++ b/doc/pictures/Makefile.in
@@ -53,7 +53,7 @@ subdir = doc/pictures
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/include/Makefile.am b/include/Makefile.am
index de37f2cc..0127d5c4 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -61,7 +61,7 @@ alsa:
version.h: stamp-vh alsa
@:
-stamp-vh: $(top_builddir)/configure.in
+stamp-vh: $(top_builddir)/configure.ac
@echo "/*" > ver.tmp
@echo " * version.h" >> ver.tmp
@echo " */" >> ver.tmp
@@ -83,7 +83,7 @@ stamp-vh: $(top_builddir)/configure.in
echo timestamp > stamp-vh)
-@rm -f ver.tmp
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
install-data-hook:
test -d $(DESTDIR)$(sysincludedir) || mkdir -p $(DESTDIR)$(sysincludedir)
diff --git a/include/Makefile.in b/include/Makefile.in
index b06730ff..9e7aa52d 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -68,7 +68,7 @@ DIST_COMMON = $(am__alsainclude_HEADERS_DIST) $(noinst_HEADERS) \
$(srcdir)/config.h.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -311,7 +311,7 @@ noinst_HEADERS = alsa sys.h search.h list.h aserver.h local.h alsa-symbols.h \
asoundlib-head.h asoundlib-tail.h
DISTCLEANFILES = stamp-vh version.h alsa asoundlib.h
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -703,7 +703,7 @@ alsa:
version.h: stamp-vh alsa
@:
-stamp-vh: $(top_builddir)/configure.in
+stamp-vh: $(top_builddir)/configure.ac
@echo "/*" > ver.tmp
@echo " * version.h" >> ver.tmp
@echo " */" >> ver.tmp
diff --git a/include/asoundlib-head.h b/include/asoundlib-head.h
index 71b5c29f..1ec611e5 100644
--- a/include/asoundlib-head.h
+++ b/include/asoundlib-head.h
@@ -35,19 +35,6 @@
#include <string.h>
#include <fcntl.h>
#include <assert.h>
-#include <endian.h>
#include <sys/poll.h>
#include <errno.h>
#include <stdarg.h>
-
-#ifndef __GNUC__
-#define __inline__ inline
-#endif
-
-#include <alsa/asoundef.h>
-#include <alsa/version.h>
-#include <alsa/global.h>
-#include <alsa/input.h>
-#include <alsa/output.h>
-#include <alsa/error.h>
-#include <alsa/conf.h>
diff --git a/include/asoundlib.h b/include/asoundlib.h
index e6792e81..3c2766e3 100644
--- a/include/asoundlib.h
+++ b/include/asoundlib.h
@@ -35,10 +35,10 @@
#include <string.h>
#include <fcntl.h>
#include <assert.h>
-#include <endian.h>
#include <sys/poll.h>
#include <errno.h>
#include <stdarg.h>
+#include <endian.h>
#ifndef __GNUC__
#define __inline__ inline
diff --git a/include/config.h.in b/include/config.h.in
index c9b5b17d..629616a1 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -1,4 +1,4 @@
-/* include/config.h.in. Generated from configure.in by autoheader. */
+/* include/config.h.in. Generated from configure.ac by autoheader. */
/* Directory with aload* device files */
#undef ALOAD_DEVICE_DIRECTORY
@@ -63,6 +63,9 @@
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
+/* Define to 1 if you have the <endian.h> header file. */
+#undef HAVE_ENDIAN_H
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -96,6 +99,9 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the <sys/endian.h> header file. */
+#undef HAVE_SYS_ENDIAN_H
+
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
diff --git a/include/global.h b/include/global.h
index 3e3680fb..16a26dc8 100644
--- a/include/global.h
+++ b/include/global.h
@@ -133,6 +133,7 @@ int snd_shm_area_destroy(struct snd_shm_area *area);
int snd_user_file(const char *file, char **result);
+#ifdef __GLIBC__
#if !defined(_POSIX_C_SOURCE) && !defined(_POSIX_SOURCE)
struct timeval {
time_t tv_sec; /* seconds */
@@ -144,6 +145,7 @@ struct timespec {
long tv_nsec; /* nanoseconds */
};
#endif
+#endif
/** Timestamp */
typedef struct timeval snd_timestamp_t;
diff --git a/include/iatomic.h b/include/iatomic.h
index 5711fe8d..acdd3e29 100644
--- a/include/iatomic.h
+++ b/include/iatomic.h
@@ -1,349 +1,21 @@
#ifndef __ALSA_IATOMIC_H
#define __ALSA_IATOMIC_H
-#if defined(__i386__) || defined(__x86_64__)
-
-/*
- * Atomic operations that C can't guarantee us. Useful for
- * resource counting etc..
- */
-
-#define ATOMIC_SMP_LOCK "lock ; "
-
-/*
- * Make sure gcc doesn't try to be clever and move things around
- * on us. We need to use _exactly_ the address the user gave us,
- * not some alias that contains the same information.
- */
-typedef struct { volatile int counter; } atomic_t;
-
-#define ATOMIC_INIT(i) { (i) }
-
-/**
- * atomic_read - read atomic variable
- * @v: pointer of type atomic_t
- *
- * Atomically reads the value of @v. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-#define atomic_read(v) ((v)->counter)
-
-/**
- * atomic_set - set atomic variable
- * @v: pointer of type atomic_t
- * @i: required value
- *
- * Atomically sets the value of @v to @i. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-#define atomic_set(v,i) (((v)->counter) = (i))
-
-/**
- * atomic_add - add integer to atomic variable
- * @i: integer value to add
- * @v: pointer of type atomic_t
- *
- * Atomically adds @i to @v. Note that the guaranteed useful range
- * of an atomic_t is only 24 bits.
- */
-static __inline__ void atomic_add(int i, atomic_t *v)
-{
- __asm__ __volatile__(
- ATOMIC_SMP_LOCK "addl %1,%0"
- :"=m" (v->counter)
- :"ir" (i), "m" (v->counter));
-}
-
-/**
- * atomic_sub - subtract the atomic variable
- * @i: integer value to subtract
- * @v: pointer of type atomic_t
- *
- * Atomically subtracts @i from @v. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-static __inline__ void atomic_sub(int i, atomic_t *v)
-{
- __asm__ __volatile__(
- ATOMIC_SMP_LOCK "subl %1,%0"
- :"=m" (v->counter)
- :"ir" (i), "m" (v->counter));
-}
-
-/**
- * atomic_sub_and_test - subtract value from variable and test result
- * @i: integer value to subtract
- * @v: pointer of type atomic_t
- *
- * Atomically subtracts @i from @v and returns
- * true if the result is zero, or false for all
- * other cases. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-static __inline__ int atomic_sub_and_test(int i, atomic_t *v)
-{
- unsigned char c;
-
- __asm__ __volatile__(
- ATOMIC_SMP_LOCK "subl %2,%0; sete %1"
- :"=m" (v->counter), "=qm" (c)
- :"ir" (i), "m" (v->counter) : "memory");
- return c;
-}
-
-/**
- * atomic_inc - increment atomic variable
- * @v: pointer of type atomic_t
- *
- * Atomically increments @v by 1. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-static __inline__ void atomic_inc(atomic_t *v)
-{
- __asm__ __volatile__(
- ATOMIC_SMP_LOCK "incl %0"
- :"=m" (v->counter)
- :"m" (v->counter));
-}
-
-/**
- * atomic_dec - decrement atomic variable
- * @v: pointer of type atomic_t
- *
- * Atomically decrements @v by 1. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-static __inline__ void atomic_dec(atomic_t *v)
-{
- __asm__ __volatile__(
- ATOMIC_SMP_LOCK "decl %0"
- :"=m" (v->counter)
- :"m" (v->counter));
-}
-
-/**
- * atomic_dec_and_test - decrement and test
- * @v: pointer of type atomic_t
- *
- * Atomically decrements @v by 1 and
- * returns true if the result is 0, or false for all other
- * cases. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-static __inline__ int atomic_dec_and_test(atomic_t *v)
-{
- unsigned char c;
-
- __asm__ __volatile__(
- ATOMIC_SMP_LOCK "decl %0; sete %1"
- :"=m" (v->counter), "=qm" (c)
- :"m" (v->counter) : "memory");
- return c != 0;
-}
-
-/**
- * atomic_inc_and_test - increment and test
- * @v: pointer of type atomic_t
- *
- * Atomically increments @v by 1
- * and returns true if the result is zero, or false for all
- * other cases. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-static __inline__ int atomic_inc_and_test(atomic_t *v)
-{
- unsigned char c;
-
- __asm__ __volatile__(
- ATOMIC_SMP_LOCK "incl %0; sete %1"
- :"=m" (v->counter), "=qm" (c)
- :"m" (v->counter) : "memory");
- return c != 0;
-}
-
-/**
- * atomic_add_negative - add and test if negative
- * @v: pointer of type atomic_t
- * @i: integer value to add
- *
- * Atomically adds @i to @v and returns true
- * if the result is negative, or false when
- * result is greater than or equal to zero. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-static __inline__ int atomic_add_negative(int i, atomic_t *v)
-{
- unsigned char c;
-
- __asm__ __volatile__(
- ATOMIC_SMP_LOCK "addl %2,%0; sets %1"
- :"=m" (v->counter), "=qm" (c)
- :"ir" (i), "m" (v->counter) : "memory");
- return c;
-}
-
-/* These are x86-specific, used by some header files */
-#define atomic_clear_mask(mask, addr) \
-__asm__ __volatile__(ATOMIC_SMP_LOCK "andl %0,%1" \
-: : "r" (~(mask)),"m" (*addr) : "memory")
-
-#define atomic_set_mask(mask, addr) \
-__asm__ __volatile__(ATOMIC_SMP_LOCK "orl %0,%1" \
-: : "r" (mask),"m" (*addr) : "memory")
-
-/*
- * Force strict CPU ordering.
- * And yes, this is required on UP too when we're talking
- * to devices.
- *
- * For now, "wmb()" doesn't actually do anything, as all
- * Intel CPU's follow what Intel calls a *Processor Order*,
- * in which all writes are seen in the program order even
- * outside the CPU.
- *
- * I expect future Intel CPU's to have a weaker ordering,
- * but I'd also expect them to finally get their act together
- * and add some real memory barriers if so.
- */
-
#ifdef __i386__
#define mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
#define rmb() mb()
#define wmb() __asm__ __volatile__ ("": : :"memory")
-#else
+#define IATOMIC_DEFINED 1
+#endif
+
+#ifdef __x86_64__
#define mb() asm volatile("mfence":::"memory")
#define rmb() asm volatile("lfence":::"memory")
#define wmb() asm volatile("sfence":::"memory")
-#endif
-
-#undef ATOMIC_SMP_LOCK
-
#define IATOMIC_DEFINED 1
-
-#endif /* __i386__ */
+#endif
#ifdef __ia64__
-
-/*
- * On IA-64, counter must always be volatile to ensure that that the
- * memory accesses are ordered.
- */
-typedef struct { volatile int counter; } atomic_t;
-
-#define ATOMIC_INIT(i) ((atomic_t) { (i) })
-
-#define atomic_read(v) ((v)->counter)
-#define atomic_set(v,i) (((v)->counter) = (i))
-
-/* stripped version - we need only 4byte version */
-#define ia64_cmpxchg(sem,ptr,old,new,size) \
-({ \
- __typeof__(ptr) _p_ = (ptr); \
- __typeof__(new) _n_ = (new); \
- unsigned long _o_, _r_; \
- _o_ = (unsigned int) (long) (old); \
- __asm__ __volatile__ ("mov ar.ccv=%0;;" :: "rO"(_o_)); \
- __asm__ __volatile__ ("cmpxchg4."sem" %0=[%1],%2,ar.ccv" \
- : "=r"(_r_) : "r"(_p_), "r"(_n_) : "memory"); \
- (__typeof__(old)) _r_; \
-})
-
-static __inline__ int
-ia64_atomic_add (int i, atomic_t *v)
-{
- int old, new;
- // CMPXCHG_BUGCHECK_DECL
-
- do {
- // CMPXCHG_BUGCHECK(v);
- old = atomic_read(v);
- new = old + i;
- } while (ia64_cmpxchg("acq", v, old, old + i, sizeof(atomic_t)) != old);
- return new;
-}
-
-static __inline__ int
-ia64_atomic_sub (int i, atomic_t *v)
-{
- int old, new;
- // CMPXCHG_BUGCHECK_DECL
-
- do {
- // CMPXCHG_BUGCHECK(v);
- old = atomic_read(v);
- new = old - i;
- } while (ia64_cmpxchg("acq", v, old, new, sizeof(atomic_t)) != old);
- return new;
-}
-
-#define IA64_FETCHADD(tmp,v,n,sz) \
-({ \
- switch (sz) { \
- case 4: \
- __asm__ __volatile__ ("fetchadd4.rel %0=[%1],%2" \
- : "=r"(tmp) : "r"(v), "i"(n) : "memory"); \
- break; \
- \
- case 8: \
- __asm__ __volatile__ ("fetchadd8.rel %0=[%1],%2" \
- : "=r"(tmp) : "r"(v), "i"(n) : "memory"); \
- break; \
- } \
-})
-
-#define ia64_fetch_and_add(i,v) \
-({ \
- unsigned long _tmp; \
- volatile __typeof__(*(v)) *_v = (v); \
- switch (i) { \
- case -16: IA64_FETCHADD(_tmp, _v, -16, sizeof(*(v))); break; \
- case -8: IA64_FETCHADD(_tmp, _v, -8, sizeof(*(v))); break; \
- case -4: IA64_FETCHADD(_tmp, _v, -4, sizeof(*(v))); break; \
- case -1: IA64_FETCHADD(_tmp, _v, -1, sizeof(*(v))); break; \
- case 1: IA64_FETCHADD(_tmp, _v, 1, sizeof(*(v))); break; \
- case 4: IA64_FETCHADD(_tmp, _v, 4, sizeof(*(v))); break; \
- case 8: IA64_FETCHADD(_tmp, _v, 8, sizeof(*(v))); break; \
- case 16: IA64_FETCHADD(_tmp, _v, 16, sizeof(*(v))); break; \
- } \
- (__typeof__(*v)) (_tmp + (i)); /* return new value */ \
-})
-
-/*
- * Atomically add I to V and return TRUE if the resulting value is
- * negative.
- */
-static __inline__ int
-atomic_add_negative (int i, atomic_t *v)
-{
- return ia64_atomic_add(i, v) < 0;
-}
-
-#define atomic_add_return(i,v) \
- ((__builtin_constant_p(i) && \
- ( (i == 1) || (i == 4) || (i == 8) || (i == 16) \
- || (i == -1) || (i == -4) || (i == -8) || (i == -16))) \
- ? ia64_fetch_and_add(i, &(v)->counter) \
- : ia64_atomic_add(i, v))
-
-#define atomic_sub_return(i,v) \
- ((__builtin_constant_p(i) && \
- ( (i == 1) || (i == 4) || (i == 8) || (i == 16) \
- || (i == -1) || (i == -4) || (i == -8) || (i == -16))) \
- ? ia64_fetch_and_add(-(i), &(v)->counter) \
- : ia64_atomic_sub(i, v))
-
-#define atomic_dec_return(v) atomic_sub_return(1, (v))
-#define atomic_inc_return(v) atomic_add_return(1, (v))
-
-#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
-#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
-#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) != 0)
-
-#define atomic_add(i,v) atomic_add_return((i), (v))
-#define atomic_sub(i,v) atomic_sub_return((i), (v))
-#define atomic_inc(v) atomic_add(1, (v))
-#define atomic_dec(v) atomic_sub(1, (v))
-
/*
* Macros to force memory ordering. In these descriptions, "previous"
* and "subsequent" refer to program order; "visible" means that all
@@ -376,111 +48,6 @@ atomic_add_negative (int i, atomic_t *v)
#ifdef __alpha__
-/*
- * Atomic operations that C can't guarantee us. Useful for
- * resource counting etc...
- *
- * But use these as seldom as possible since they are much slower
- * than regular operations.
- */
-
-
-/*
- * Counter is volatile to make sure gcc doesn't try to be clever
- * and move things around on us. We need to use _exactly_ the address
- * the user gave us, not some alias that contains the same information.
- */
-typedef struct { volatile int counter; } atomic_t;
-
-#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
-
-#define atomic_read(v) ((v)->counter)
-#define atomic_set(v,i) ((v)->counter = (i))
-
-/*
- * To get proper branch prediction for the main line, we must branch
- * forward to code at the end of this object's .text section, then
- * branch back to restart the operation.
- */
-
-static __inline__ void atomic_add(int i, atomic_t * v)
-{
- unsigned long temp;
- __asm__ __volatile__(
- "1: ldl_l %0,%1\n"
- " addl %0,%2,%0\n"
- " stl_c %0,%1\n"
- " beq %0,2f\n"
- ".subsection 2\n"
- "2: br 1b\n"
- ".previous"
- :"=&r" (temp), "=m" (v->counter)
- :"Ir" (i), "m" (v->counter));
-}
-
-static __inline__ void atomic_sub(int i, atomic_t * v)
-{
- unsigned long temp;
- __asm__ __volatile__(
- "1: ldl_l %0,%1\n"
- " subl %0,%2,%0\n"
- " stl_c %0,%1\n"
- " beq %0,2f\n"
- ".subsection 2\n"
- "2: br 1b\n"
- ".previous"
- :"=&r" (temp), "=m" (v->counter)
- :"Ir" (i), "m" (v->counter));
-}
-
-/*
- * Same as above, but return the result value
- */
-static __inline__ long atomic_add_return(int i, atomic_t * v)
-{
- long temp, result;
- __asm__ __volatile__(
- "1: ldl_l %0,%1\n"
- " addl %0,%3,%2\n"
- " addl %0,%3,%0\n"
- " stl_c %0,%1\n"
- " beq %0,2f\n"
- " mb\n"
- ".subsection 2\n"
- "2: br 1b\n"
- ".previous"
- :"=&r" (temp), "=m" (v->counter), "=&r" (result)
- :"Ir" (i), "m" (v->counter) : "memory");
- return result;
-}
-
-static __inline__ long atomic_sub_return(int i, atomic_t * v)
-{
- long temp, result;
- __asm__ __volatile__(
- "1: ldl_l %0,%1\n"
- " subl %0,%3,%2\n"
- " subl %0,%3,%0\n"
- " stl_c %0,%1\n"
- " beq %0,2f\n"
- " mb\n"
- ".subsection 2\n"
- "2: br 1b\n"
- ".previous"
- :"=&r" (temp), "=m" (v->counter), "=&r" (result)
- :"Ir" (i), "m" (v->counter) : "memory");
- return result;
-}
-
-#define atomic_dec_return(v) atomic_sub_return(1,(v))
-#define atomic_inc_return(v) atomic_add_return(1,(v))
-
-#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
-#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
-
-#define atomic_inc(v) atomic_add(1,(v))
-#define atomic_dec(v) atomic_sub(1,(v))
-
#define mb() \
__asm__ __volatile__("mb": : :"memory")
@@ -496,168 +63,6 @@ __asm__ __volatile__("wmb": : :"memory")
#ifdef __powerpc__
-typedef struct { volatile int counter; } atomic_t;
-
-#define ATOMIC_INIT(i) { (i) }
-
-#define atomic_read(v) ((v)->counter)
-#define atomic_set(v,i) (((v)->counter) = (i))
-
-extern void atomic_clear_mask(unsigned long mask, unsigned long *addr);
-extern void atomic_set_mask(unsigned long mask, unsigned long *addr);
-
-#define SMP_ISYNC "\n\tisync"
-
-static __inline__ void atomic_add(int a, atomic_t *v)
-{
- int t;
-
- __asm__ __volatile__(
-"1: lwarx %0,0,%3 # atomic_add\n\
- add %0,%2,%0\n\
- stwcx. %0,0,%3\n\
- bne- 1b"
- : "=&r" (t), "=m" (v->counter)
- : "r" (a), "r" (&v->counter), "m" (v->counter)
- : "cc");
-}
-
-static __inline__ int atomic_add_return(int a, atomic_t *v)
-{
- int t;
-
- __asm__ __volatile__(
-"1: lwarx %0,0,%2 # atomic_add_return\n\
- add %0,%1,%0\n\
- stwcx. %0,0,%2\n\
- bne- 1b"
- SMP_ISYNC
- : "=&r" (t)
- : "r" (a), "r" (&v->counter)
- : "cc", "memory");
-
- return t;
-}
-
-static __inline__ void atomic_sub(int a, atomic_t *v)
-{
- int t;
-
- __asm__ __volatile__(
-"1: lwarx %0,0,%3 # atomic_sub\n\
- subf %0,%2,%0\n\
- stwcx. %0,0,%3\n\
- bne- 1b"
- : "=&r" (t), "=m" (v->counter)
- : "r" (a), "r" (&v->counter), "m" (v->counter)
- : "cc");
-}
-
-static __inline__ int atomic_sub_return(int a, atomic_t *v)
-{
- int t;
-
- __asm__ __volatile__(
-"1: lwarx %0,0,%2 # atomic_sub_return\n\
- subf %0,%1,%0\n\
- stwcx. %0,0,%2\n\
- bne- 1b"
- SMP_ISYNC
- : "=&r" (t)
- : "r" (a), "r" (&v->counter)
- : "cc", "memory");
-
- return t;
-}
-
-static __inline__ void atomic_inc(atomic_t *v)
-{
- int t;
-
- __asm__ __volatile__(
-"1: lwarx %0,0,%2 # atomic_inc\n\
- addic %0,%0,1\n\
- stwcx. %0,0,%2\n\
- bne- 1b"
- : "=&r" (t), "=m" (v->counter)
- : "r" (&v->counter), "m" (v->counter)
- : "cc");
-}
-
-static __inline__ int atomic_inc_return(atomic_t *v)
-{
- int t;
-
- __asm__ __volatile__(
-"1: lwarx %0,0,%1 # atomic_inc_return\n\
- addic %0,%0,1\n\
- stwcx. %0,0,%1\n\
- bne- 1b"
- SMP_ISYNC
- : "=&r" (t)
- : "r" (&v->counter)
- : "cc", "memory");
-
- return t;
-}
-
-static __inline__ void atomic_dec(atomic_t *v)
-{
- int t;
-
- __asm__ __volatile__(
-"1: lwarx %0,0,%2 # atomic_dec\n\
- addic %0,%0,-1\n\
- stwcx. %0,0,%2\n\
- bne- 1b"
- : "=&r" (t), "=m" (v->counter)
- : "r" (&v->counter), "m" (v->counter)
- : "cc");
-}
-
-static __inline__ int atomic_dec_return(atomic_t *v)
-{
- int t;
-
- __asm__ __volatile__(
-"1: lwarx %0,0,%1 # atomic_dec_return\n\
- addic %0,%0,-1\n\
- stwcx. %0,0,%1\n\
- bne- 1b"
- SMP_ISYNC
- : "=&r" (t)
- : "r" (&v->counter)
- : "cc", "memory");
-
- return t;
-}
-
-#define atomic_sub_and_test(a, v) (atomic_sub_return((a), (v)) == 0)
-#define atomic_dec_and_test(v) (atomic_dec_return((v)) == 0)
-
-/*
- * Atomically test *v and decrement if it is greater than 0.
- * The function returns the old value of *v minus 1.
- */
-static __inline__ int atomic_dec_if_positive(atomic_t *v)
-{
- int t;
-
- __asm__ __volatile__(
-"1: lwarx %0,0,%1 # atomic_dec_if_positive\n\
- addic. %0,%0,-1\n\
- blt- 2f\n\
- stwcx. %0,0,%1\n\
- bne- 1b"
- SMP_ISYNC
- "\n\
-2:" : "=&r" (t)
- : "r" (&v->counter)
- : "cc", "memory");
-
- return t;
-}
-
/*
* Memory barrier.
* The sync instruction guarantees that all memory accesses initiated
@@ -682,447 +87,14 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
#endif /* __powerpc__ */
-#ifdef __mips__
-
-typedef struct { volatile int counter; } atomic_t;
-
-#define ATOMIC_INIT(i) { (i) }
-
-/*
- * atomic_read - read atomic variable
- * @v: pointer of type atomic_t
- *
- * Atomically reads the value of @v. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-#define atomic_read(v) ((v)->counter)
-
-/*
- * atomic_set - set atomic variable
- * @v: pointer of type atomic_t
- * @i: required value
- *
- * Atomically sets the value of @v to @i. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-#define atomic_set(v,i) ((v)->counter = (i))
-
-/*
- * for MIPS II and better we can use ll/sc instruction, and kernel 2.4.3+
- * will emulate it on MIPS I.
- */
-
-/*
- * atomic_add - add integer to atomic variable
- * @i: integer value to add
- * @v: pointer of type atomic_t
- *
- * Atomically adds @i to @v. Note that the guaranteed useful range
- * of an atomic_t is only 24 bits.
- */
-extern __inline__ void atomic_add(int i, atomic_t * v)
-{
- unsigned long temp;
-
- __asm__ __volatile__(
- ".set push \n"
- ".set mips2 \n"
- "1: ll %0, %1 # atomic_add\n"
- " addu %0, %2 \n"
- " sc %0, %1 \n"
- " beqz %0, 1b \n"
- ".set pop \n"
- : "=&r" (temp), "=m" (v->counter)
- : "Ir" (i), "m" (v->counter));
-}
-
-/*
- * atomic_sub - subtract the atomic variable
- * @i: integer value to subtract
- * @v: pointer of type atomic_t
- *
- * Atomically subtracts @i from @v. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-extern __inline__ void atomic_sub(int i, atomic_t * v)
-{
- unsigned long temp;
-
- __asm__ __volatile__(
- ".set push \n"
- ".set mips2 \n"
- "1: ll %0, %1 # atomic_sub\n"
- " subu %0, %2 \n"
- " sc %0, %1 \n"
- " beqz %0, 1b \n"
- ".set pop \n"
- : "=&r" (temp), "=m" (v->counter)
- : "Ir" (i), "m" (v->counter));
-}
-
-/*
- * Same as above, but return the result value
- */
-extern __inline__ int atomic_add_return(int i, atomic_t * v)
-{
- unsigned long temp, result;
-
- __asm__ __volatile__(
- ".set push # atomic_add_return\n"
- ".set noreorder \n"
- ".set mips2 \n"
- "1: ll %1, %2 \n"
- " addu %0, %1, %3 \n"
- " sc %0, %2 \n"
- " beqz %0, 1b \n"
- " addu %0, %1, %3 \n"
- ".set pop \n"
- : "=&r" (result), "=&r" (temp), "=m" (v->counter)
- : "Ir" (i), "m" (v->counter)
- : "memory");
-
- return result;
-}
-
-extern __inline__ int atomic_sub_return(int i, atomic_t * v)
-{
- unsigned long temp, result;
-
- __asm__ __volatile__(
- ".set push \n"
- ".set mips2 \n"
- ".set noreorder # atomic_sub_return\n"
- "1: ll %1, %2 \n"
- " subu %0, %1, %3 \n"
- " sc %0, %2 \n"
- " beqz %0, 1b \n"
- " subu %0, %1, %3 \n"
- ".set pop \n"
- : "=&r" (result), "=&r" (temp), "=m" (v->counter)
- : "Ir" (i), "m" (v->counter)
- : "memory");
-
- return result;
-}
-
-#define atomic_dec_return(v) atomic_sub_return(1,(v))
-#define atomic_inc_return(v) atomic_add_return(1,(v))
-
-/*
- * atomic_sub_and_test - subtract value from variable and test result
- * @i: integer value to subtract
- * @v: pointer of type atomic_t
- *
- * Atomically subtracts @i from @v and returns
- * true if the result is zero, or false for all
- * other cases. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
-
-/*
- * atomic_inc_and_test - increment and test
- * @v: pointer of type atomic_t
- *
- * Atomically increments @v by 1
- * and returns true if the result is zero, or false for all
- * other cases. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-#define atomic_inc_and_test(v) (atomic_inc_return(1, (v)) == 0)
-
-/*
- * atomic_dec_and_test - decrement by 1 and test
- * @v: pointer of type atomic_t
- *
- * Atomically decrements @v by 1 and
- * returns true if the result is 0, or false for all other
- * cases. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
-
-/*
- * atomic_inc - increment atomic variable
- * @v: pointer of type atomic_t
- *
- * Atomically increments @v by 1. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-#define atomic_inc(v) atomic_add(1,(v))
-
-/*
- * atomic_dec - decrement and test
- * @v: pointer of type atomic_t
- *
- * Atomically decrements @v by 1. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- */
-#define atomic_dec(v) atomic_sub(1,(v))
-
-/*
- * atomic_add_negative - add and test if negative
- * @v: pointer of type atomic_t
- * @i: integer value to add
- *
- * Atomically adds @i to @v and returns true
- * if the result is negative, or false when
- * result is greater than or equal to zero. Note that the guaranteed
- * useful range of an atomic_t is only 24 bits.
- *
- * Currently not implemented for MIPS.
- */
-
-#define mb() \
-__asm__ __volatile__( \
- "# prevent instructions being moved around\n\t" \
- ".set\tnoreorder\n\t" \
- "# 8 nops to fool the R4400 pipeline\n\t" \
- "nop;nop;nop;nop;nop;nop;nop;nop\n\t" \
- ".set\treorder" \
- : /* no output */ \
- : /* no input */ \
- : "memory")
-#define rmb() mb()
-#define wmb() mb()
-
-#define IATOMIC_DEFINED 1
-
-#endif /* __mips__ */
-
-#ifdef __arm__
-
-/*
- * FIXME: bellow code is valid only for SA11xx
- */
-
-/*
- * Save the current interrupt enable state & disable IRQs
- */
-#define local_irq_save(x) \
- ({ \
- unsigned long temp; \
- __asm__ __volatile__( \
- "mrs %0, cpsr @ local_irq_save\n" \
-" orr %1, %0, #128\n" \
-" msr cpsr_c, %1" \
- : "=r" (x), "=r" (temp) \
- : \
- : "memory"); \
- })
-
-/*
- * restore saved IRQ & FIQ state
- */
-#define local_irq_restore(x) \
- __asm__ __volatile__( \
- "msr cpsr_c, %0 @ local_irq_restore\n" \
- : \
- : "r" (x) \
- : "memory")
-
-#define __save_flags_cli(x) local_irq_save(x)
-#define __restore_flags(x) local_irq_restore(x)
-
-typedef struct { volatile int counter; } atomic_t;
-
-#define ATOMIC_INIT(i) { (i) }
-
-#define atomic_read(v) ((v)->counter)
-#define atomic_set(v,i) (((v)->counter) = (i))
-
-static __inline__ void atomic_add(int i, volatile atomic_t *v)
-{
- unsigned long flags;
-
- __save_flags_cli(flags);
- v->counter += i;
- __restore_flags(flags);
-}
-
-static __inline__ void atomic_sub(int i, volatile atomic_t *v)
-{
- unsigned long flags;
-
- __save_flags_cli(flags);
- v->counter -= i;
- __restore_flags(flags);
-}
-
-static __inline__ void atomic_inc(volatile atomic_t *v)
-{
- unsigned long flags;
-
- __save_flags_cli(flags);
- v->counter += 1;
- __restore_flags(flags);
-}
-
-static __inline__ void atomic_dec(volatile atomic_t *v)
-{
- unsigned long flags;
-
- __save_flags_cli(flags);
- v->counter -= 1;
- __restore_flags(flags);
-}
-
-static __inline__ int atomic_dec_and_test(volatile atomic_t *v)
-{
- unsigned long flags;
- int result;
-
- __save_flags_cli(flags);
- v->counter -= 1;
- result = (v->counter == 0);
- __restore_flags(flags);
-
- return result;
-}
-
-static __inline__ int atomic_add_negative(int i, volatile atomic_t *v)
-{
- unsigned long flags;
- int result;
-
- __save_flags_cli(flags);
- v->counter += i;
- result = (v->counter < 0);
- __restore_flags(flags);
-
- return result;
-}
-
-static __inline__ void atomic_clear_mask(unsigned long mask, unsigned long *addr)
-{
- unsigned long flags;
-
- __save_flags_cli(flags);
- *addr &= ~mask;
- __restore_flags(flags);
-}
-
-#define mb() __asm__ __volatile__ ("" : : : "memory")
-#define rmb() mb()
-#define wmb() mb()
-
-#define IATOMIC_DEFINED 1
-
-#endif /* __arm__ */
-
-#ifdef __sh__
-
-typedef struct { volatile int counter; } atomic_t;
-
-#define ATOMIC_INIT(i) { (i) }
-
-#define atomic_read(v) ((v)->counter)
-#define atomic_set(v,i) (((v)->counter) = (i))
-
-#define atomic_dec_return(v) atomic_sub_return(1,(v))
-#define atomic_inc_return(v) atomic_add_return(1,(v))
-
-#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
-#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
-#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) != 0)
-
-#define atomic_add(i,v) atomic_add_return((i),(v))
-#define atomic_sub(i,v) atomic_sub_return((i),(v))
-#define atomic_inc(v) atomic_add(1,(v))
-#define atomic_dec(v) atomic_sub(1,(v))
-
-static __inline__ int atomic_add_return(int i, volatile atomic_t *v)
-{
- int result;
-
- asm volatile (
- " .align 2\n"
- " mova 99f, r0\n"
- " mov r15, r1\n"
- " mov #-6, r15\n"
- " mov.l @%2, %0\n"
- " add %1, %0\n"
- " mov.l %0, @%2\n"
- "99: mov r1, r15"
- : "=&r"(result)
- : "r"(i), "r"(v)
- : "r0", "r1");
-
- return result;
-}
-
-static __inline__ int atomic_sub_return(int i, volatile atomic_t *v)
-{
- int result;
-
- asm volatile (
- " .align 2\n"
- " mova 99f, r0\n"
- " mov r15, r1\n"
- " mov #-6, r15\n"
- " mov.l @%2, %0\n"
- " sub %1, %0\n"
- " mov.l %0, @%2\n"
- "99: mov r1, r15"
- : "=&r"(result)
- : "r"(i), "r"(v)
- : "r0", "r1");
-
- return result;
-}
-
-#define mb() __asm__ __volatile__ ("" : : : "memory")
-#define rmb() mb()
-#define wmb() mb()
-
-#define IATOMIC_DEFINED 1
-
-#endif /* __sh__ */
-
-#ifdef __bfin__
-
-#include <bfin_fixed_code.h>
-
-typedef struct { volatile int counter; } atomic_t;
-
-#define ATOMIC_INIT(i) { (i) }
+#ifndef IATOMIC_DEFINED
-#define atomic_read(v) ((v)->counter)
-#define atomic_set(v,i) (((v)->counter) = (i))
-#define atomic_add(i,v) bfin_atomic_add32(&(v)->counter, i)
-#define atomic_sub(i,v) bfin_atomic_sub32(&(v)->counter, i)
-#define atomic_inc(v) bfin_atomic_inc32(&(v)->counter);
-#define atomic_dec(v) bfin_atomic_dec32(&(v)->counter);
+/* Generic __sync_synchronize is available from gcc 4.1 */
-#define mb() __asm__ __volatile__ ("" : : : "memory")
+#define mb() __sync_synchronize()
#define rmb() mb()
#define wmb() mb()
-#define IATOMIC_DEFINED 1
-
-#endif /* __bfin__ */
-
-#ifndef IATOMIC_DEFINED
-/*
- * non supported architecture.
- */
-#warning "Atomic operations are not supported on this architecture."
-
-typedef struct { volatile int counter; } atomic_t;
-
-#define ATOMIC_INIT(i) { (i) }
-
-#define atomic_read(v) ((v)->counter)
-#define atomic_set(v,i) (((v)->counter) = (i))
-#define atomic_add(i,v) (((v)->counter) += (i))
-#define atomic_sub(i,v) (((v)->counter) -= (i))
-#define atomic_inc(v) (((v)->counter)++)
-#define atomic_dec(v) (((v)->counter)--)
-
-#define mb()
-#define rmb()
-#define wmb()
-
#define IATOMIC_DEFINED 1
#endif /* IATOMIC_DEFINED */
diff --git a/include/local.h b/include/local.h
index 53cb647d..2fe9a273 100644
--- a/include/local.h
+++ b/include/local.h
@@ -22,19 +22,37 @@
#ifndef __LOCAL_H
#define __LOCAL_H
+#include "config.h"
+
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <assert.h>
+#ifdef HAVE_ENDIAN_H
#include <endian.h>
+#elif defined(HAVE_SYS_ENDIAN_H)
+#include <sys/endian.h>
+#ifndef __BYTE_ORDER
+#define __BYTE_ORDER BYTE_ORDER
+#endif
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#endif
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN BIG_ENDIAN
+#endif
+#else
+#error Header defining endianness not defined
+#endif
#include <stdarg.h>
#include <sys/poll.h>
+#include <sys/types.h>
#include <errno.h>
+#include <linux/types.h>
#include <linux/ioctl.h>
-#include "config.h"
#ifdef SUPPORT_RESMGR
#include <resmgr.h>
#endif
@@ -114,9 +132,12 @@
#define snd_ctl_tlv sndrv_ctl_tlv
/* kill and replace kernel-specific types */
+#ifndef __user
#define __user
+#endif
+#ifndef __force
#define __force
-#define __kernel_off_t off_t
+#endif
#include <sound/asound.h>
diff --git a/include/sound/Makefile.in b/include/sound/Makefile.in
index eb3f604b..60d5117e 100644
--- a/include/sound/Makefile.in
+++ b/include/sound/Makefile.in
@@ -55,7 +55,7 @@ DIST_COMMON = $(alsasoundinclude_HEADERS) $(noinst_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/include/sound/hdspm.h b/include/sound/hdspm.h
index 1774ff5f..fe9c5f69 100644
--- a/include/sound/hdspm.h
+++ b/include/sound/hdspm.h
@@ -111,7 +111,7 @@ struct hdspm_ltc {
enum hdspm_ltc_input_format input_format;
};
-#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_mixer_ioctl)
+#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)
/**
* The status data reflects the device's current state
diff --git a/include/use-case.h b/include/use-case.h
index 93b3456c..4e132491 100644
--- a/include/use-case.h
+++ b/include/use-case.h
@@ -259,9 +259,13 @@ int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr,
* TQ - Tone Quality
* PlaybackPCM - full PCM playback device name
* CapturePCM - full PCM capture device name
+ * PlaybackRate - playback device sample rate
+ * PlaybackChannels - playback device channel count
* PlaybackCTL - playback control device name
* PlaybackVolume - playback control volume ID string
* PlaybackSwitch - playback control switch ID string
+ * CaptureRate - capture device sample rate
+ * CaptureChannels - capture device channel count
* CaptureCTL - capture control device name
* CaptureVolume - capture control volume ID string
* CaptureSwitch - capture control switch ID string
diff --git a/include/version.h b/include/version.h
index 2a4d46ea..482ba44d 100644
--- a/include/version.h
+++ b/include/version.h
@@ -4,12 +4,12 @@
#define SND_LIB_MAJOR 1 /**< major number of library version */
#define SND_LIB_MINOR 0 /**< minor number of library version */
-#define SND_LIB_SUBMINOR 27 /**< subminor number of library version */
+#define SND_LIB_SUBMINOR 28 /**< subminor number of library version */
#define SND_LIB_EXTRAVER 1000000 /**< extra version number, used mainly for betas */
/** library version */
#define SND_LIB_VERSION ((SND_LIB_MAJOR<<16)|\
(SND_LIB_MINOR<<8)|\
SND_LIB_SUBMINOR)
/** library version (string) */
-#define SND_LIB_VERSION_STR "1.0.27.2"
+#define SND_LIB_VERSION_STR "1.0.28"
diff --git a/libtool b/libtool
index 9649ce3c..b7f801fe 100755
--- a/libtool
+++ b/libtool
@@ -1,7 +1,7 @@
#! /bin/sh
# libtool - Provide generalized library-building support services.
-# Generated automatically by config.status (alsa-lib) 1.0.27.2
+# Generated automatically by config.status (alsa-lib) 1.0.28
# Libtool was configured on host alsa.alsa-project.org:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
diff --git a/modules/Makefile.in b/modules/Makefile.in
index ba13e144..52c94d94 100644
--- a/modules/Makefile.in
+++ b/modules/Makefile.in
@@ -53,7 +53,7 @@ subdir = modules
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/modules/mixer/Makefile.in b/modules/mixer/Makefile.in
index 4909fe50..9cfa0635 100644
--- a/modules/mixer/Makefile.in
+++ b/modules/mixer/Makefile.in
@@ -53,7 +53,7 @@ subdir = modules/mixer
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/modules/mixer/simple/Makefile.am b/modules/mixer/simple/Makefile.am
index bad09444..cb64ee8c 100644
--- a/modules/mixer/simple/Makefile.am
+++ b/modules/mixer/simple/Makefile.am
@@ -3,7 +3,7 @@ pkglibdir = $(alsaplugindir)/smixer
AM_CFLAGS = -g -O2 -W -Wall
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
pkglib_LTLIBRARIES = smixer-sbase.la \
smixer-ac97.la \
diff --git a/modules/mixer/simple/Makefile.in b/modules/mixer/simple/Makefile.in
index 2849299b..34e95aa8 100644
--- a/modules/mixer/simple/Makefile.in
+++ b/modules/mixer/simple/Makefile.in
@@ -56,7 +56,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -308,7 +308,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
alsaplugindir = @ALSA_PLUGIN_DIR@
AM_CFLAGS = -g -O2 -W -Wall
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
pkglib_LTLIBRARIES = smixer-sbase.la smixer-ac97.la smixer-hda.la \
$(am__append_1)
noinst_HEADERS = sbase.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 08f482ad..fa255ff4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -46,8 +46,8 @@ if BUILD_ALISP
SUBDIRS += alisp
libasound_la_LIBADD += alisp/libalisp.la
endif
-SUBDIRS += compat conf
-libasound_la_LIBADD += compat/libcompat.la @ALSA_DEPLIBS@
+SUBDIRS += conf
+libasound_la_LIBADD += @ALSA_DEPLIBS@
libasound_la_LDFLAGS = -version-info $(COMPATNUM) $(VSYMS) $(SYMFUNCS) $(LDFLAGS_NOUNDEFINED)
@@ -84,10 +84,7 @@ ucm/libucm.la:
instr/libinstr.la:
$(MAKE) -C instr libinstr.la
-compat/libcompat.la:
- $(MAKE) -C compat libcompat.la
-
alisp/libalisp.la:
$(MAKE) -C alisp libalisp.la
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
diff --git a/src/Makefile.in b/src/Makefile.in
index e21fc0da..b0900c84 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -69,7 +69,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/Versions.in $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -107,8 +107,7 @@ am__installdirs = "$(DESTDIR)$(libdir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libasound_la_DEPENDENCIES = control/libcontrol.la $(am__append_2) \
$(am__append_4) $(am__append_6) $(am__append_8) \
- $(am__append_10) $(am__append_12) $(am__append_14) \
- compat/libcompat.la
+ $(am__append_10) $(am__append_12) $(am__append_14)
am_libasound_la_OBJECTS = conf.lo confmisc.lo input.lo output.lo \
async.lo error.lo dlmisc.lo socket.lo shmarea.lo userfile.lo \
names.lo
@@ -176,7 +175,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = control mixer pcm timer rawmidi hwdep seq ucm alisp \
- compat conf
+ conf
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
@@ -341,13 +340,13 @@ lib_LTLIBRARIES = libasound.la
libasound_la_SOURCES = conf.c confmisc.c input.c output.c async.c error.c dlmisc.c socket.c shmarea.c userfile.c names.c
SUBDIRS = control $(am__append_1) $(am__append_3) $(am__append_5) \
$(am__append_7) $(am__append_9) $(am__append_11) \
- $(am__append_13) compat conf
+ $(am__append_13) conf
libasound_la_LIBADD = control/libcontrol.la $(am__append_2) \
$(am__append_4) $(am__append_6) $(am__append_8) \
$(am__append_10) $(am__append_12) $(am__append_14) \
- compat/libcompat.la @ALSA_DEPLIBS@
+ @ALSA_DEPLIBS@ $(am__empty)
libasound_la_LDFLAGS = -version-info $(COMPATNUM) $(VSYMS) $(SYMFUNCS) $(LDFLAGS_NOUNDEFINED)
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
all: all-recursive
.SUFFIXES:
@@ -811,9 +810,6 @@ ucm/libucm.la:
instr/libinstr.la:
$(MAKE) -C instr libinstr.la
-compat/libcompat.la:
- $(MAKE) -C compat libcompat.la
-
alisp/libalisp.la:
$(MAKE) -C alisp libalisp.la
diff --git a/src/alisp/Makefile.am b/src/alisp/Makefile.am
index e6d4ac53..1234e111 100644
--- a/src/alisp/Makefile.am
+++ b/src/alisp/Makefile.am
@@ -8,4 +8,4 @@ noinst_HEADERS = alisp_local.h
all: libalisp.la
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
diff --git a/src/alisp/Makefile.in b/src/alisp/Makefile.in
index b93e629a..f707c528 100644
--- a/src/alisp/Makefile.in
+++ b/src/alisp/Makefile.in
@@ -55,7 +55,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -246,7 +246,7 @@ EXTRA_LTLIBRARIES = libalisp.la
EXTRA_DIST = alisp_snd.c
libalisp_la_SOURCES = alisp.c
noinst_HEADERS = alisp_local.h
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
all: all-am
.SUFFIXES:
diff --git a/src/alisp/alisp.c b/src/alisp/alisp.c
index 1796c33c..3c61bb17 100644
--- a/src/alisp/alisp.c
+++ b/src/alisp/alisp.c
@@ -3202,12 +3202,11 @@ int alsa_lisp(struct alisp_cfg *cfg, struct alisp_instance **_instance)
struct alisp_object *p, *p1;
int i, j, retval = 0;
- instance = (struct alisp_instance *)malloc(sizeof(struct alisp_instance));
+ instance = (struct alisp_instance *)calloc(1, sizeof(struct alisp_instance));
if (instance == NULL) {
nomem();
return -ENOMEM;
}
- memset(instance, 0, sizeof(struct alisp_instance));
instance->verbose = cfg->verbose && cfg->vout;
instance->warning = cfg->warning && cfg->wout;
instance->debug = cfg->debug && cfg->dout;
diff --git a/src/compat/Makefile.am b/src/compat/Makefile.am
deleted file mode 100644
index 01f54fc1..00000000
--- a/src/compat/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-noinst_LTLIBRARIES = libcompat.la
-EXTRA_libcompat_la_SOURCES = hsearch_r.c
-
-if ALSA_HSEARCH_R
-libcompat_la_SOURCES = empty.c hsearch_r.c
-else
-libcompat_la_SOURCES = empty.c
-endif
diff --git a/src/compat/Makefile.in b/src/compat/Makefile.in
deleted file mode 100644
index 80a88348..00000000
--- a/src/compat/Makefile.in
+++ /dev/null
@@ -1,556 +0,0 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/compat
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/include/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libcompat_la_LIBADD =
-am__libcompat_la_SOURCES_DIST = empty.c hsearch_r.c
-@ALSA_HSEARCH_R_FALSE@am_libcompat_la_OBJECTS = empty.lo
-@ALSA_HSEARCH_R_TRUE@am_libcompat_la_OBJECTS = empty.lo hsearch_r.lo
-libcompat_la_OBJECTS = $(am_libcompat_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libcompat_la_SOURCES) $(EXTRA_libcompat_la_SOURCES)
-DIST_SOURCES = $(am__libcompat_la_SOURCES_DIST) \
- $(EXTRA_libcompat_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ALSA_CONFIG_DIR = @ALSA_CONFIG_DIR@
-ALSA_DEPLIBS = @ALSA_DEPLIBS@
-ALSA_PKGCONF_DIR = @ALSA_PKGCONF_DIR@
-ALSA_PLUGIN_DIR = @ALSA_PLUGIN_DIR@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_VERSION_INFO = @LIBTOOL_VERSION_INFO@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PYTHON_INCLUDES = @PYTHON_INCLUDES@
-PYTHON_LIBS = @PYTHON_LIBS@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-SND_LIB_EXTRAVER = @SND_LIB_EXTRAVER@
-SND_LIB_MAJOR = @SND_LIB_MAJOR@
-SND_LIB_MINOR = @SND_LIB_MINOR@
-SND_LIB_SUBMINOR = @SND_LIB_SUBMINOR@
-SND_LIB_VERSION = @SND_LIB_VERSION@
-STRIP = @STRIP@
-SYMBOL_PREFIX = @SYMBOL_PREFIX@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-noinst_LTLIBRARIES = libcompat.la
-EXTRA_libcompat_la_SOURCES = hsearch_r.c
-@ALSA_HSEARCH_R_FALSE@libcompat_la_SOURCES = empty.c
-@ALSA_HSEARCH_R_TRUE@libcompat_la_SOURCES = empty.c hsearch_r.c
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/compat/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/compat/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-libcompat.la: $(libcompat_la_OBJECTS) $(libcompat_la_DEPENDENCIES) $(EXTRA_libcompat_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libcompat_la_OBJECTS) $(libcompat_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/empty.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hsearch_r.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-cscopelist: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES cscopelist ctags \
- distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/compat/empty.c b/src/compat/empty.c
deleted file mode 100644
index e69de29b..00000000
--- a/src/compat/empty.c
+++ /dev/null
diff --git a/src/compat/hsearch_r.c b/src/compat/hsearch_r.c
deleted file mode 100644
index 96ceac10..00000000
--- a/src/compat/hsearch_r.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1993.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <errno.h>
-#include <malloc.h>
-#include <string.h>
-
-#define __USE_GNU
-#ifndef __set_errno
-#define __set_errno(e) errno = (e)
-#endif
-#include <search.h>
-
-/* [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986
- [Knuth] The Art of Computer Programming, part 3 (6.4) */
-
-
-/* The reentrant version has no static variables to maintain the state.
- Instead the interface of all functions is extended to take an argument
- which describes the current status. */
-typedef struct _ENTRY
-{
- unsigned int used;
- ENTRY entry;
-}
-_ENTRY;
-
-
-/* For the used double hash method the table size has to be a prime. To
- correct the user given table size we need a prime test. This trivial
- algorithm is adequate because
- a) the code is (most probably) called a few times per program run and
- b) the number is small because the table must fit in the core */
-static int
-isprime (unsigned int number)
-{
- /* no even number will be passed */
- unsigned int div = 3;
-
- while (div * div < number && number % div != 0)
- div += 2;
-
- return number % div != 0;
-}
-
-
-/* Before using the hash table we must allocate memory for it.
- Test for an existing table are done. We allocate one element
- more as the found prime number says. This is done for more effective
- indexing as explained in the comment for the hsearch function.
- The contents of the table is zeroed, especially the field used
- becomes zero. */
-int
-hcreate_r (nel, htab)
- size_t nel;
- struct hsearch_data *htab;
-{
- /* Test for correct arguments. */
- if (htab == NULL)
- {
- __set_errno (EINVAL);
- return 0;
- }
-
- /* There is still another table active. Return with error. */
- if (htab->table != NULL)
- return 0;
-
- /* Change nel to the first prime number not smaller as nel. */
- nel |= 1; /* make odd */
- while (!isprime (nel))
- nel += 2;
-
- htab->size = nel;
- htab->filled = 0;
-
- /* allocate memory and zero out */
- htab->table = (_ENTRY *) calloc (htab->size + 1, sizeof (_ENTRY));
- if (htab->table == NULL)
- return 0;
-
- /* everything went alright */
- return 1;
-}
-
-
-/* After using the hash table it has to be destroyed. The used memory can
- be freed and the local static variable can be marked as not used. */
-void
-hdestroy_r (htab)
- struct hsearch_data *htab;
-{
- /* Test for correct arguments. */
- if (htab == NULL)
- {
- __set_errno (EINVAL);
- return;
- }
-
- if (htab->table != NULL)
- /* free used memory */
- free (htab->table);
-
- /* the sign for an existing table is an value != NULL in htable */
- htab->table = NULL;
-}
-
-
-/* This is the search function. It uses double hashing with open addressing.
- The argument item.key has to be a pointer to an zero terminated, most
- probably strings of chars. The function for generating a number of the
- strings is simple but fast. It can be replaced by a more complex function
- like ajw (see [Aho,Sethi,Ullman]) if the needs are shown.
-
- We use an trick to speed up the lookup. The table is created by hcreate
- with one more element available. This enables us to use the index zero
- special. This index will never be used because we store the first hash
- index in the field used where zero means not used. Every other value
- means used. The used field can be used as a first fast comparison for
- equality of the stored and the parameter value. This helps to prevent
- unnecessary expensive calls of strcmp. */
-int
-hsearch_r (item, action, retval, htab)
- ENTRY item;
- ACTION action;
- ENTRY **retval;
- struct hsearch_data *htab;
-{
- unsigned int hval;
- unsigned int count;
- unsigned int len = strlen (item.key);
- unsigned int idx;
-
- /* Compute an value for the given string. Perhaps use a better method. */
- hval = len;
- count = len;
- while (count-- > 0)
- {
- hval <<= 4;
- hval += item.key[count];
- }
-
- /* First hash function: simply take the modulo but prevent zero. */
- hval %= htab->size;
- if (hval == 0)
- ++hval;
-
- /* The first index tried. */
- idx = hval;
-
- if (htab->table[idx].used)
- {
- /* Further action might be required according to the action value. */
- unsigned hval2;
-
- if (htab->table[idx].used == hval
- && strcmp (item.key, htab->table[idx].entry.key) == 0)
- {
- if (action == ENTER)
- htab->table[idx].entry.data = item.data;
-
- *retval = &htab->table[idx].entry;
- return 1;
- }
-
- /* Second hash function, as suggested in [Knuth] */
- hval2 = 1 + hval % (htab->size - 2);
-
- do
- {
- /* Because SIZE is prime this guarantees to step through all
- available indexes. */
- if (idx <= hval2)
- idx = htab->size + idx - hval2;
- else
- idx -= hval2;
-
- /* If we visited all entries leave the loop unsuccessfully. */
- if (idx == hval)
- break;
-
- /* If entry is found use it. */
- if (htab->table[idx].used == hval
- && strcmp (item.key, htab->table[idx].entry.key) == 0)
- {
- if (action == ENTER)
- htab->table[idx].entry.data = item.data;
-
- *retval = &htab->table[idx].entry;
- return 1;
- }
- }
- while (htab->table[idx].used);
- }
-
- /* An empty bucket has been found. */
- if (action == ENTER)
- {
- /* If table is full and another entry should be entered return
- with error. */
- if (action == ENTER && htab->filled == htab->size)
- {
- __set_errno (ENOMEM);
- *retval = NULL;
- return 0;
- }
-
- htab->table[idx].used = hval;
- htab->table[idx].entry = item;
-
- ++htab->filled;
-
- *retval = &htab->table[idx].entry;
- return 1;
- }
-
- __set_errno (ESRCH);
- *retval = NULL;
- return 0;
-}
diff --git a/src/conf.c b/src/conf.c
index bfed1c43..5ccc8e1a 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -427,8 +427,8 @@ beginning:</P>
#ifndef DOC_HIDDEN
#ifdef HAVE_LIBPTHREAD
-static pthread_mutex_t snd_config_update_mutex =
- PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+static pthread_mutex_t snd_config_update_mutex;
+static pthread_once_t snd_config_update_mutex_once = PTHREAD_ONCE_INIT;
#endif
struct _snd_config {
@@ -472,8 +472,19 @@ typedef struct {
#ifdef HAVE_LIBPTHREAD
+static void snd_config_init_mutex(void)
+{
+ pthread_mutexattr_t attr;
+
+ pthread_mutexattr_init(&attr);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ pthread_mutex_init(&snd_config_update_mutex, &attr);
+ pthread_mutexattr_destroy(&attr);
+}
+
static inline void snd_config_lock(void)
{
+ pthread_once(&snd_config_update_mutex_once, snd_config_init_mutex);
pthread_mutex_lock(&snd_config_update_mutex);
}
diff --git a/src/conf/Makefile.in b/src/conf/Makefile.in
index 6494fb71..c0caae24 100644
--- a/src/conf/Makefile.in
+++ b/src/conf/Makefile.in
@@ -56,7 +56,7 @@ subdir = src/conf
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/src/conf/alsa.conf b/src/conf/alsa.conf
index bc91df3b..5c928e8a 100644
--- a/src/conf/alsa.conf
+++ b/src/conf/alsa.conf
@@ -90,6 +90,8 @@ defaults.pcm.center_lfe.card defaults.pcm.card
defaults.pcm.center_lfe.device defaults.pcm.device
defaults.pcm.side.card defaults.pcm.card
defaults.pcm.side.device defaults.pcm.device
+defaults.pcm.surround21.card defaults.pcm.card
+defaults.pcm.surround21.device defaults.pcm.device
defaults.pcm.surround40.card defaults.pcm.card
defaults.pcm.surround40.device defaults.pcm.device
defaults.pcm.surround41.card defaults.pcm.card
@@ -131,6 +133,7 @@ pcm.front cards.pcm.front
pcm.rear cards.pcm.rear
pcm.center_lfe cards.pcm.center_lfe
pcm.side cards.pcm.side
+pcm.surround21 cards.pcm.surround21
pcm.surround40 cards.pcm.surround40
pcm.surround41 cards.pcm.surround41
pcm.surround50 cards.pcm.surround50
diff --git a/src/conf/alsa.conf.d/Makefile.in b/src/conf/alsa.conf.d/Makefile.in
index a5f92204..eb3cafbc 100644
--- a/src/conf/alsa.conf.d/Makefile.in
+++ b/src/conf/alsa.conf.d/Makefile.in
@@ -54,7 +54,7 @@ subdir = src/conf/alsa.conf.d
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/src/conf/cards/ATIIXP-SPDMA.conf b/src/conf/cards/ATIIXP-SPDMA.conf
index 5c80815d..42540d68 100644
--- a/src/conf/cards/ATIIXP-SPDMA.conf
+++ b/src/conf/cards/ATIIXP-SPDMA.conf
@@ -77,6 +77,7 @@ ATIIXP-SPDMA.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/ATIIXP.conf b/src/conf/cards/ATIIXP.conf
index 38d80234..c4d33ef3 100644
--- a/src/conf/cards/ATIIXP.conf
+++ b/src/conf/cards/ATIIXP.conf
@@ -77,6 +77,7 @@ ATIIXP.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/Audigy.conf b/src/conf/cards/Audigy.conf
index 4fe38732..1c924966 100644
--- a/src/conf/cards/Audigy.conf
+++ b/src/conf/cards/Audigy.conf
@@ -143,6 +143,7 @@ Audigy.pcm.center_lfe.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround40.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
diff --git a/src/conf/cards/Audigy2.conf b/src/conf/cards/Audigy2.conf
index db45776e..cbec7835 100644
--- a/src/conf/cards/Audigy2.conf
+++ b/src/conf/cards/Audigy2.conf
@@ -195,6 +195,7 @@ Audigy2.pcm.side.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround40.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
diff --git a/src/conf/cards/Aureon51.conf b/src/conf/cards/Aureon51.conf
index 24b4d949..07be4a77 100644
--- a/src/conf/cards/Aureon51.conf
+++ b/src/conf/cards/Aureon51.conf
@@ -86,6 +86,7 @@ Aureon51.pcm.surround40.0 {
channels 4
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/Aureon71.conf b/src/conf/cards/Aureon71.conf
index 1479c25c..a43ce2ce 100644
--- a/src/conf/cards/Aureon71.conf
+++ b/src/conf/cards/Aureon71.conf
@@ -86,6 +86,7 @@ Aureon71.pcm.surround40.0 {
channels 4
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/CA0106.conf b/src/conf/cards/CA0106.conf
index 9d21770f..2f0eaf0a 100644
--- a/src/conf/cards/CA0106.conf
+++ b/src/conf/cards/CA0106.conf
@@ -108,6 +108,7 @@ CA0106.pcm.surround40.0 {
]
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/CMI8738-MC6.conf b/src/conf/cards/CMI8738-MC6.conf
index 171c7728..edc67d44 100644
--- a/src/conf/cards/CMI8738-MC6.conf
+++ b/src/conf/cards/CMI8738-MC6.conf
@@ -77,6 +77,7 @@ CMI8738-MC6.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/CMI8738-MC8.conf b/src/conf/cards/CMI8738-MC8.conf
index a5bf6cb4..ddff7530 100644
--- a/src/conf/cards/CMI8738-MC8.conf
+++ b/src/conf/cards/CMI8738-MC8.conf
@@ -105,6 +105,7 @@ CMI8738-MC8.pcm.surround40.0 {
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/CMI8788.conf b/src/conf/cards/CMI8788.conf
index 0ca71e9d..edcb0c9c 100644
--- a/src/conf/cards/CMI8788.conf
+++ b/src/conf/cards/CMI8788.conf
@@ -48,7 +48,7 @@ CMI8788.pcm.surround40.0 {
channels 4
}
-
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/CS46xx.conf b/src/conf/cards/CS46xx.conf
index 19831425..b71c30aa 100644
--- a/src/conf/cards/CS46xx.conf
+++ b/src/conf/cards/CS46xx.conf
@@ -112,6 +112,7 @@ CS46xx.pcm.surround40.0 {
]
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/EMU10K1.conf b/src/conf/cards/EMU10K1.conf
index d51f6dc0..ef193fe0 100644
--- a/src/conf/cards/EMU10K1.conf
+++ b/src/conf/cards/EMU10K1.conf
@@ -217,6 +217,7 @@ EMU10K1.pcm.surround40.0 {
]
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/EMU10K1X.conf b/src/conf/cards/EMU10K1X.conf
index b5fc708c..f7428636 100644
--- a/src/conf/cards/EMU10K1X.conf
+++ b/src/conf/cards/EMU10K1X.conf
@@ -96,6 +96,7 @@ EMU10K1X.pcm.surround40.0 {
]
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/FM801.conf b/src/conf/cards/FM801.conf
index 997b2184..0ddf799c 100644
--- a/src/conf/cards/FM801.conf
+++ b/src/conf/cards/FM801.conf
@@ -40,6 +40,7 @@ FM801.pcm.default {
FM801.pcm.surround40.0 "cards.FM801.pcm.front.0"
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/FireWave.conf b/src/conf/cards/FireWave.conf
index 63fb23d9..fcfc83cc 100644
--- a/src/conf/cards/FireWave.conf
+++ b/src/conf/cards/FireWave.conf
@@ -25,6 +25,7 @@ FireWave.pcm.front.0 {
card $CARD
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/HDA-Intel.conf b/src/conf/cards/HDA-Intel.conf
index 3957c124..fa9f6946 100644
--- a/src/conf/cards/HDA-Intel.conf
+++ b/src/conf/cards/HDA-Intel.conf
@@ -71,6 +71,7 @@ HDA-Intel.pcm.default {
hint.device 0
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround40.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
@@ -305,6 +306,98 @@ HDA-Intel.pcm.hdmi.3 {
}
}
+HDA-Intel.pcm.hdmi.4 {
+ @args [ CARD AES0 AES1 AES2 AES3 ]
+ @args.CARD { type string }
+ @args.AES0 { type integer }
+ @args.AES1 { type integer }
+ @args.AES2 { type integer }
+ @args.AES3 { type integer }
+ @func refer
+ name {
+ @func concat
+ strings [
+ "cards.HDA-Intel.pcm.hdmi.common:"
+ "CARD=" $CARD ","
+ "DEVICE=10,"
+ "CTLINDEX=4,"
+ "AES0=" $AES0 ","
+ "AES1=" $AES1 ","
+ "AES2=" $AES2 ","
+ "AES3=" $AES3
+ ]
+ }
+}
+
+HDA-Intel.pcm.hdmi.5 {
+ @args [ CARD AES0 AES1 AES2 AES3 ]
+ @args.CARD { type string }
+ @args.AES0 { type integer }
+ @args.AES1 { type integer }
+ @args.AES2 { type integer }
+ @args.AES3 { type integer }
+ @func refer
+ name {
+ @func concat
+ strings [
+ "cards.HDA-Intel.pcm.hdmi.common:"
+ "CARD=" $CARD ","
+ "DEVICE=11,"
+ "CTLINDEX=5,"
+ "AES0=" $AES0 ","
+ "AES1=" $AES1 ","
+ "AES2=" $AES2 ","
+ "AES3=" $AES3
+ ]
+ }
+}
+
+HDA-Intel.pcm.hdmi.6 {
+ @args [ CARD AES0 AES1 AES2 AES3 ]
+ @args.CARD { type string }
+ @args.AES0 { type integer }
+ @args.AES1 { type integer }
+ @args.AES2 { type integer }
+ @args.AES3 { type integer }
+ @func refer
+ name {
+ @func concat
+ strings [
+ "cards.HDA-Intel.pcm.hdmi.common:"
+ "CARD=" $CARD ","
+ "DEVICE=12,"
+ "CTLINDEX=6,"
+ "AES0=" $AES0 ","
+ "AES1=" $AES1 ","
+ "AES2=" $AES2 ","
+ "AES3=" $AES3
+ ]
+ }
+}
+
+HDA-Intel.pcm.hdmi.7 {
+ @args [ CARD AES0 AES1 AES2 AES3 ]
+ @args.CARD { type string }
+ @args.AES0 { type integer }
+ @args.AES1 { type integer }
+ @args.AES2 { type integer }
+ @args.AES3 { type integer }
+ @func refer
+ name {
+ @func concat
+ strings [
+ "cards.HDA-Intel.pcm.hdmi.common:"
+ "CARD=" $CARD ","
+ "DEVICE=13,"
+ "CTLINDEX=7,"
+ "AES0=" $AES0 ","
+ "AES1=" $AES1 ","
+ "AES2=" $AES2 ","
+ "AES3=" $AES3
+ ]
+ }
+}
+
<confdir:pcm/modem.conf>
HDA-Intel.pcm.modem.0 {
diff --git a/src/conf/cards/ICE1712.conf b/src/conf/cards/ICE1712.conf
index f5b8add6..398fa7ad 100644
--- a/src/conf/cards/ICE1712.conf
+++ b/src/conf/cards/ICE1712.conf
@@ -74,6 +74,7 @@ ICE1712.pcm.surround40.0 {
slave.channels 10
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/ICE1724.conf b/src/conf/cards/ICE1724.conf
index e806b36d..61cac013 100644
--- a/src/conf/cards/ICE1724.conf
+++ b/src/conf/cards/ICE1724.conf
@@ -95,6 +95,7 @@ ICE1724.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/ICH.conf b/src/conf/cards/ICH.conf
index 47ffef96..6fc9a5a2 100644
--- a/src/conf/cards/ICH.conf
+++ b/src/conf/cards/ICH.conf
@@ -98,6 +98,7 @@ ICH.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/ICH4.conf b/src/conf/cards/ICH4.conf
index 1bf5605b..64ec883d 100644
--- a/src/conf/cards/ICH4.conf
+++ b/src/conf/cards/ICH4.conf
@@ -98,6 +98,7 @@ ICH4.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/Loopback.conf b/src/conf/cards/Loopback.conf
new file mode 100644
index 00000000..1ae6d453
--- /dev/null
+++ b/src/conf/cards/Loopback.conf
@@ -0,0 +1,75 @@
+#
+# Configuration for the virtual loopback driver (snd-aloop)
+#
+
+<confdir:pcm/front.conf>
+
+Loopback.pcm.front.0 {
+ @args [ CARD ]
+ @args.CARD {
+ type string
+ }
+ type softvol
+ slave.pcm {
+ type hw
+ card $CARD
+ }
+ control {
+ name "PCM Playback Volume"
+ card $CARD
+ }
+}
+
+# default with dmix+softvol & dsnoop
+Loopback.pcm.default {
+ @args [ CARD ]
+ @args.CARD {
+ type string
+ }
+ type asym
+ playback.pcm {
+ type plug
+ slave.pcm {
+ type softvol
+ slave.pcm {
+ @func concat
+ strings [ "dmix:" $CARD ]
+ }
+ control {
+ name "PCM Playback Volume"
+ card $CARD
+ }
+ }
+ }
+ capture.pcm {
+ type plug
+ slave.pcm {
+ type softvol
+ slave.pcm {
+ @func concat
+ strings [ "dsnoop:" $CARD ]
+ }
+ control {
+ name "Digital Capture Volume"
+ card $CARD
+ }
+ min_dB -30.0
+ max_dB 30.0
+ resolution 121
+ }
+ # to avoid possible phase inversions with digital mics
+ route_policy copy
+ }
+ hint.device 0
+}
+
+<confdir:pcm/surround21.conf>
+<confdir:pcm/surround40.conf>
+<confdir:pcm/surround41.conf>
+<confdir:pcm/surround50.conf>
+<confdir:pcm/surround51.conf>
+<confdir:pcm/surround71.conf>
+
+Loopback.pcm.surround40.0 cards.Loopback.pcm.front.0
+Loopback.pcm.surround51.0 cards.Loopback.pcm.front.0
+Loopback.pcm.surround71.0 cards.Loopback.pcm.front.0
diff --git a/src/conf/cards/Makefile.am b/src/conf/cards/Makefile.am
index ee7991be..008d399f 100644
--- a/src/conf/cards/Makefile.am
+++ b/src/conf/cards/Makefile.am
@@ -35,6 +35,7 @@ cfg_files = aliases.conf \
ICH.conf \
ICH4.conf \
ICH-MODEM.conf \
+ Loopback.conf \
Maestro3.conf \
NFORCE.conf \
PC-Speaker.conf \
diff --git a/src/conf/cards/Makefile.in b/src/conf/cards/Makefile.in
index 82b9c153..8587ab2b 100644
--- a/src/conf/cards/Makefile.in
+++ b/src/conf/cards/Makefile.in
@@ -55,7 +55,7 @@ subdir = src/conf/cards
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -249,12 +249,12 @@ cfg_files = aliases.conf AACI.conf ATIIXP.conf ATIIXP-SPDMA.conf \
EMU10K1.conf EMU10K1X.conf ENS1370.conf ENS1371.conf \
ES1968.conf FM801.conf FWSpeakers.conf FireWave.conf GUS.conf \
HDA-Intel.conf ICE1712.conf ICE1724.conf ICH.conf ICH4.conf \
- ICH-MODEM.conf Maestro3.conf NFORCE.conf PC-Speaker.conf \
- PMac.conf PMacToonie.conf PS3.conf RME9636.conf RME9652.conf \
- SI7018.conf SB-XFi.conf TRID4DWAVENX.conf USB-Audio.conf \
- YMF744.conf VIA686A.conf VIA8233.conf VIA8233A.conf \
- VIA8237.conf VX222.conf VXPocket.conf VXPocket440.conf \
- $(am__append_1)
+ ICH-MODEM.conf Loopback.conf Maestro3.conf NFORCE.conf \
+ PC-Speaker.conf PMac.conf PMacToonie.conf PS3.conf \
+ RME9636.conf RME9652.conf SI7018.conf SB-XFi.conf \
+ TRID4DWAVENX.conf USB-Audio.conf YMF744.conf VIA686A.conf \
+ VIA8233.conf VIA8233A.conf VIA8237.conf VX222.conf \
+ VXPocket.conf VXPocket440.conf $(am__append_1)
alsa_DATA = $(cfg_files)
@BUILD_ALISP_TRUE@SI7018dir = $(alsaconfigdir)/cards/SI7018
@BUILD_ALISP_FALSE@SI7018_files =
diff --git a/src/conf/cards/NFORCE.conf b/src/conf/cards/NFORCE.conf
index 6ebefe3d..64d15479 100644
--- a/src/conf/cards/NFORCE.conf
+++ b/src/conf/cards/NFORCE.conf
@@ -98,6 +98,7 @@ NFORCE.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/SB-XFi.conf b/src/conf/cards/SB-XFi.conf
index 38d0027f..eb2218bf 100644
--- a/src/conf/cards/SB-XFi.conf
+++ b/src/conf/cards/SB-XFi.conf
@@ -53,6 +53,7 @@ SB-XFi.pcm.side.0 {
hint.device 3
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround40.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
diff --git a/src/conf/cards/SI7018.conf b/src/conf/cards/SI7018.conf
index 7417bd5b..02b8fc87 100644
--- a/src/conf/cards/SI7018.conf
+++ b/src/conf/cards/SI7018.conf
@@ -78,6 +78,7 @@ SI7018.pcm.surround40.0 {
]
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf
index 0d931758..ce3ae019 100644
--- a/src/conf/cards/USB-Audio.conf
+++ b/src/conf/cards/USB-Audio.conf
@@ -101,6 +101,41 @@ USB-Audio."Audiophile USB (tm)".pcm.iec958 {
}
}
+# For this card we can (and must to get IEC61937) set AES bits
+USB-Audio."MicroII".pcm.iec958 "cards.USB-Audio.Audio Advantage MicroII.pcm.iec958"
+USB-Audio."Audio Advantage MicroII".pcm.iec958 {
+ @args [ CARD AES0 AES1 AES2 AES3 ]
+ @args.CARD { type string }
+ @args.AES0 { type integer }
+ @args.AES1 { type integer }
+ @args.AES2 { type integer }
+ @args.AES3 { type integer }
+
+ type hooks
+ slave.pcm {
+ type hw
+ card $CARD
+ }
+
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {
+ interface PCM
+ name "IEC958 Playback Default"
+ preserve true
+ optional true
+ value [ $AES0 $AES1 $AES2 $AES3 ]
+ }
+ {
+ name "IEC958 Playback Switch"
+ lock true
+ preserve true
+ value 1
+ }
+ ]
+ }
+}
################################################################################
@@ -279,6 +314,7 @@ USB-Audio.pcm.surround40_two_stereo_devices {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/VIA8233.conf b/src/conf/cards/VIA8233.conf
index 668bfd9e..9ad321f7 100644
--- a/src/conf/cards/VIA8233.conf
+++ b/src/conf/cards/VIA8233.conf
@@ -86,6 +86,7 @@ VIA8233.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/VIA8233A.conf b/src/conf/cards/VIA8233A.conf
index 97d2a7da..679fccf3 100644
--- a/src/conf/cards/VIA8233A.conf
+++ b/src/conf/cards/VIA8233A.conf
@@ -84,6 +84,7 @@ VIA8233A.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/VIA8237.conf b/src/conf/cards/VIA8237.conf
index 404e1907..29d8e00f 100644
--- a/src/conf/cards/VIA8237.conf
+++ b/src/conf/cards/VIA8237.conf
@@ -79,6 +79,7 @@ VIA8237.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/pcm/Makefile.am b/src/conf/pcm/Makefile.am
index cc3286e6..c548660d 100644
--- a/src/conf/pcm/Makefile.am
+++ b/src/conf/pcm/Makefile.am
@@ -1,5 +1,5 @@
cfg_files = default.conf front.conf rear.conf center_lfe.conf side.conf\
- surround40.conf surround41.conf \
+ surround21.conf surround40.conf surround41.conf \
surround50.conf surround51.conf \
surround71.conf iec958.conf hdmi.conf modem.conf \
dmix.conf dsnoop.conf \
diff --git a/src/conf/pcm/Makefile.in b/src/conf/pcm/Makefile.in
index a3cdd4b0..c2127281 100644
--- a/src/conf/pcm/Makefile.in
+++ b/src/conf/pcm/Makefile.in
@@ -54,7 +54,7 @@ subdir = src/conf/pcm
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -239,7 +239,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
cfg_files = default.conf front.conf rear.conf center_lfe.conf side.conf\
- surround40.conf surround41.conf \
+ surround21.conf surround40.conf surround41.conf \
surround50.conf surround51.conf \
surround71.conf iec958.conf hdmi.conf modem.conf \
dmix.conf dsnoop.conf \
diff --git a/src/conf/pcm/surround21.conf b/src/conf/pcm/surround21.conf
new file mode 100644
index 00000000..7f4676b3
--- /dev/null
+++ b/src/conf/pcm/surround21.conf
@@ -0,0 +1,61 @@
+#
+# Hardware output from 2.1 speakers.
+# Samples must be positioned:
+# chn0 - front left
+# chn1 - front right
+# chn2 - LFE
+#
+
+pcm.!surround21 {
+ @args [ CARD DEV ]
+ @args.CARD {
+ type string
+ default {
+ @func getenv
+ vars [
+ ALSA_SURROUND21_CARD
+ ALSA_PCM_CARD
+ ALSA_CARD
+ ]
+ default {
+ @func refer
+ name defaults.pcm.surround21.card
+ }
+ }
+ }
+ @args.DEV {
+ type integer
+ default {
+ @func igetenv
+ vars [
+ ALSA_SURROUND21_DEVICE
+ ]
+ default {
+ @func refer
+ name defaults.pcm.surround21.device
+ }
+ }
+ }
+ type route
+ slave.pcm {
+ @func refer
+ name {
+ @func concat
+ strings [
+ "cards."
+ {
+ @func card_driver
+ card $CARD
+ }
+ ".pcm.surround51." $DEV ":CARD=" $CARD
+ ]
+ }
+ }
+ ttable.0.FL 1
+ ttable.1.FR 1
+ ttable.2.LFE 1
+ hint {
+ description "2.1 Surround output to Front and Subwoofer speakers"
+ device $DEV
+ }
+}
diff --git a/src/conf/ucm/DAISY-I2S/Makefile.in b/src/conf/ucm/DAISY-I2S/Makefile.in
index 9767b237..4d9bfed5 100644
--- a/src/conf/ucm/DAISY-I2S/Makefile.in
+++ b/src/conf/ucm/DAISY-I2S/Makefile.in
@@ -54,7 +54,7 @@ subdir = src/conf/ucm/DAISY-I2S
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/src/conf/ucm/Makefile.in b/src/conf/ucm/Makefile.in
index 1ad4e5b8..eba99924 100644
--- a/src/conf/ucm/Makefile.in
+++ b/src/conf/ucm/Makefile.in
@@ -53,7 +53,7 @@ subdir = src/conf/ucm
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/src/conf/ucm/PandaBoard/Makefile.in b/src/conf/ucm/PandaBoard/Makefile.in
index 936c2908..33fc9070 100644
--- a/src/conf/ucm/PandaBoard/Makefile.in
+++ b/src/conf/ucm/PandaBoard/Makefile.in
@@ -54,7 +54,7 @@ subdir = src/conf/ucm/PandaBoard
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/src/conf/ucm/PandaBoardES/Makefile.in b/src/conf/ucm/PandaBoardES/Makefile.in
index 608bd534..d357c0a5 100644
--- a/src/conf/ucm/PandaBoardES/Makefile.in
+++ b/src/conf/ucm/PandaBoardES/Makefile.in
@@ -54,7 +54,7 @@ subdir = src/conf/ucm/PandaBoardES
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/src/conf/ucm/SDP4430/Makefile.in b/src/conf/ucm/SDP4430/Makefile.in
index b8a08061..1a81a073 100644
--- a/src/conf/ucm/SDP4430/Makefile.in
+++ b/src/conf/ucm/SDP4430/Makefile.in
@@ -54,7 +54,7 @@ subdir = src/conf/ucm/SDP4430
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/src/conf/ucm/tegraalc5632/Makefile.in b/src/conf/ucm/tegraalc5632/Makefile.in
index bb301f47..7334d1de 100644
--- a/src/conf/ucm/tegraalc5632/Makefile.in
+++ b/src/conf/ucm/tegraalc5632/Makefile.in
@@ -54,7 +54,7 @@ subdir = src/conf/ucm/tegraalc5632
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/src/control/Makefile.am b/src/control/Makefile.am
index 8076c732..3d476a21 100644
--- a/src/control/Makefile.am
+++ b/src/control/Makefile.am
@@ -15,4 +15,4 @@ noinst_HEADERS = control_local.h
all: libcontrol.la
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
diff --git a/src/control/Makefile.in b/src/control/Makefile.in
index 5c41b3d7..53fd2b46 100644
--- a/src/control/Makefile.in
+++ b/src/control/Makefile.in
@@ -57,7 +57,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -256,7 +256,7 @@ libcontrol_la_SOURCES = cards.c tlv.c namehint.c hcontrol.c control.c \
control_hw.c setup.c ctlparse.c control_symbols.c \
$(am__append_1) $(am__append_2)
noinst_HEADERS = control_local.h
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
all: all-am
.SUFFIXES:
diff --git a/src/control/control_hw.c b/src/control/control_hw.c
index 148097fa..dfc9dcd5 100644
--- a/src/control/control_hw.c
+++ b/src/control/control_hw.c
@@ -240,8 +240,10 @@ static int snd_ctl_hw_elem_tlv(snd_ctl_t *handle, int op_flag,
return -errno;
}
if (op_flag == 0) {
- if (xtlv->tlv[1] + 2 * sizeof(unsigned int) > tlv_size)
+ if (xtlv->tlv[1] + 2 * sizeof(unsigned int) > tlv_size) {
+ free(xtlv);
return -EFAULT;
+ }
memcpy(tlv, xtlv->tlv, xtlv->tlv[1] + 2 * sizeof(unsigned int));
}
free(xtlv);
diff --git a/src/control/namehint.c b/src/control/namehint.c
index 8d5e9258..28975a40 100644
--- a/src/control/namehint.c
+++ b/src/control/namehint.c
@@ -406,7 +406,7 @@ static const next_devices_t next_devices[] = {
};
#endif
-static int add_card(snd_config_t *config, struct hint_list *list, int card)
+static int add_card(snd_config_t *config, snd_config_t *rw_config, struct hint_list *list, int card)
{
int err, ok;
snd_config_t *conf, *n;
@@ -449,7 +449,7 @@ static int add_card(snd_config_t *config, struct hint_list *list, int card)
ok = 0;
for (device = 0; err >= 0 && device <= max_device; device++) {
list->device = device;
- err = try_config(config, list, list->siface, str);
+ err = try_config(rw_config, list, list->siface, str);
if (err < 0)
break;
ok++;
@@ -464,7 +464,7 @@ static int add_card(snd_config_t *config, struct hint_list *list, int card)
if (err < 0) {
list->card = card;
list->device = -1;
- err = try_config(config, list, list->siface, str);
+ err = try_config(rw_config, list, list->siface, str);
}
if (err == -ENOMEM)
goto __error;
@@ -493,7 +493,8 @@ static int get_card_name(struct hint_list *list, int card)
return 0;
}
-static int add_software_devices(snd_config_t *config, struct hint_list *list)
+static int add_software_devices(snd_config_t *config, snd_config_t *rw_config,
+ struct hint_list *list)
{
int err;
snd_config_t *conf, *n;
@@ -509,7 +510,7 @@ static int add_software_devices(snd_config_t *config, struct hint_list *list)
continue;
list->card = -1;
list->device = -1;
- err = try_config(config, list, list->siface, str);
+ err = try_config(rw_config, list, list->siface, str);
if (err == -ENOMEM)
return -ENOMEM;
}
@@ -547,7 +548,7 @@ int snd_device_name_hint(int card, const char *iface, void ***hints)
struct hint_list list;
char ehints[24];
const char *str;
- snd_config_t *conf, *local_config = NULL;
+ snd_config_t *conf, *local_config = NULL, *local_config_rw = NULL;
snd_config_update_t *local_config_update = NULL;
snd_config_iterator_t i, next;
int err;
@@ -557,6 +558,7 @@ int snd_device_name_hint(int card, const char *iface, void ***hints)
err = snd_config_update_r(&local_config, &local_config_update, NULL);
if (err < 0)
return err;
+ err = snd_config_copy(&local_config_rw, local_config);
list.list = NULL;
list.count = list.allocated = 0;
list.siface = iface;
@@ -586,9 +588,9 @@ int snd_device_name_hint(int card, const char *iface, void ***hints)
if (card >= 0) {
err = get_card_name(&list, card);
if (err >= 0)
- err = add_card(local_config, &list, card);
+ err = add_card(local_config, local_config_rw, &list, card);
} else {
- add_software_devices(local_config, &list);
+ add_software_devices(local_config, local_config_rw, &list);
err = snd_card_next(&card);
if (err < 0)
goto __error;
@@ -596,7 +598,7 @@ int snd_device_name_hint(int card, const char *iface, void ***hints)
err = get_card_name(&list, card);
if (err < 0)
goto __error;
- err = add_card(local_config, &list, card);
+ err = add_card(local_config, local_config_rw, &list, card);
if (err < 0)
goto __error;
err = snd_card_next(&card);
@@ -630,6 +632,8 @@ int snd_device_name_hint(int card, const char *iface, void ***hints)
if (list.cardname)
free(list.cardname);
}
+ if (local_config_rw)
+ snd_config_delete(local_config_rw);
if (local_config)
snd_config_delete(local_config);
if (local_config_update)
diff --git a/src/control/tlv.c b/src/control/tlv.c
index 6b0b9f43..b08d8872 100644
--- a/src/control/tlv.c
+++ b/src/control/tlv.c
@@ -312,7 +312,7 @@ int snd_tlv_convert_from_dB(unsigned int *tlv, long rangemin, long rangemax,
submin, submax,
db_gain, value, xdir);
else if (db_gain < dbmin) {
- *value = xdir || pos == 2 ? submin : prev_submax;
+ *value = xdir > 0 || pos == 2 ? submin : prev_submax;
return 0;
}
prev_submax = submax;
diff --git a/src/hwdep/Makefile.am b/src/hwdep/Makefile.am
index 0b626b90..b543e581 100644
--- a/src/hwdep/Makefile.am
+++ b/src/hwdep/Makefile.am
@@ -5,4 +5,4 @@ noinst_HEADERS = hwdep_local.h
all: libhwdep.la
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
diff --git a/src/hwdep/Makefile.in b/src/hwdep/Makefile.in
index 36b0a6e8..43ddf8a7 100644
--- a/src/hwdep/Makefile.in
+++ b/src/hwdep/Makefile.in
@@ -55,7 +55,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -245,7 +245,7 @@ top_srcdir = @top_srcdir@
EXTRA_LTLIBRARIES = libhwdep.la
libhwdep_la_SOURCES = hwdep.c hwdep_hw.c hwdep_symbols.c
noinst_HEADERS = hwdep_local.h
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
all: all-am
.SUFFIXES:
diff --git a/src/mixer/Makefile.am b/src/mixer/Makefile.am
index c0749a47..6eeff8af 100644
--- a/src/mixer/Makefile.am
+++ b/src/mixer/Makefile.am
@@ -11,4 +11,4 @@ noinst_HEADERS = mixer_local.h mixer_simple.h
all: libmixer.la
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
diff --git a/src/mixer/Makefile.in b/src/mixer/Makefile.in
index af4a0d33..d7a69053 100644
--- a/src/mixer/Makefile.in
+++ b/src/mixer/Makefile.in
@@ -56,7 +56,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -251,7 +251,7 @@ EXTRA_LTLIBRARIES = libmixer.la
libmixer_la_SOURCES = bag.c mixer.c simple.c simple_none.c \
$(am__append_1)
noinst_HEADERS = mixer_local.h mixer_simple.h
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
all: all-am
.SUFFIXES:
diff --git a/src/pcm/Makefile.am b/src/pcm/Makefile.am
index 28faa542..81598f63 100644
--- a/src/pcm/Makefile.am
+++ b/src/pcm/Makefile.am
@@ -114,4 +114,4 @@ alsadir = $(datadir)/alsa
all: libpcm.la
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
diff --git a/src/pcm/Makefile.in b/src/pcm/Makefile.in
index f2ee4f99..44ea9d85 100644
--- a/src/pcm/Makefile.in
+++ b/src/pcm/Makefile.in
@@ -86,7 +86,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -386,7 +386,7 @@ noinst_HEADERS = pcm_local.h pcm_plugin.h mask.h mask_inline.h \
pcm_generic.h pcm_ext_parm.h
alsadir = $(datadir)/alsa
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
all: all-recursive
.SUFFIXES:
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index ca4d416f..7e460146 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -105,7 +105,7 @@ The poll or select functions (see 'man 2 poll' or 'man 2 select' for further
details) allows to receive requests/events from the device while
an application is waiting on events from other sources (like keyboard, screen,
network etc.), too. \ref snd_pcm_poll_descriptors can be used to get file
-descriptors to poll or select on (note that wait direction might be diferent
+descriptors to poll or select on (note that wait direction might be different
than expected - do not use only returned file descriptors, but handle
events member as well - see \ref snd_pcm_poll_descriptors function
description for more details and \ref snd_pcm_poll_descriptors_revents for
@@ -7932,7 +7932,7 @@ int snd_pcm_set_params(snd_pcm_t *pcm,
return err;
}
if (rrate != rate) {
- SNDERR("Rate doesn't match (requested %iHz, get %iHz)", rate, err);
+ SNDERR("Rate doesn't match (requested %iHz, get %iHz)", rate, rrate);
return -EINVAL;
}
/* set the buffer time */
diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
index 899c2504..5416cf71 100644
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -857,6 +857,7 @@ static void save_slave_setting(snd_pcm_direct_t *dmix, snd_pcm_t *spcm)
COPY_SLAVE(buffer_time);
COPY_SLAVE(sample_bits);
COPY_SLAVE(frame_bits);
+ COPY_SLAVE(monotonic);
}
#undef COPY_SLAVE
@@ -1220,6 +1221,7 @@ static void copy_slave_setting(snd_pcm_direct_t *dmix, snd_pcm_t *spcm)
COPY_SLAVE(buffer_time);
COPY_SLAVE(sample_bits);
COPY_SLAVE(frame_bits);
+ COPY_SLAVE(monotonic);
spcm->info &= ~SND_PCM_INFO_PAUSE;
spcm->boundary = recalc_boundary_size(dmix->shmptr->s.boundary, spcm->buffer_size);
diff --git a/src/pcm/pcm_direct.h b/src/pcm/pcm_direct.h
index 70c2c6a0..5ae39c0e 100644
--- a/src/pcm/pcm_direct.h
+++ b/src/pcm/pcm_direct.h
@@ -274,8 +274,8 @@ static inline int snd_pcm_direct_semaphore_up(snd_pcm_direct_t *dmix, int sem_nu
static inline int snd_pcm_direct_semaphore_final(snd_pcm_direct_t *dmix, int sem_num)
{
if (dmix->locked[sem_num] != 1) {
- assert(dmix->locked[sem_num] != 1);
- abort();
+ SNDMSG("invalid semaphore count to finalize %d: %d", sem_num, dmix->locked[sem_num]);
+ return -EBUSY;
}
return snd_pcm_direct_semaphore_up(dmix, sem_num);
}
diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c
index 2bd5d398..4aa6d4ea 100644
--- a/src/pcm/pcm_dmix.c
+++ b/src/pcm/pcm_dmix.c
@@ -1104,7 +1104,7 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name,
pcm->poll_fd = dmix->poll_fd;
pcm->poll_events = POLLIN; /* it's different than other plugins */
-
+ pcm->monotonic = spcm->monotonic;
pcm->mmap_rw = 1;
snd_pcm_set_hw_ptr(pcm, &dmix->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &dmix->appl_ptr, -1, 0);
diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c
index 5b329510..f2d1103a 100644
--- a/src/pcm/pcm_dshare.c
+++ b/src/pcm/pcm_dshare.c
@@ -792,7 +792,7 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name,
pcm->poll_fd = dshare->poll_fd;
pcm->poll_events = POLLIN; /* it's different than other plugins */
-
+ pcm->monotonic = spcm->monotonic;
pcm->mmap_rw = 1;
snd_pcm_set_hw_ptr(pcm, &dshare->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &dshare->appl_ptr, -1, 0);
diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c
index 055e4f49..76379140 100644
--- a/src/pcm/pcm_dsnoop.c
+++ b/src/pcm/pcm_dsnoop.c
@@ -690,7 +690,7 @@ int snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name,
pcm->poll_fd = dsnoop->poll_fd;
pcm->poll_events = POLLIN; /* it's different than other plugins */
-
+ pcm->monotonic = spcm->monotonic;
pcm->mmap_rw = 1;
snd_pcm_set_hw_ptr(pcm, &dsnoop->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &dsnoop->appl_ptr, -1, 0);
diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c
index 59504019..b139f7f2 100644
--- a/src/pcm/pcm_file.c
+++ b/src/pcm/pcm_file.c
@@ -26,7 +26,6 @@
*
*/
-#include <endian.h>
#include <byteswap.h>
#include <ctype.h>
#include <string.h>
@@ -406,7 +405,9 @@ static int snd_pcm_file_close(snd_pcm_t *pcm)
if (file->wav_header.fmt)
fixup_wav_header(pcm);
free((void *)file->fname);
- close(file->fd);
+ if (file->fd >= 0) {
+ close(file->fd);
+ }
}
if (file->ifname) {
free((void *)file->ifname);
@@ -533,7 +534,6 @@ static snd_pcm_sframes_t snd_pcm_file_writen(snd_pcm_t *pcm, void **bufs, snd_pc
static snd_pcm_sframes_t snd_pcm_file_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size)
{
snd_pcm_file_t *file = pcm->private_data;
- snd_pcm_channel_area_t areas[pcm->channels];
snd_pcm_sframes_t n;
n = snd_pcm_readi(file->gen.slave, buffer, size);
@@ -545,15 +545,12 @@ static snd_pcm_sframes_t snd_pcm_file_readi(snd_pcm_t *pcm, void *buffer, snd_pc
return n;
return n * 8 / pcm->frame_bits;
}
- snd_pcm_areas_from_buf(pcm, areas, buffer);
- snd_pcm_file_add_frames(pcm, areas, 0, n);
return n;
}
static snd_pcm_sframes_t snd_pcm_file_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size)
{
snd_pcm_file_t *file = pcm->private_data;
- snd_pcm_channel_area_t areas[pcm->channels];
snd_pcm_sframes_t n;
if (file->ifd >= 0) {
@@ -562,10 +559,6 @@ static snd_pcm_sframes_t snd_pcm_file_readn(snd_pcm_t *pcm, void **bufs, snd_pcm
}
n = snd_pcm_readn(file->gen.slave, bufs, size);
- if (n > 0) {
- snd_pcm_areas_from_bufs(pcm, areas, bufs);
- snd_pcm_file_add_frames(pcm, areas, 0, n);
- }
return n;
}
@@ -592,8 +585,10 @@ static int snd_pcm_file_hw_free(snd_pcm_t *pcm)
snd_pcm_file_t *file = pcm->private_data;
free(file->wbuf);
free(file->wbuf_areas);
+ free(file->final_fname);
file->wbuf = NULL;
file->wbuf_areas = NULL;
+ file->final_fname = NULL;
return snd_pcm_hw_free(file->gen.slave);
}
@@ -627,7 +622,7 @@ static int snd_pcm_file_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
a->first = slave->sample_bits * channel;
a->step = slave->frame_bits;
}
- if (file->fd < 0) {
+ if ((file->fd < 0) && (pcm->stream == SND_PCM_STREAM_PLAYBACK)) {
err = snd_pcm_file_open_output_file(file);
if (err < 0) {
SYSERR("failed opening output file %s", file->fname);
@@ -702,6 +697,7 @@ static const snd_pcm_fast_ops_t snd_pcm_file_fast_ops = {
.poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
.poll_descriptors = snd_pcm_generic_poll_descriptors,
.poll_revents = snd_pcm_generic_poll_revents,
+ .htimestamp = snd_pcm_generic_real_htimestamp,
};
/**
@@ -718,6 +714,7 @@ static const snd_pcm_fast_ops_t snd_pcm_file_fast_ops = {
* \param perm File permission
* \param slave Slave PCM handle
* \param close_slave When set, the slave PCM handle is closed with copy PCM
+ * \param stream the direction of PCM stream
* \retval zero on success otherwise a negative error code
* \warning Using of this function might be dangerous in the sense
* of compatibility reasons. The prototype might be freely
@@ -726,7 +723,8 @@ static const snd_pcm_fast_ops_t snd_pcm_file_fast_ops = {
int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
const char *fname, int fd, const char *ifname, int ifd,
int trunc,
- const char *fmt, int perm, snd_pcm_t *slave, int close_slave)
+ const char *fmt, int perm, snd_pcm_t *slave, int close_slave,
+ snd_pcm_stream_t stream)
{
snd_pcm_t *pcm;
snd_pcm_file_t *file;
@@ -756,7 +754,7 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
file->trunc = trunc;
file->perm = perm;
- if (ifname) {
+ if (ifname && (stream == SND_PCM_STREAM_CAPTURE)) {
ifd = open(ifname, O_RDONLY); /* TODO: mind blocking mode */
if (ifd < 0) {
SYSERR("open %s for reading failed", ifname);
@@ -788,6 +786,7 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
#else
pcm->monotonic = 0;
#endif
+ pcm->stream = stream;
snd_pcm_link_hw_ptr(pcm, slave);
snd_pcm_link_appl_ptr(pcm, slave);
*pcmp = pcm;
@@ -948,7 +947,7 @@ int _snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
err = snd_pcm_slave_conf(root, slave, &sconf, 0);
if (err < 0)
return err;
- if ((!fname || strlen(fname) == 0) && fd < 0 && !ifname) {
+ if ((!fname || strlen(fname) == 0) && fd < 0) {
snd_config_delete(sconf);
SNDERR("file is not defined");
return -EINVAL;
@@ -958,7 +957,7 @@ int _snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
if (err < 0)
return err;
err = snd_pcm_file_open(pcmp, name, fname, fd, ifname, ifd,
- trunc, format, perm, spcm, 1);
+ trunc, format, perm, spcm, 1, stream);
if (err < 0)
snd_pcm_close(spcm);
return err;
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index 9ff83a92..ed831972 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -1051,7 +1051,7 @@ snd_pcm_query_chmaps_from_hw(int card, int dev, int subdev,
{
snd_ctl_t *ctl;
snd_ctl_elem_id_t *id;
- unsigned int tlv[256], *start;
+ unsigned int tlv[2048], *start;
snd_pcm_chmap_query_t **map;
int i, ret, nums;
diff --git a/src/pcm/pcm_iec958.c b/src/pcm/pcm_iec958.c
index d81b0a14..0c61fc17 100644
--- a/src/pcm/pcm_iec958.c
+++ b/src/pcm/pcm_iec958.c
@@ -62,6 +62,7 @@ struct snd_pcm_iec958 {
unsigned char status[24];
unsigned int byteswap;
unsigned char preamble[3]; /* B/M/W or Z/X/Y */
+ snd_pcm_fast_ops_t fops;
};
enum { PREAMBLE_Z, PREAMBLE_X, PREAMBLE_Y };
@@ -416,6 +417,35 @@ static void snd_pcm_iec958_dump(snd_pcm_t *pcm, snd_output_t *out)
snd_pcm_dump(iec->plug.gen.slave, out);
}
+static snd_pcm_sframes_t snd_pcm_iec958_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
+{
+ unsigned int counter_decrement;
+ snd_pcm_iec958_t *iec = pcm->private_data;
+ snd_pcm_sframes_t result = snd_pcm_plugin_rewind(pcm, frames);
+ if (result <= 0)
+ return result;
+
+ counter_decrement = result % 192;
+ iec->counter += 192 - counter_decrement;
+ iec->counter %= 192;
+ return result;
+}
+
+static snd_pcm_sframes_t snd_pcm_iec958_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
+
+{
+ unsigned int counter_increment;
+ snd_pcm_iec958_t *iec = pcm->private_data;
+ snd_pcm_sframes_t result = snd_pcm_plugin_rewind(pcm, frames);
+ if (result <= 0)
+ return result;
+
+ counter_increment = result % 192;
+ iec->counter += counter_increment;
+ iec->counter %= 192;
+ return result;
+}
+
static const snd_pcm_ops_t snd_pcm_iec958_ops = {
.close = snd_pcm_generic_close,
.info = snd_pcm_generic_info,
@@ -495,7 +525,12 @@ int snd_pcm_iec958_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sfo
return err;
}
pcm->ops = &snd_pcm_iec958_ops;
- pcm->fast_ops = &snd_pcm_plugin_fast_ops;
+
+ iec->fops = snd_pcm_plugin_fast_ops;
+ iec->fops.rewind = snd_pcm_iec958_rewind;
+ iec->fops.forward = snd_pcm_iec958_forward;
+ pcm->fast_ops = &iec->fops;
+
pcm->private_data = iec;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
diff --git a/src/pcm/pcm_ioplug.c b/src/pcm/pcm_ioplug.c
index a90c8445..c1c3a983 100644
--- a/src/pcm/pcm_ioplug.c
+++ b/src/pcm/pcm_ioplug.c
@@ -60,7 +60,7 @@ static void snd_pcm_ioplug_hw_ptr_update(snd_pcm_t *pcm)
delta = hw - io->last_hw;
else
delta = pcm->buffer_size + hw - io->last_hw;
- io->data->hw_ptr += delta;
+ snd_pcm_mmap_hw_forward(io->data->pcm, delta);
io->last_hw = hw;
} else
io->data->state = SNDRV_PCM_STATE_XRUN;
diff --git a/src/pcm/pcm_ladspa.c b/src/pcm/pcm_ladspa.c
index 0a9c52e9..7d1e3df8 100644
--- a/src/pcm/pcm_ladspa.c
+++ b/src/pcm/pcm_ladspa.c
@@ -645,8 +645,6 @@ static int snd_pcm_ladspa_allocate_instances(snd_pcm_t *pcm, snd_pcm_ladspa_t *l
return -EINVAL;
}
list_add_tail(&instance->list, &plugin->instances);
- if (plugin->desc->activate)
- plugin->desc->activate(instance->handle);
if (plugin->policy == SND_PCM_LADSPA_POLICY_DUPLICATE) {
err = snd_pcm_ladspa_connect_plugin_duplicate(plugin, &plugin->input, &plugin->output, instance, idx);
if (err < 0) {
@@ -664,6 +662,8 @@ static int snd_pcm_ladspa_allocate_instances(snd_pcm_t *pcm, snd_pcm_ladspa_t *l
assert(err >= 0);
err = snd_pcm_ladspa_connect_controls(plugin, &plugin->output, instance);
assert(err >= 0);
+ if (plugin->desc->activate)
+ plugin->desc->activate(instance->handle);
}
err = snd_pcm_ladspa_check_connect(plugin, &plugin->input, &instance->input, depth);
if (err < 0)
@@ -1326,7 +1326,7 @@ static int snd_pcm_ladspa_parse_bindings(snd_pcm_ladspa_plugin_t *lplug,
count = (unsigned int)(channel + 1);
}
if (count > 0) {
- array = (unsigned int *)calloc(count, sizeof(unsigned int));
+ array = (unsigned int *)malloc(count * sizeof(unsigned int));
if (! array)
return -ENOMEM;
memset(array, 0xff, count * sizeof(unsigned int));
diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h
index e1c0baa8..8a6c7431 100644
--- a/src/pcm/pcm_local.h
+++ b/src/pcm/pcm_local.h
@@ -961,17 +961,21 @@ 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 defined(HAVE_CLOCK_GETTIME)
+#if defined(CLOCK_MONOTONIC)
if (monotonic) {
clock_gettime(CLOCK_MONOTONIC, tstamp);
} else {
#endif
+ clock_gettime(CLOCK_REALTIME, tstamp);
+#else
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
+#if defined(HAVE_CLOCK_GETTIME)
}
#endif
}
diff --git a/src/pcm/pcm_meter.c b/src/pcm/pcm_meter.c
index 573b6fe5..676fbef8 100644
--- a/src/pcm/pcm_meter.c
+++ b/src/pcm/pcm_meter.c
@@ -33,7 +33,10 @@
#include <dlfcn.h>
#include "pcm_local.h"
#include "pcm_plugin.h"
-#include "iatomic.h"
+
+#define atomic_read(ptr) __atomic_load_n(ptr, __ATOMIC_SEQ_CST )
+#define atomic_add(ptr, n) __atomic_add_fetch(ptr, n, __ATOMIC_SEQ_CST)
+#define atomic_dec(ptr) __atomic_sub_fetch(ptr, 1, __ATOMIC_SEQ_CST)
#ifndef PIC
/* entry for static linking */
@@ -61,7 +64,7 @@ typedef struct _snd_pcm_meter {
struct list_head scopes;
int closed;
int running;
- atomic_t reset;
+ int reset;
pthread_t thread;
pthread_mutex_t update_mutex;
pthread_mutex_t running_mutex;
@@ -288,7 +291,7 @@ static int snd_pcm_meter_prepare(snd_pcm_t *pcm)
{
snd_pcm_meter_t *meter = pcm->private_data;
int err;
- atomic_inc(&meter->reset);
+ atomic_add(&meter->reset, 1);
err = snd_pcm_prepare(meter->gen.slave);
if (err >= 0) {
if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
diff --git a/src/pcm/pcm_multi.c b/src/pcm/pcm_multi.c
index f58852ca..a84e0ce4 100644
--- a/src/pcm/pcm_multi.c
+++ b/src/pcm/pcm_multi.c
@@ -555,6 +555,42 @@ static int snd_pcm_multi_channel_info(snd_pcm_t *pcm, snd_pcm_channel_info_t *in
return err;
}
+static snd_pcm_sframes_t snd_pcm_multi_rewindable(snd_pcm_t *pcm)
+{
+ snd_pcm_multi_t *multi = pcm->private_data;
+ unsigned int i;
+ snd_pcm_sframes_t frames = LONG_MAX;
+
+ for (i = 0; i < multi->slaves_count; ++i) {
+ snd_pcm_sframes_t f = snd_pcm_rewindable(multi->slaves[i].pcm);
+ if (f <= 0)
+ return f;
+ if (f < frames)
+ frames = f;
+ }
+
+ return frames;
+
+}
+
+static snd_pcm_sframes_t snd_pcm_multi_forwardable(snd_pcm_t *pcm)
+{
+ snd_pcm_multi_t *multi = pcm->private_data;
+ unsigned int i;
+ snd_pcm_sframes_t frames = LONG_MAX;
+
+ for (i = 0; i < multi->slaves_count; ++i) {
+ snd_pcm_sframes_t f = snd_pcm_forwardable(multi->slaves[i].pcm);
+ if (f <= 0)
+ return f;
+ if (f < frames)
+ frames = f;
+ }
+
+ return frames;
+
+}
+
static snd_pcm_sframes_t snd_pcm_multi_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
{
snd_pcm_multi_t *multi = pcm->private_data;
@@ -932,7 +968,9 @@ static const snd_pcm_fast_ops_t snd_pcm_multi_fast_ops = {
.writen = snd_pcm_mmap_writen,
.readi = snd_pcm_mmap_readi,
.readn = snd_pcm_mmap_readn,
+ .rewindable = snd_pcm_multi_rewindable,
.rewind = snd_pcm_multi_rewind,
+ .forwardable = snd_pcm_multi_forwardable,
.forward = snd_pcm_multi_forward,
.resume = snd_pcm_multi_resume,
.link = snd_pcm_multi_link,
diff --git a/src/pcm/pcm_null.c b/src/pcm/pcm_null.c
index a154a5cd..655261f7 100644
--- a/src/pcm/pcm_null.c
+++ b/src/pcm/pcm_null.c
@@ -80,6 +80,20 @@ static int snd_pcm_null_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
return 0;
}
+static snd_pcm_sframes_t snd_pcm_null_avail_update(snd_pcm_t *pcm)
+{
+ snd_pcm_null_t *null = pcm->private_data;
+ if (null->state == SND_PCM_STATE_PREPARED) {
+ /* it is required to return the correct avail count for */
+ /* the prepared stream, otherwise the start is not called */
+ if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
+ return snd_pcm_mmap_playback_avail(pcm);
+ else
+ return snd_pcm_mmap_capture_avail(pcm);
+ }
+ return pcm->buffer_size;
+}
+
static int snd_pcm_null_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
{
snd_pcm_null_t *null = pcm->private_data;
@@ -87,8 +101,8 @@ static int snd_pcm_null_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
status->state = null->state;
status->trigger_tstamp = null->trigger_tstamp;
gettimestamp(&status->tstamp, pcm->monotonic);
- status->avail = pcm->buffer_size;
- status->avail_max = status->avail;
+ status->avail = snd_pcm_null_avail_update(pcm);
+ status->avail_max = pcm->buffer_size;
return 0;
}
@@ -109,20 +123,18 @@ static int snd_pcm_null_delay(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_sframes_t
return 0;
}
-static int snd_pcm_null_prepare(snd_pcm_t *pcm)
+static int snd_pcm_null_reset(snd_pcm_t *pcm)
{
- snd_pcm_null_t *null = pcm->private_data;
- null->state = SND_PCM_STATE_PREPARED;
*pcm->appl.ptr = 0;
*pcm->hw.ptr = 0;
return 0;
}
-static int snd_pcm_null_reset(snd_pcm_t *pcm)
+static int snd_pcm_null_prepare(snd_pcm_t *pcm)
{
- *pcm->appl.ptr = 0;
- *pcm->hw.ptr = 0;
- return 0;
+ snd_pcm_null_t *null = pcm->private_data;
+ null->state = SND_PCM_STATE_PREPARED;
+ return snd_pcm_null_reset(pcm);
}
static int snd_pcm_null_start(snd_pcm_t *pcm)
@@ -168,6 +180,17 @@ static int snd_pcm_null_pause(snd_pcm_t *pcm, int enable)
return 0;
}
+static snd_pcm_sframes_t snd_pcm_null_rewindable(snd_pcm_t *pcm)
+{
+ return pcm->buffer_size;
+}
+
+static snd_pcm_sframes_t snd_pcm_null_forwardable(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+
static snd_pcm_sframes_t snd_pcm_null_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
{
snd_pcm_null_t *null = pcm->private_data;
@@ -240,11 +263,6 @@ static snd_pcm_sframes_t snd_pcm_null_mmap_commit(snd_pcm_t *pcm,
return snd_pcm_null_forward(pcm, size);
}
-static snd_pcm_sframes_t snd_pcm_null_avail_update(snd_pcm_t *pcm)
-{
- return pcm->buffer_size;
-}
-
static int snd_pcm_null_hw_refine(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_hw_params_t *params)
{
int err = snd_pcm_hw_refine_soft(pcm, params);
@@ -325,7 +343,9 @@ static const snd_pcm_fast_ops_t snd_pcm_null_fast_ops = {
.drop = snd_pcm_null_drop,
.drain = snd_pcm_null_drain,
.pause = snd_pcm_null_pause,
+ .rewindable = snd_pcm_null_rewindable,
.rewind = snd_pcm_null_rewind,
+ .forwardable = snd_pcm_null_forwardable,
.forward = snd_pcm_null_forward,
.resume = snd_pcm_null_resume,
.writei = snd_pcm_null_writei,
diff --git a/src/pcm/pcm_plug.c b/src/pcm/pcm_plug.c
index fa84eaac..7a6c2b99 100644
--- a/src/pcm/pcm_plug.c
+++ b/src/pcm/pcm_plug.c
@@ -53,7 +53,7 @@ typedef struct {
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;
+ int ttable_ok;
unsigned int tt_ssize, tt_cused, tt_sused;
} snd_pcm_plug_t;
@@ -380,7 +380,7 @@ static int snd_pcm_plug_change_channels(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm
snd_pcm_route_ttable_entry_t *ttable;
int err;
if (clt->channels == slv->channels &&
- (!plug->ttable || !plug->ttable_last))
+ (!plug->ttable || plug->ttable_ok))
return 0;
if (clt->rate != slv->rate &&
clt->channels > slv->channels)
@@ -485,13 +485,15 @@ static int snd_pcm_plug_change_format(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm_p
/* No conversion is needed */
if (clt->format == slv->format &&
clt->rate == slv->rate &&
- clt->channels == slv->channels)
+ clt->channels == slv->channels &&
+ (!plug->ttable || plug->ttable_ok))
return 0;
if (snd_pcm_format_linear(slv->format)) {
/* Conversion is done in another plugin */
if (clt->rate != slv->rate ||
- clt->channels != slv->channels)
+ clt->channels != slv->channels ||
+ (plug->ttable && !plug->ttable_ok))
return 0;
cfmt = clt->format;
switch (clt->format) {
@@ -522,15 +524,14 @@ static int snd_pcm_plug_change_format(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm_p
}
#ifdef BUILD_PCM_PLUGIN_LFLOAT
} else if (snd_pcm_format_float(slv->format)) {
- /* Conversion is done in another plugin */
- if (clt->format == slv->format &&
- clt->rate == slv->rate &&
- clt->channels == slv->channels)
- return 0;
- cfmt = clt->format;
- if (snd_pcm_format_linear(clt->format))
+ if (snd_pcm_format_linear(clt->format)) {
+ cfmt = clt->format;
f = snd_pcm_lfloat_open;
- else
+ } else if (clt->rate != slv->rate || clt->channels != slv->channels ||
+ (plug->ttable && !plug->ttable_ok)) {
+ cfmt = SND_PCM_FORMAT_S16;
+ f = snd_pcm_lfloat_open;
+ } else
return -EINVAL;
#endif
#ifdef BUILD_PCM_NONLINEAR
@@ -643,11 +644,12 @@ static int snd_pcm_plug_insert_plugins(snd_pcm_t *pcm,
};
snd_pcm_plug_params_t p = *slave;
unsigned int k = 0;
- plug->ttable_ok = plug->ttable_last = 0;
+ plug->ttable_ok = 0;
while (client->format != p.format ||
client->channels != p.channels ||
client->rate != p.rate ||
- client->access != p.access) {
+ client->access != p.access ||
+ (plug->ttable && !plug->ttable_ok)) {
snd_pcm_t *new;
int err;
if (k >= sizeof(funcs)/sizeof(*funcs))
@@ -662,24 +664,6 @@ static int snd_pcm_plug_insert_plugins(snd_pcm_t *pcm,
}
k++;
}
-#ifdef BUILD_PCM_PLUGIN_ROUTE
- /* it's exception, user specified ttable, but no reduction/expand */
- if (plug->ttable && !plug->ttable_ok) {
- snd_pcm_t *new;
- int err;
- plug->ttable_last = 1;
- err = snd_pcm_plug_change_channels(pcm, &new, client, &p);
- if (err < 0) {
- snd_pcm_plug_clear(pcm);
- return err;
- }
- assert(err);
- assert(plug->ttable_ok);
- plug->gen.slave = new;
- pcm->fast_ops = new->fast_ops;
- pcm->fast_op_arg = new->fast_op_arg;
- }
-#endif
return 0;
}
diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
index 17157e87..4ddf10c1 100644
--- a/src/pcm/pcm_plugin.c
+++ b/src/pcm/pcm_plugin.c
@@ -201,7 +201,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewindable(snd_pcm_t *pcm)
return snd_pcm_mmap_hw_avail(pcm);
}
-static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
+snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
{
snd_pcm_plugin_t *plugin = pcm->private_data;
snd_pcm_sframes_t n = snd_pcm_mmap_hw_avail(pcm);
@@ -229,7 +229,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_forwardable(snd_pcm_t *pcm)
return snd_pcm_mmap_avail(pcm);
}
-static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
+snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
{
snd_pcm_plugin_t *plugin = pcm->private_data;
snd_pcm_sframes_t n = snd_pcm_mmap_avail(pcm);
diff --git a/src/pcm/pcm_plugin.h b/src/pcm/pcm_plugin.h
index 7ee7c7f7..19e82c3e 100644
--- a/src/pcm/pcm_plugin.h
+++ b/src/pcm/pcm_plugin.h
@@ -58,8 +58,14 @@ typedef struct {
snd1_pcm_plugin_undo_read_generic
#define snd_pcm_plugin_undo_write_generic \
snd1_pcm_plugin_undo_write_generic
+#define snd_pcm_plugin_rewind \
+ snd1_pcm_plugin_rewind
+#define snd_pcm_plugin_forward \
+ snd1_pcm_plugin_forward
void snd_pcm_plugin_init(snd_pcm_plugin_t *plugin);
+snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
+snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
extern const snd_pcm_fast_ops_t snd_pcm_plugin_fast_ops;
diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
index 54a3e670..7f667d4c 100644
--- a/src/pcm/pcm_rate.c
+++ b/src/pcm/pcm_rate.c
@@ -561,58 +561,6 @@ snd_pcm_rate_read_areas1(snd_pcm_t *pcm,
pcm->channels, rate);
}
-static inline snd_pcm_sframes_t snd_pcm_rate_move_applptr(snd_pcm_t *pcm, snd_pcm_sframes_t frames)
-{
- snd_pcm_rate_t *rate = pcm->private_data;
- snd_pcm_uframes_t orig_appl_ptr, appl_ptr = rate->appl_ptr, slave_appl_ptr;
- snd_pcm_sframes_t diff, ndiff;
- snd_pcm_t *slave = rate->gen.slave;
-
- orig_appl_ptr = rate->appl_ptr;
- if (frames > 0)
- snd_pcm_mmap_appl_forward(pcm, frames);
- else
- snd_pcm_mmap_appl_backward(pcm, -frames);
- slave_appl_ptr =
- (appl_ptr / pcm->period_size) * rate->gen.slave->period_size;
- diff = slave_appl_ptr - *slave->appl.ptr;
- if (diff < -(snd_pcm_sframes_t)(slave->boundary / 2)) {
- diff = (slave->boundary - *slave->appl.ptr) + slave_appl_ptr;
- } else if (diff > (snd_pcm_sframes_t)(slave->boundary / 2)) {
- diff = -((slave->boundary - slave_appl_ptr) + *slave->appl.ptr);
- }
- if (diff == 0)
- return frames;
- if (diff > 0) {
- ndiff = snd_pcm_forward(rate->gen.slave, diff);
- } else {
- ndiff = snd_pcm_rewind(rate->gen.slave, diff);
- }
- if (ndiff < 0)
- return diff;
- slave_appl_ptr = *slave->appl.ptr;
- rate->appl_ptr =
- (slave_appl_ptr / rate->gen.slave->period_size) * pcm->period_size +
- orig_appl_ptr % pcm->period_size;
- if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
- rate->appl_ptr += rate->ops.input_frames(rate->obj, slave_appl_ptr % rate->gen.slave->period_size);
- else
- rate->appl_ptr += rate->ops.output_frames(rate->obj, slave_appl_ptr % rate->gen.slave->period_size);
-
- diff = orig_appl_ptr - rate->appl_ptr;
- if (diff < -(snd_pcm_sframes_t)(slave->boundary / 2)) {
- diff = (slave->boundary - rate->appl_ptr) + orig_appl_ptr;
- } else if (diff > (snd_pcm_sframes_t)(slave->boundary / 2)) {
- diff = -((slave->boundary - orig_appl_ptr) + rate->appl_ptr);
- }
- if (frames < 0)
- diff = -diff;
-
- rate->last_commit_ptr = rate->appl_ptr - rate->appl_ptr % pcm->period_size;
-
- return diff;
-}
-
static inline void snd_pcm_rate_sync_hwptr(snd_pcm_t *pcm)
{
snd_pcm_rate_t *rate = pcm->private_data;
@@ -689,36 +637,26 @@ static int snd_pcm_rate_reset(snd_pcm_t *pcm)
return 0;
}
-static snd_pcm_sframes_t snd_pcm_rate_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
+static snd_pcm_sframes_t snd_pcm_rate_rewindable(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
{
- snd_pcm_rate_t *rate = pcm->private_data;
- snd_pcm_sframes_t n = snd_pcm_mmap_hw_avail(pcm);
+ return 0;
+}
- if ((snd_pcm_uframes_t)n > frames)
- frames = n;
- if (frames == 0)
- return 0;
-
- snd_atomic_write_begin(&rate->watom);
- n = snd_pcm_rate_move_applptr(pcm, -frames);
- snd_atomic_write_end(&rate->watom);
- return n;
+static snd_pcm_sframes_t snd_pcm_rate_forwardable(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
+{
+ return 0;
}
-static snd_pcm_sframes_t snd_pcm_rate_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
+static snd_pcm_sframes_t snd_pcm_rate_rewind(snd_pcm_t *pcm ATTRIBUTE_UNUSED,
+ snd_pcm_uframes_t frames ATTRIBUTE_UNUSED)
{
- snd_pcm_rate_t *rate = pcm->private_data;
- snd_pcm_sframes_t n = snd_pcm_mmap_avail(pcm);
+ return 0;
+}
- if ((snd_pcm_uframes_t)n > frames)
- frames = n;
- if (frames == 0)
- return 0;
-
- snd_atomic_write_begin(&rate->watom);
- n = snd_pcm_rate_move_applptr(pcm, frames);
- snd_atomic_write_end(&rate->watom);
- return n;
+static snd_pcm_sframes_t snd_pcm_rate_forward(snd_pcm_t *pcm ATTRIBUTE_UNUSED,
+ snd_pcm_uframes_t frames ATTRIBUTE_UNUSED)
+{
+ return 0;
}
static int snd_pcm_rate_commit_area(snd_pcm_t *pcm, snd_pcm_rate_t *rate,
@@ -1221,7 +1159,9 @@ static const snd_pcm_fast_ops_t snd_pcm_rate_fast_ops = {
.drop = snd_pcm_generic_drop,
.drain = snd_pcm_rate_drain,
.pause = snd_pcm_generic_pause,
+ .rewindable = snd_pcm_rate_rewindable,
.rewind = snd_pcm_rate_rewind,
+ .forwardable = snd_pcm_rate_forwardable,
.forward = snd_pcm_rate_forward,
.resume = snd_pcm_generic_resume,
.writei = snd_pcm_mmap_writei,
diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c
index 2beedf68..751e36f2 100644
--- a/src/pcm/pcm_route.c
+++ b/src/pcm/pcm_route.c
@@ -103,6 +103,7 @@ typedef struct {
snd_pcm_format_t sformat;
int schannels;
snd_pcm_route_params_t params;
+ snd_pcm_chmap_t *chmap;
} snd_pcm_route_t;
#endif /* DOC_HIDDEN */
@@ -518,6 +519,7 @@ static int snd_pcm_route_close(snd_pcm_t *pcm)
}
free(params->dsts);
}
+ free(route->chmap);
return snd_pcm_generic_close(pcm);
}
@@ -789,6 +791,193 @@ static void snd_pcm_route_dump(snd_pcm_t *pcm, snd_output_t *out)
snd_pcm_dump(route->plug.gen.slave, out);
}
+/*
+ * Converts a string to an array of channel indices:
+ * - Given a number, the result is an array with one element,
+ * containing that number
+ * - Given a channel name (e g "FL") and a chmap,
+ * it will look this up in the chmap and return all matches
+ * - Given a channel name and no chmap, the result is an array with one element,
+ containing alsa standard channel map. Note that this might be a negative
+ number in case of "UNKNOWN", "NA" or "MONO".
+ * Return value is number of matches written.
+ */
+static int strtochannel(const char *id, snd_pcm_chmap_t *chmap,
+ long *channel, int channel_size)
+{
+ int ch;
+ if (safe_strtol(id, channel) >= 0)
+ return 1;
+
+ ch = (int) snd_pcm_chmap_from_string(id);
+ if (ch == -1)
+ return -EINVAL;
+
+ if (chmap) {
+ int i, r = 0;
+ /* Start with highest channel to simplify implementation of
+ determine ttable size */
+ for (i = chmap->channels - 1; i >= 0; i--) {
+ if ((int) chmap->pos[i] != ch)
+ continue;
+ if (r >= channel_size)
+ continue;
+ channel[r++] = i;
+ }
+ return r;
+ }
+ else {
+ /* Assume ALSA standard channel mapping */
+ *channel = ch - SND_CHMAP_FL;
+ return 1;
+ }
+}
+
+#define MAX_CHMAP_CHANNELS 256
+
+static int determine_chmap(snd_config_t *tt, snd_pcm_chmap_t **tt_chmap)
+{
+ snd_config_iterator_t i, inext;
+ snd_pcm_chmap_t *chmap;
+
+ assert(tt && tt_chmap);
+ chmap = malloc(sizeof(snd_pcm_chmap_t) +
+ MAX_CHMAP_CHANNELS * sizeof(unsigned int));
+
+ chmap->channels = 0;
+ snd_config_for_each(i, inext, tt) {
+ const char *id;
+ snd_config_iterator_t j, jnext;
+ snd_config_t *in = snd_config_iterator_entry(i);
+
+ if (!snd_config_get_id(in, &id) < 0)
+ continue;
+ if (snd_config_get_type(in) != SND_CONFIG_TYPE_COMPOUND)
+ goto err;
+ snd_config_for_each(j, jnext, in) {
+ int ch, k, found;
+ long schannel;
+ snd_config_t *jnode = snd_config_iterator_entry(j);
+ if (snd_config_get_id(jnode, &id) < 0)
+ continue;
+ if (safe_strtol(id, &schannel) >= 0)
+ continue;
+ ch = (int) snd_pcm_chmap_from_string(id);
+ if (ch == -1)
+ goto err;
+
+ found = 0;
+ for (k = 0; k < (int) chmap->channels; k++)
+ if (ch == (int) chmap->pos[k]) {
+ found = 1;
+ break;
+ }
+ if (found)
+ continue;
+
+ if (chmap->channels >= MAX_CHMAP_CHANNELS) {
+ SNDERR("Too many channels in ttable chmap");
+ goto err;
+ }
+ chmap->pos[chmap->channels++] = ch;
+ }
+ }
+
+ if (chmap->channels == 0) {
+ free(chmap);
+ chmap = NULL;
+ }
+ *tt_chmap = chmap;
+ return 0;
+
+err:
+ *tt_chmap = NULL;
+ free(chmap);
+ return -EINVAL;
+}
+
+static int find_matching_chmap(snd_pcm_t *spcm, snd_pcm_chmap_t *tt_chmap,
+ snd_pcm_chmap_t **found_chmap, int *schannels)
+{
+ snd_pcm_chmap_query_t** chmaps = snd_pcm_query_chmaps(spcm);
+ int i;
+
+ *found_chmap = NULL;
+
+ if (chmaps == NULL)
+ return 0; /* chmap API not supported for this slave */
+
+ for (i = 0; chmaps[i]; i++) {
+ unsigned int j, k;
+ int match = 1;
+ snd_pcm_chmap_t *c = &chmaps[i]->map;
+ if (*schannels >= 0 && (int) c->channels != *schannels)
+ continue;
+
+ for (j = 0; j < tt_chmap->channels; j++) {
+ int found = 0;
+ unsigned int ch = tt_chmap->pos[j];
+ for (k = 0; k < c->channels; k++)
+ if (c->pos[k] == ch) {
+ found = 1;
+ break;
+ }
+ if (!found) {
+ match = 0;
+ break;
+ }
+ }
+
+ if (match) {
+ int size = sizeof(snd_pcm_chmap_t) + c->channels * sizeof(unsigned int);
+ *found_chmap = malloc(size);
+ if (!*found_chmap) {
+ snd_pcm_free_chmaps(chmaps);
+ return -ENOMEM;
+ }
+ memcpy(*found_chmap, c, size);
+ *schannels = c->channels;
+ break;
+ }
+ }
+
+ snd_pcm_free_chmaps(chmaps);
+
+ if (*found_chmap == NULL) {
+ SNDERR("Found no matching channel map");
+ return -EINVAL;
+ }
+ return 0;
+}
+
+static int route_chmap_init(snd_pcm_t *pcm)
+{
+ int set_map = 0;
+ snd_pcm_chmap_t *current;
+ snd_pcm_route_t *route = pcm->private_data;
+ if (!route->chmap)
+ return 0;
+ if (snd_pcm_state(pcm) != SND_PCM_STATE_PREPARED)
+ return 0;
+
+ /* Check if we really need to set the chmap or not.
+ This is important in case set_chmap is not implemented. */
+ current = snd_pcm_get_chmap(route->plug.gen.slave);
+ if (!current)
+ return -ENOSYS;
+ if (current->channels != route->chmap->channels)
+ set_map = 1;
+ else
+ set_map = memcmp(current->pos, route->chmap->pos,
+ current->channels);
+ free(current);
+ if (!set_map)
+ return 0;
+
+ return snd_pcm_set_chmap(route->plug.gen.slave, route->chmap);
+}
+
+
static const snd_pcm_ops_t snd_pcm_route_ops = {
.close = snd_pcm_route_close,
.info = snd_pcm_generic_info,
@@ -921,6 +1110,7 @@ int snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
route->plug.undo_write = snd_pcm_plugin_undo_write_generic;
route->plug.gen.slave = slave;
route->plug.gen.close_slave = close_slave;
+ route->plug.init = route_chmap_init;
err = snd_pcm_new(&pcm, SND_PCM_TYPE_ROUTE, name, slave->stream, slave->mode);
if (err < 0) {
@@ -945,16 +1135,10 @@ int snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
return 0;
}
-/**
- * \brief Determine route matrix sizes
- * \param tt Configuration root describing route matrix
- * \param tt_csize Returned client size in elements
- * \param tt_ssize Returned slave size in elements
- * \retval zero on success otherwise a negative error code
- */
-int snd_pcm_route_determine_ttable(snd_config_t *tt,
- unsigned int *tt_csize,
- unsigned int *tt_ssize)
+static int _snd_pcm_route_determine_ttable(snd_config_t *tt,
+ unsigned int *tt_csize,
+ unsigned int *tt_ssize,
+ snd_pcm_chmap_t *chmap)
{
snd_config_iterator_t i, inext;
long csize = 0, ssize = 0;
@@ -983,7 +1167,7 @@ int snd_pcm_route_determine_ttable(snd_config_t *tt,
const char *id;
if (snd_config_get_id(jnode, &id) < 0)
continue;
- err = safe_strtol(id, &schannel);
+ err = strtochannel(id, chmap, &schannel, 1);
if (err < 0) {
SNDERR("Invalid slave channel: %s", id);
return -EINVAL;
@@ -1002,6 +1186,20 @@ int snd_pcm_route_determine_ttable(snd_config_t *tt,
}
/**
+ * \brief Determine route matrix sizes
+ * \param tt Configuration root describing route matrix
+ * \param tt_csize Returned client size in elements
+ * \param tt_ssize Returned slave size in elements
+ * \retval zero on success otherwise a negative error code
+ */
+int snd_pcm_route_determine_ttable(snd_config_t *tt,
+ unsigned int *tt_csize,
+ unsigned int *tt_ssize)
+{
+ return _snd_pcm_route_determine_ttable(tt, tt_csize, tt_ssize, NULL);
+}
+
+/**
* \brief Load route matrix
* \param tt Configuration root describing route matrix
* \param ttable Returned route matrix
@@ -1012,10 +1210,10 @@ int snd_pcm_route_determine_ttable(snd_config_t *tt,
* \param schannels Slave channels
* \retval zero on success otherwise a negative error code
*/
-int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *ttable,
- unsigned int tt_csize, unsigned int tt_ssize,
- unsigned int *tt_cused, unsigned int *tt_sused,
- int schannels)
+static int _snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *ttable,
+ unsigned int tt_csize, unsigned int tt_ssize,
+ unsigned int *tt_cused, unsigned int *tt_sused,
+ int schannels, snd_pcm_chmap_t *chmap)
{
int cused = -1;
int sused = -1;
@@ -1042,17 +1240,18 @@ int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *tt
snd_config_for_each(j, jnext, in) {
snd_config_t *jnode = snd_config_iterator_entry(j);
double value;
- long schannel;
+ int ss;
+ long *scha = alloca(tt_ssize * sizeof(long));
const char *id;
if (snd_config_get_id(jnode, &id) < 0)
continue;
- err = safe_strtol(id, &schannel);
- if (err < 0 ||
- schannel < 0 || (unsigned int) schannel > tt_ssize ||
- (schannels > 0 && schannel >= schannels)) {
+
+ ss = strtochannel(id, chmap, scha, tt_ssize);
+ if (ss < 0) {
SNDERR("Invalid slave channel: %s", id);
return -EINVAL;
}
+
err = snd_config_get_real(jnode, &value);
if (err < 0) {
long v;
@@ -1063,9 +1262,18 @@ int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *tt
}
value = v;
}
- ttable[cchannel * tt_ssize + schannel] = value;
- if (schannel > sused)
- sused = schannel;
+
+ for (k = 0; (int) k < ss; k++) {
+ long schannel = scha[k];
+ if (schannel < 0 || (unsigned int) schannel > tt_ssize ||
+ (schannels > 0 && schannel >= schannels)) {
+ SNDERR("Invalid slave channel: %s", id);
+ return -EINVAL;
+ }
+ ttable[cchannel * tt_ssize + schannel] = value;
+ if (schannel > sused)
+ sused = schannel;
+ }
}
if (cchannel > cused)
cused = cchannel;
@@ -1075,6 +1283,26 @@ int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *tt
return 0;
}
+/**
+ * \brief Load route matrix
+ * \param tt Configuration root describing route matrix
+ * \param ttable Returned route matrix
+ * \param tt_csize Client size in elements
+ * \param tt_ssize Slave size in elements
+ * \param tt_cused Used client elements
+ * \param tt_sused Used slave elements
+ * \param schannels Slave channels
+ * \retval zero on success otherwise a negative error code
+ */
+int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *ttable,
+ unsigned int tt_csize, unsigned int tt_ssize,
+ unsigned int *tt_cused, unsigned int *tt_sused,
+ int schannels)
+{
+ return _snd_pcm_route_load_ttable(tt, ttable, tt_csize, tt_ssize,
+ tt_cused, tt_sused, schannels, NULL);
+}
+
/*! \page pcm_plugins
\section pcm_plugins_route Plugin: Route & Volume
@@ -1082,6 +1310,9 @@ int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *tt
This plugin converts channels and applies volume during the conversion.
The format and rate must match for both of them.
+SCHANNEL can be a channel name instead of a number (e g FL, LFE).
+If so, a matching channel map will be selected for the slave.
+
\code
pcm.name {
type route # Route & Volume conversion PCM
@@ -1132,6 +1363,7 @@ int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
int err;
snd_pcm_t *spcm;
snd_config_t *slave = NULL, *sconf;
+ snd_pcm_chmap_t *tt_chmap = NULL, *chmap = NULL;
snd_pcm_format_t sformat = SND_PCM_FORMAT_UNKNOWN;
int schannels = -1;
snd_config_t *tt = NULL;
@@ -1180,37 +1412,62 @@ int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
return -EINVAL;
}
- err = snd_pcm_route_determine_ttable(tt, &csize, &ssize);
+ err = determine_chmap(tt, &tt_chmap);
if (err < 0) {
- snd_config_delete(sconf);
+ free(ttable);
return err;
}
- ttable = malloc(csize * ssize * sizeof(snd_pcm_route_ttable_entry_t));
- if (ttable == NULL) {
- snd_config_delete(sconf);
- return -ENOMEM;
- }
- err = snd_pcm_route_load_ttable(tt, ttable, csize, ssize,
- &cused, &sused, schannels);
+
+ err = snd_pcm_open_slave(&spcm, root, sconf, stream, mode, conf);
+ snd_config_delete(sconf);
if (err < 0) {
+ free(tt_chmap);
free(ttable);
- snd_config_delete(sconf);
return err;
}
- err = snd_pcm_open_slave(&spcm, root, sconf, stream, mode, conf);
- snd_config_delete(sconf);
+ if (tt_chmap) {
+ err = find_matching_chmap(spcm, tt_chmap, &chmap, &schannels);
+ free(tt_chmap);
+ if (err < 0) {
+ snd_pcm_close(spcm);
+ return err;
+ }
+ }
+
+ err = _snd_pcm_route_determine_ttable(tt, &csize, &ssize, chmap);
if (err < 0) {
+ free(chmap);
+ snd_pcm_close(spcm);
+ return err;
+ }
+ ttable = malloc(csize * ssize * sizeof(snd_pcm_route_ttable_entry_t));
+ if (ttable == NULL) {
+ free(chmap);
+ snd_pcm_close(spcm);
+ return -ENOMEM;
+ }
+ err = _snd_pcm_route_load_ttable(tt, ttable, csize, ssize,
+ &cused, &sused, schannels, chmap);
+ if (err < 0) {
+ free(chmap);
free(ttable);
+ snd_pcm_close(spcm);
return err;
}
+
err = snd_pcm_route_open(pcmp, name, sformat, schannels,
ttable, ssize,
cused, sused,
spcm, 1);
free(ttable);
- if (err < 0)
+ if (err < 0) {
+ free(chmap);
snd_pcm_close(spcm);
+ } else {
+ ((snd_pcm_route_t*) (*pcmp)->private_data)->chmap = chmap;
+ }
+
return err;
}
#ifndef DOC_HIDDEN
diff --git a/src/pcm/scopes/Makefile.in b/src/pcm/scopes/Makefile.in
index 469dbb58..8403e0d6 100644
--- a/src/pcm/scopes/Makefile.in
+++ b/src/pcm/scopes/Makefile.in
@@ -54,7 +54,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/src/rawmidi/Makefile.am b/src/rawmidi/Makefile.am
index 2470c7ad..41858a1f 100644
--- a/src/rawmidi/Makefile.am
+++ b/src/rawmidi/Makefile.am
@@ -9,4 +9,4 @@ noinst_HEADERS = rawmidi_local.h
all: librawmidi.la
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
diff --git a/src/rawmidi/Makefile.in b/src/rawmidi/Makefile.in
index 904d00f2..4155627b 100644
--- a/src/rawmidi/Makefile.in
+++ b/src/rawmidi/Makefile.in
@@ -56,7 +56,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -251,7 +251,7 @@ EXTRA_LTLIBRARIES = librawmidi.la
librawmidi_la_SOURCES = rawmidi.c rawmidi_hw.c rawmidi_symbols.c \
$(am__append_1)
noinst_HEADERS = rawmidi_local.h
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
all: all-am
.SUFFIXES:
diff --git a/src/seq/Makefile.am b/src/seq/Makefile.am
index 1ea92f02..6cefe397 100644
--- a/src/seq/Makefile.am
+++ b/src/seq/Makefile.am
@@ -10,4 +10,4 @@ noinst_HEADERS = seq_local.h
all: libseq.la
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
diff --git a/src/seq/Makefile.in b/src/seq/Makefile.in
index f62c960f..37f241f4 100644
--- a/src/seq/Makefile.in
+++ b/src/seq/Makefile.in
@@ -56,7 +56,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -251,7 +251,7 @@ EXTRA_LTLIBRARIES = libseq.la
libseq_la_SOURCES = seq_hw.c seq.c seq_event.c seqmid.c \
seq_midi_event.c seq_symbols.c $(am__append_1)
noinst_HEADERS = seq_local.h
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
all: all-am
.SUFFIXES:
diff --git a/src/timer/Makefile.am b/src/timer/Makefile.am
index e7cf77b6..7cfbe455 100644
--- a/src/timer/Makefile.am
+++ b/src/timer/Makefile.am
@@ -6,4 +6,4 @@ noinst_HEADERS = timer_local.h
all: libtimer.la
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
diff --git a/src/timer/Makefile.in b/src/timer/Makefile.in
index 3d9ad998..8bca1ca2 100644
--- a/src/timer/Makefile.in
+++ b/src/timer/Makefile.in
@@ -55,7 +55,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -248,7 +248,7 @@ libtimer_la_SOURCES = timer.c timer_hw.c timer_query.c timer_query_hw.c \
timer_symbols.c
noinst_HEADERS = timer_local.h
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
all: all-am
.SUFFIXES:
diff --git a/src/ucm/Makefile.am b/src/ucm/Makefile.am
index 7435d903..9d66b244 100644
--- a/src/ucm/Makefile.am
+++ b/src/ucm/Makefile.am
@@ -7,4 +7,4 @@ noinst_HEADERS = ucm_local.h
all: libucm.la
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
diff --git a/src/ucm/Makefile.in b/src/ucm/Makefile.in
index b4e5f618..ba65aa5c 100644
--- a/src/ucm/Makefile.in
+++ b/src/ucm/Makefile.in
@@ -55,7 +55,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -245,7 +245,7 @@ top_srcdir = @top_srcdir@
EXTRA_LTLIBRARIES = libucm.la
libucm_la_SOURCES = utils.c parser.c main.c
noinst_HEADERS = ucm_local.h
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
all: all-am
.SUFFIXES:
diff --git a/test/Makefile.am b/test/Makefile.am
index 87054021..ce6e521d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -7,8 +7,10 @@ check_PROGRAMS=control pcm pcm_min latency seq \
control_LDADD=../src/libasound.la
pcm_LDADD=../src/libasound.la
+pcm_LDFLAGS= -lm
pcm_min_LDADD=../src/libasound.la
latency_LDADD=../src/libasound.la
+latency_LDFLAGS= -lm
seq_LDADD=../src/libasound.la
playmidi1_LDADD=../src/libasound.la
timer_LDADD=../src/libasound.la
@@ -22,7 +24,7 @@ code_CFLAGS=-Wall -pipe -g -O2
chmap_LDADD=../src/libasound.la
audio_time_LDADD=../src/libasound.la
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
AM_CFLAGS=-Wall -pipe -g
EXTRA_DIST=seq-decoder.c seq-sender.c midifile.h midifile.c midifile.3
diff --git a/test/Makefile.in b/test/Makefile.in
index ffc8de35..904624ee 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -60,7 +60,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -86,6 +86,9 @@ control_DEPENDENCIES = ../src/libasound.la
latency_SOURCES = latency.c
latency_OBJECTS = latency.$(OBJEXT)
latency_DEPENDENCIES = ../src/libasound.la
+latency_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(latency_LDFLAGS) $(LDFLAGS) -o $@
midiloop_SOURCES = midiloop.c
midiloop_OBJECTS = midiloop.$(OBJEXT)
midiloop_DEPENDENCIES = ../src/libasound.la
@@ -98,6 +101,9 @@ oldapi_DEPENDENCIES = ../src/libasound.la
pcm_SOURCES = pcm.c
pcm_OBJECTS = pcm.$(OBJEXT)
pcm_DEPENDENCIES = ../src/libasound.la
+pcm_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(pcm_LDFLAGS) $(LDFLAGS) -o $@
pcm_min_SOURCES = pcm_min.c
pcm_min_OBJECTS = pcm_min.$(OBJEXT)
pcm_min_DEPENDENCIES = ../src/libasound.la
@@ -333,8 +339,10 @@ top_srcdir = @top_srcdir@
SUBDIRS = . lsb
control_LDADD = ../src/libasound.la
pcm_LDADD = ../src/libasound.la
+pcm_LDFLAGS = -lm
pcm_min_LDADD = ../src/libasound.la
latency_LDADD = ../src/libasound.la
+latency_LDFLAGS = -lm
seq_LDADD = ../src/libasound.la
playmidi1_LDADD = ../src/libasound.la
timer_LDADD = ../src/libasound.la
@@ -347,7 +355,7 @@ client_event_filter_LDADD = ../src/libasound.la
code_CFLAGS = -Wall -pipe -g -O2
chmap_LDADD = ../src/libasound.la
audio_time_LDADD = ../src/libasound.la
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CFLAGS = -Wall -pipe -g
EXTRA_DIST = seq-decoder.c seq-sender.c midifile.h midifile.c midifile.3
all: all-recursive
@@ -407,7 +415,7 @@ control$(EXEEXT): $(control_OBJECTS) $(control_DEPENDENCIES) $(EXTRA_control_DEP
$(AM_V_CCLD)$(LINK) $(control_OBJECTS) $(control_LDADD) $(LIBS)
latency$(EXEEXT): $(latency_OBJECTS) $(latency_DEPENDENCIES) $(EXTRA_latency_DEPENDENCIES)
@rm -f latency$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(latency_OBJECTS) $(latency_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(latency_LINK) $(latency_OBJECTS) $(latency_LDADD) $(LIBS)
midiloop$(EXEEXT): $(midiloop_OBJECTS) $(midiloop_DEPENDENCIES) $(EXTRA_midiloop_DEPENDENCIES)
@rm -f midiloop$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(midiloop_OBJECTS) $(midiloop_LDADD) $(LIBS)
@@ -419,7 +427,7 @@ oldapi$(EXEEXT): $(oldapi_OBJECTS) $(oldapi_DEPENDENCIES) $(EXTRA_oldapi_DEPENDE
$(AM_V_CCLD)$(LINK) $(oldapi_OBJECTS) $(oldapi_LDADD) $(LIBS)
pcm$(EXEEXT): $(pcm_OBJECTS) $(pcm_DEPENDENCIES) $(EXTRA_pcm_DEPENDENCIES)
@rm -f pcm$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(pcm_OBJECTS) $(pcm_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(pcm_LINK) $(pcm_OBJECTS) $(pcm_LDADD) $(LIBS)
pcm_min$(EXEEXT): $(pcm_min_OBJECTS) $(pcm_min_DEPENDENCIES) $(EXTRA_pcm_min_DEPENDENCIES)
@rm -f pcm_min$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(pcm_min_OBJECTS) $(pcm_min_LDADD) $(LIBS)
diff --git a/test/chmap.c b/test/chmap.c
index d73ae736..ad3b305b 100644
--- a/test/chmap.c
+++ b/test/chmap.c
@@ -16,6 +16,7 @@ static void usage(void)
" chmap [options] set CH0 CH1 CH2...\n"
"options:\n"
" -D device Specify PCM device to handle\n"
+ " -s stream Specify PCM stream direction (playback/capture)\n"
" -f format PCM format\n"
" -c channels Channels\n"
" -r rate Sample rate\n");
diff --git a/test/lsb/Makefile.in b/test/lsb/Makefile.in
index a842d57d..bf70c020 100644
--- a/test/lsb/Makefile.in
+++ b/test/lsb/Makefile.in
@@ -57,7 +57,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 447d5251..7220c020 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -11,4 +11,4 @@ pkgconfig_DATA = alsa.pc
rpm: buildrpm alsa-lib.spec
VERSION=$(VERSION) $(srcdir)/buildrpm
-INCLUDES=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include
diff --git a/utils/Makefile.in b/utils/Makefile.in
index 39aa921c..a6a4de0e 100644
--- a/utils/Makefile.in
+++ b/utils/Makefile.in
@@ -55,7 +55,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/alsa-lib.spec.in $(srcdir)/alsa.pc.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -246,7 +246,7 @@ EXTRA_DIST = alsa.m4 buildrpm alsa.pc.in
alsapkgconfdir = @ALSA_PKGCONF_DIR@
pkgconfigdir = $(alsapkgconfdir)
pkgconfig_DATA = alsa.pc
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
all: all-am
.SUFFIXES:
diff --git a/version b/version
index 6ce29adf..8b544095 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-1.0.27.2
+1.0.28