diff options
author | Jordi Mallach <jordi@debian.org> | 2014-07-05 00:04:47 +0100 |
---|---|---|
committer | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2014-10-03 14:24:26 +0000 |
commit | 59ad6f12ba388e635b54dffda96f1bbe34a7f71f (patch) | |
tree | ceb09916669c4fd7a29cbc3d8f1b62d408a8030c | |
parent | 2404711f484e770896f5f17acc79e0a3383853db (diff) | |
parent | ce044e34dc846856d91f6023e4074dd3f4ab8816 (diff) |
Imported Debian patch 1.0.28-1HEADdebian/1.0.28-1master
142 files changed, 3381 insertions, 2334 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: @@ -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/debian/changelog b/debian/changelog index 9bc1d298..95dfae25 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,30 @@ +alsa-lib (1.0.28-1) unstable; urgency=medium + + [ Luke Yelavich ] + * New upstream release + * Dropped patches, applied upstream: + - tests_lm_ftbfs.patch + - Fix-access-of-freed-memory-in-namehints.patch + * Refreshed patches: + - 0001-Add-UCM-configuration-for-Nexus-4-Mako.patch + - 0002-Add-UCM-config-file-for-Galaxy-Nexus-maguro.patch + - 0003-Add-UCM-files-for-Nexus-7.patch + - 0004-Add-UCM-config-files-for-Nexus-10.patch + + -- Jordi Mallach <jordi@debian.org> Sat, 05 Jul 2014 00:04:47 +0100 + +alsa-lib (1.0.27.2-4) unstable; urgency=medium + + * Merge all pending delta from Ubuntu: + - Add a compile/run autopkg test + - Add UCM profiles for Nexus 7 (2012), Nexus 10, Nexus 4 and Galaxy Nexus + - Add config file for the tegra alc5632 chip found in the AC100 netbook + - Add hints for non-standard devices that lack configuration files + * Rename the autopkg test to build-seq, to make lintian happy. + * Bump Standards-Version to 3.9.5. + + -- Jordi Mallach <jordi@debian.org> Wed, 14 May 2014 10:20:01 +0200 + alsa-lib (1.0.27.2-3) unstable; urgency=low * Add preinst scripts to -dbg and -dev packages to correctly @@ -597,7 +624,7 @@ alsa-lib (1.0.14-1) unstable; urgency=low * Patch management switched to quilt. This is more comfortable. [ Jordi Mallach ] - * Bump shlibs to 1.0.14, as new symbols have been added. + * Bump shlibs to 1.0.14, as new symbols have been added. -- Jordi Mallach <jordi@debian.org> Sat, 09 Jun 2007 19:17:41 +0200 @@ -608,7 +635,7 @@ alsa-lib (1.0.14~rc4-2) experimental; urgency=low - add XS-Vcs-Browser and XS-Vcs-Svn headers. - Build-Depend on gcc-multilib only on the available architectures (thanks Frank Lichtenheld; closes: #424310). - + -- Jordi Mallach <jordi@debian.org> Thu, 17 May 2007 01:44:35 +0200 alsa-lib (1.0.14~rc4-1) experimental; urgency=low @@ -916,7 +943,7 @@ alsa-lib (1.0.8-1) unstable; urgency=low - examples/asound.conf_dmix + Simplify + Mention /usr/share/doc/libasound2-doc/html/conf.html - - debian/rules + - debian/rules + Eliminate debian/libasound2.shlibs; instead, use dh_makeshibs -V'libasound2 (>> 1.0.8)' (Version bumped up from 1.0.5) @@ -1294,7 +1321,7 @@ alsa-lib (0.9.0rc7-2) unstable; urgency=low * debian/libasound2.install: install lib, aserver and alsa config files. * debian/libasound2-dev.install: install development, aclocal and pkgconfig files (closes: #181589). - + -- Jordi Mallach <jordi@debian.org> Wed, 19 Feb 2003 10:55:49 +0100 alsa-lib (0.9.0rc7-1) unstable; urgency=low @@ -1381,7 +1408,7 @@ alsa-lib (0.9.0rc3-0.1) unstable; urgency=low * Non-Maintainer Upload. Nearly all the work was done by Bastian Kleineidam <calvin@debian.org>. * New upstream release. - * New upstream has updated iatomic.h for mips + * New upstream has updated iatomic.h for mips (closes: #149159, #145016). * Removed unnecessary powerpc patch. * Removed libtool hack (dont know why this was there). @@ -1440,7 +1467,7 @@ alsa-lib (0.9.0beta7-1.1) unstable; urgency=low * Non-maintainer upload * Avoid use of functions from <asm/atomic.h> on ARM and SPARC. - (Closes: #97988) + (Closes: #97988) -- Phil Blundell <pb@debian.org> Thu, 22 Nov 2001 13:56:50 +0000 @@ -1527,7 +1554,7 @@ alsa-lib (0.5.7-2) unstable; urgency=low * Updated dependency info. (closes: #62011) * Removed minor dependencies for alsa-base of libasound1. - + -- Masato Taruishi <taru@debian.org> Sun, 9 Apr 2000 01:23:23 +0900 alsa-lib (0.5.7-1) unstable; urgency=low @@ -1657,7 +1684,7 @@ alsalib (0.3.0-pre2-2) unstable; urgency=low * Fixed wrong documentID in doc-base registration -- Wichert Akkerman <wakkerma@debian.org> Sat, 23 Jan 1999 23:45:06 +0100 - + alsalib (0.3.0-pre2-1) unstable; urgency=low * New upstream version @@ -1675,7 +1702,7 @@ alsalib (0.1.3-2) unstable; urgency=low alsalib (0.1.3-1) unstable; urgency=low * New upstream version - * Renamed package + * Renamed package * Fix a couple of lintian errors & warnings -- Wichert Akkerman <wakkerma@debian.org> Sun, 15 Nov 1998 02:34:38 +0100 diff --git a/debian/changelog.ALSA b/debian/changelog.ALSA index 2634d3a1..b8db42f3 100644 --- a/debian/changelog.ALSA +++ b/debian/changelog.ALSA @@ -1,3 +1,102 @@ +Changelog between 1.0.27.2 and 1.0.28 releases +(http://www.alsa-project.org/main/index.php/Changes_v1.0.27.2_v1.0.28) +(Reformated as ASCII text) ++++++++++++++++++++++++++++++++++++++++++++ + +* alsa-lib + + * Core + Release v1.0.28 + autotools: update style + Portability fix: look for sys/endian.h as well as endian.h + alsa-lib: heavy pcm atomics cleanup + include/global.h - don't define timeval and timespec structures for !glibc + local.h: include sys/types.h to fix issues with pcm.h + remove unnecessary/obsolete compat/hsearch_r.c + Update iatomic.h functions definitions for mips + local.h: use __kernel_off_t from <linux/types.h> + + * Control API + control_hw: fix potential memory leak + snd_tlv_convert_from_dB: fix decreasing gain across entries + Fix access of freed memory in namehints + + * PCM API + alsa-lib: pcm_plug: fix float conversion for user specified ttable + pcm: rate plugin - remove the rewind/forward implementation + pcm: rate: add rewindable and forwardable callbacks + pcm: null plugin - fix the avail count + pcm: null: add rewindable and forwardable callbacks + pcm: multi: implement rewindable and forwardable callbacks + pcm:file: add the missing htimestamp callback + pcm: Fix channel map query when there are lots of maps + pcm: route: Correctly close slave pcm when no matching chmap is found + pcm: Fix forward/rewind support in iec958 plugin + pcm: rate: Don't return negative frame count on success in rewind + pcm: ladspa: Delay LADSPA plugin activate call + Revert "pcm: route: Don't handle no matching chmap as a serious error" + route: Fix invalid pointer access + route: Return NULL in case of zero found channels in determine_chmap + pcm: route: Don't handle no matching chmap as a serious error + pcm: Wrap hw_ptr to boundary in pcm_ioplug + pcm: route: Select slave chmap based on ttable information + pcm: route: Allow chmap syntax for slave channels in ttable + pcm: Insert linear-to-float conversion when rate or channel count is incorrect + Portability fix: look for sys/endian.h as well as endian.h + alsa-lib: heavy pcm atomics cleanup + pcm: use CLOCK_REALTIME for non-monotonic ts + pcm: initialize monotonic field for dshare and dsnoop, too + pcm: initialize pcm_dmix monotonic field + alsa-lib: minor typo in pcm doc + minor malloc changes + dmix: Don't use assert() and abort() + pcm_file: document new argument to snd_pcm_file_open(). + pcm_file: don't touch infile on playback and output file on capture. + pcm_file: fixed memory leak. + pcm_file: fix SEGFAULT if file option is missing while infile is not. + pcm: Fix a wrong value shown in the error message in rate plugin + + * Use Case Manager API + UCM: Document some standard values + + * /Makefile.am + autotools: update style + + * /alsalisp/Makefile.am + autotools: update style + + * /src/Makefile.am + remove unnecessary/obsolete compat/hsearch_r.c + + * ALSA Lisp + minor malloc changes + + * ALSA Server + autotools: update style + + * Compatibility routines + remove unnecessary/obsolete compat/hsearch_r.c + + * Configuration + Loopback.conf: fix the comment + src/conf/cards: Add missing entry for Loopback.conf + conf: Allow 2.1 surround to use different number of channels + conf: Add surround 2.1 support to all cards + conf: Add basic infrastructure for 2.1 surround sound + conf.c: use portable way to initialize recursive mutex + HDA-Intel: present up to 8 HDMI/DP outputs via "hdmi" device + conf/cards: add Audio Advantage Micro II + + * Documentation + autotools: update style + + * Kernel Headers + hdspm.h: Update LTC ioctl to use struct hdspm_ltc + + * Test/Example code + Add -lm to test programs to fix build failure. + test/chmap: Add missing usage text for -s option + Changelog between 1.0.27.1 and 1.0.27.2 releases (http://www.alsa-project.org/main/index.php/Changes_v1.0.27.1_v1.0.27.2) (Reformated as ASCII text) diff --git a/debian/control b/debian/control index dfd83e3f..d166ab19 100644 --- a/debian/control +++ b/debian/control @@ -9,10 +9,11 @@ Build-Depends: autotools-dev, dh-autoreconf, dpkg-dev (>= 1.16.1) Build-Depends-Indep: doxygen -Standards-Version: 3.9.4 +Standards-Version: 3.9.5 Homepage: http://www.alsa-project.org/ Vcs-Svn: svn://anonscm.debian.org/pkg-alsa/trunk/alsa-lib Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-alsa/trunk/alsa-lib/ +XS-Testsuite: autopkgtest Package: libasound2 Architecture: linux-any diff --git a/debian/gbp.conf b/debian/gbp.conf deleted file mode 100644 index 45052a12..00000000 --- a/debian/gbp.conf +++ /dev/null @@ -1,4 +0,0 @@ -[DEFAULT] -upstream-branch = upstream -debian-branch = master -pristine-tar = True diff --git a/debian/patches/0001-Add-UCM-configuration-for-Nexus-4-Mako.patch b/debian/patches/0001-Add-UCM-configuration-for-Nexus-4-Mako.patch new file mode 100644 index 00000000..1f93a142 --- /dev/null +++ b/debian/patches/0001-Add-UCM-configuration-for-Nexus-4-Mako.patch @@ -0,0 +1,485 @@ +From 7fd8e14ff90e4b1477e3b3ae19a74e8452c1a490 Mon Sep 17 00:00:00 2001 +From: David Henningsson <david.henningsson@canonical.com> +Date: Tue, 27 Aug 2013 07:04:37 +0200 +Subject: [PATCH 1/4] Add UCM configuration for Nexus 4 (Mako) + +The VoiceCall profile is mostly empty, because in my implementation, +this is handled by talking to the audio HAL. +--- + configure.ac | 1 + + src/conf/ucm/Makefile.am | 2 +- + src/conf/ucm/apq8064-tabla-snd-card/HiFi | 260 ++++++++++++++++++++ + src/conf/ucm/apq8064-tabla-snd-card/Makefile.am | 4 + + src/conf/ucm/apq8064-tabla-snd-card/VoiceCall | 121 +++++++++ + .../apq8064-tabla-snd-card.conf | 8 + + 6 files changed, 395 insertions(+), 1 deletion(-) + create mode 100644 src/conf/ucm/apq8064-tabla-snd-card/HiFi + create mode 100644 src/conf/ucm/apq8064-tabla-snd-card/Makefile.am + create mode 100644 src/conf/ucm/apq8064-tabla-snd-card/VoiceCall + create mode 100644 src/conf/ucm/apq8064-tabla-snd-card/apq8064-tabla-snd-card.conf + +Index: alsa-lib-1.0.27.2/configure.ac +=================================================================== +--- alsa-lib-1.0.27.2.orig/configure.ac 2013-07-08 09:31:36.000000000 -0300 ++++ alsa-lib-1.0.27.2/configure.ac 2014-03-10 02:07:28.000000000 -0300 +@@ -669,6 +669,7 @@ + src/conf/ucm/PandaBoardES/Makefile \ + src/conf/ucm/SDP4430/Makefile \ + src/conf/ucm/tegraalc5632/Makefile \ ++ src/conf/ucm/apq8064-tabla-snd-card/Makefile \ + modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \ + alsalisp/Makefile aserver/Makefile \ + test/Makefile test/lsb/Makefile \ +Index: alsa-lib-1.0.27.2/src/conf/ucm/Makefile.am +=================================================================== +--- alsa-lib-1.0.27.2.orig/src/conf/ucm/Makefile.am 2013-07-08 09:31:36.000000000 -0300 ++++ alsa-lib-1.0.27.2/src/conf/ucm/Makefile.am 2014-03-10 02:07:28.000000000 -0300 +@@ -1 +1 @@ +-SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 ++SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 apq8064-tabla-snd-card +Index: alsa-lib-1.0.27.2/src/conf/ucm/apq8064-tabla-snd-card/HiFi +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ alsa-lib-1.0.27.2/src/conf/ucm/apq8064-tabla-snd-card/HiFi 2014-03-10 02:08:14.306081574 -0300 +@@ -0,0 +1,260 @@ ++SectionVerb { ++ EnableSequence [ ++ cdev "hw:apq8064tablasnd" ++ ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:apq8064tablasnd" ++ ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 0" ++ ] ++ ++ Value { ++ TQ "HiFi" ++ ++ CapturePCM "hw:apq8064tablasnd,0" ++ PlaybackPCM "hw:apq8064tablasnd,0" ++ } ++} ++ ++SectionDevice."Earpiece" { ++ #Name "Earpiece" ++ Comment "Earpiece speaker" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Headphones" ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:apq8064tablasnd" ++ ++ # We need to disable this while setting up the route, else the ++ # driver will hang if the stream is open. ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ ++ cset "name='SLIM_0_RX Channels' One" ++ cset "name='RX1 MIX1 INP1' RX1" ++ cset "name='RX1 MIX1 INP2' RX1" ++ cset "name='RX1 Digital Volume' 68" ++ cset "name='EAR PA Gain' POS_6_DB" ++ cset "name='DAC1 Switch' 1" ++ cset "name='SLIM TX3 MUX' RMIX1" ++ ++ # Route has been set up, re-enable the mixer. ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:apq8064tablasnd" ++ ++ # See comment in EnableSequence ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ ++ cset "name='RX1 MIX1 INP1' ZERO" ++ cset "name='RX1 MIX1 INP2' ZERO" ++ cset "name='RX1 Digital Volume' 68" ++ cset "name='DAC1 Switch' 0" ++ cset "name='SLIM TX3 MUX' ZERO" ++ ++ # See comment in EnableSequence ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Speaker" { ++ #Name "Speaker" ++ Comment "Main speaker" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Earpiece" ++ "Headphones" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:apq8064tablasnd" ++ ++ # We need to disable this while setting up the route, else the ++ # driver will hang if the stream is open. ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ ++ cset "name='SLIM_0_RX Channels' One" ++ cset "name='RX3 MIX1 INP1' RX1" ++ cset "name='RX3 MIX1 INP2' RX6" ++ cset "name='RX4 DSM MUX' DSM_INV" ++ cset "name='RX3 Digital Volume' 80" ++ cset "name='LINEOUT1 Volume' 100" ++ cset "name='LINEOUT3 Volume' 100" ++ cset "name='SLIM TX3 MUX' RMIX3" ++ ++ # Route has been set up, re-enable the mixer. ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:apq8064tablasnd" ++ ++ # See comment in EnableSequence ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ ++ cset "name='RX3 MIX1 INP1' ZERO" ++ cset "name='RX3 MIX1 INP2' ZERO" ++ cset "name='RX4 DSM MUX' CIC_OUT" ++ cset "name='RX3 Digital Volume' 68" ++ cset "name='LINEOUT1 Volume' 0" ++ cset "name='LINEOUT3 Volume' 0" ++ cset "name='SLIM TX3 MUX' ZERO" ++ ++ # See comment in EnableSequence ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ PlaybackPriority "150" ++ } ++} ++ ++SectionDevice."Headphones" { ++ #Name "Headphones" ++ Comment "Headphones" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Earpiece" ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:apq8064tablasnd" ++ ++ # We need to disable this while setting up the route, else the ++ # driver will hang if the stream is open. ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ ++ cset "name='SLIM_0_RX Channels' Two" ++ cset "name='RX1 MIX1 INP1' RX1" ++ cset "name='RX1 MIX1 INP2' RX6" ++ cset "name='RX2 MIX1 INP1' RX2" ++ cset "name='RX2 MIX1 INP2' RX7" ++ cset "name='HPHL DAC Switch' 1" ++ #FIXME ENOEXIST: cset "name='HPHR DAC Switch' 1" ++ cset "name='RX1 Digital Volume' 68" ++ cset "name='RX2 Digital Volume' 68" ++ cset "name='HPHL Volume' 50" ++ cset "name='HPHR Volume' 50" ++ cset "name='SLIM TX3 MUX' RMIX1" ++ cset "name='SLIM TX5 MUX' RMIX2" ++ ++ # Route has been set up, re-enable the mixer. ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:apq8064tablasnd" ++ ++ # See comment in EnableSequence ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ ++ cset "name='RX1 MIX1 INP1' ZERO" ++ cset "name='RX1 MIX1 INP2' ZERO" ++ cset "name='RX2 MIX1 INP1' ZERO" ++ cset "name='RX2 MIX1 INP2' ZERO" ++ cset "name='HPHL DAC Switch' 0" ++ #FIXME ENOEXIST: cset "name='HPHR DAC Switch' 0" ++ cset "name='RX1 Digital Volume' 68" ++ cset "name='RX2 Digital Volume' 68" ++ cset "name='HPHL Volume' 0" ++ cset "name='HPHR Volume' 0" ++ cset "name='SLIM TX3 MUX' ZERO" ++ cset "name='SLIM TX5 MUX' ZERO" ++ ++ # See comment in EnableSequence ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Headset" { ++ #Name "Headset" ++ Comment "Headset Microphone" ++ ++ ConflictingDevice [ ++ "Handset" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:apq8064tablasnd" ++ ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 0" ++ cset "name='SLIM_0_TX Channels' One" ++ cset "name='SLIM TX7 MUX' DEC8" ++ cset "name='DEC8 MUX' ADC2" ++ cset "name='ADC2 Volume' 3" ++ cset "name='DEC8 Volume' 84" ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:apq8064tablasnd" ++ ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 0" ++ cset "name='SLIM TX7 MUX' ZERO" ++ cset "name='DEC8 MUX' ZERO" ++ cset "name='ADC2 Volume' 0" ++ ] ++ ++ Value { ++ CaptureChannels "1" ++ } ++} ++ ++SectionDevice."Handset" { ++ #Name "Handset" ++ Comment "Handset Microphone" ++ ++ ConflictingDevice [ ++ "Headset" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:apq8064tablasnd" ++ ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 0" ++ cset "name='SLIM_0_TX Channels' One" ++ cset "name='SLIM TX7 MUX' DEC7" ++ cset "name='DEC7 MUX' ADC1" ++ cset "name='DEC7 Volume' 80" ++ cset "name='ADC1 Volume' 100" ++ cset "name='MICBIAS1 CAPLESS Switch' 0" ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:apq8064tablasnd" ++ ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 0" ++ cset "name='SLIM TX7 MUX' ZERO" ++ cset "name='DEC7 MUX' ZERO" ++ cset "name='DEC7 Volume' 0" ++ cset "name='ADC1 Volume' 0" ++ cset "name='MICBIAS1 CAPLESS Switch' 1" ++ ] ++ ++ Value { ++ CaptureChannels "1" ++ } ++} +Index: alsa-lib-1.0.27.2/src/conf/ucm/apq8064-tabla-snd-card/Makefile.am +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ alsa-lib-1.0.27.2/src/conf/ucm/apq8064-tabla-snd-card/Makefile.am 2014-03-10 02:06:53.000000000 -0300 +@@ -0,0 +1,4 @@ ++alsaconfigdir = @ALSA_CONFIG_DIR@ ++ucmdir = $(alsaconfigdir)/ucm/apq8064-tabla-snd-card ++ucm_DATA = apq8064-tabla-snd-card.conf HiFi VoiceCall ++EXTRA_DIST = $(ucm_DATA) +Index: alsa-lib-1.0.27.2/src/conf/ucm/apq8064-tabla-snd-card/VoiceCall +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ alsa-lib-1.0.27.2/src/conf/ucm/apq8064-tabla-snd-card/VoiceCall 2014-03-10 02:07:45.906081319 -0300 +@@ -0,0 +1,154 @@ ++# There is no mixer setup here - it is handled by PulseAudio's audio HAL module. ++ ++SectionVerb { ++ EnableSequence [ ++ cdev "hw:apq8064tablasnd" ++ cset "name='MultiMedia1 Mixer SLIM_4_TX' 1" ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:apq8064tablasnd" ++ cset "name='MultiMedia1 Mixer SLIM_4_TX' 0" ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ ] ++ ++ Value { ++ CapturePCM "hw:apq8064tablasnd,0" ++ PlaybackPCM "hw:apq8064tablasnd,0" ++ } ++} ++ ++SectionDevice."Earpiece" { ++ #Name "Earpiece" ++ Comment "Earpiece speaker" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Headphones" ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:apq8064tablasnd" ++ cset "name='RX1 Digital Volume' 84" ++ cset "name='EAR PA Gain' POS_6_DB" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:apq8064tablasnd" ++ cset "name='RX1 Digital Volume' 68" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Speaker" { ++ #Name "Speaker" ++ Comment "Main speaker" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Earpiece" ++ "Headphones" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:apq8064tablasnd" ++ cset "name='RX3 Digital Volume' 80" ++ cset "name='LINEOUT1 Volume' 100" ++ cset "name='LINEOUT3 Volume' 100" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:apq8064tablasnd" ++ cset "name='RX3 Digital Volume' 68" ++ cset "name='LINEOUT1 Volume' 0" ++ cset "name='LINEOUT3 Volume' 0" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Headphones" { ++ #Name "Headphones" ++ Comment "Headphones" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Earpiece" ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:apq8064tablasnd" ++ cset "name='RX1 Digital Volume' 68" ++ cset "name='RX2 Digital Volume' 68" ++ cset "name='HPHL Volume' 50" ++ cset "name='HPHR Volume' 50" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:apq8064tablasnd" ++ cset "name='RX1 Digital Volume' 68" ++ cset "name='RX2 Digital Volume' 68" ++ cset "name='HPHL Volume' 0" ++ cset "name='HPHR Volume' 0" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Headset" { ++ #Name "Headset" ++ Comment "Headset Microphone" ++ ++ ConflictingDevice [ ++ "Handset" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:apq8064tablasnd" ++ cset "name='ADC2 Volume' 66" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:apq8064tablasnd" ++ cset "name='ADC2 Volume' 0" ++ ] ++ ++ Value { ++ CaptureChannels "1" ++ } ++} ++ ++SectionDevice."Handset" { ++ #Name "Handset" ++ Comment "Handset Microphone" ++ ++ ConflictingDevice [ ++ "Headset" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:apq8064tablasnd" ++ cset "name='DEC7 Volume' 80" ++ cset "name='ADC1 Volume' 100" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:apq8064tablasnd" ++ cset "name='DEC7 Volume' 0" ++ cset "name='ADC1 Volume' 0" ++ ] ++ ++ Value { ++ CaptureChannels "1" ++ } ++} +Index: alsa-lib-1.0.27.2/src/conf/ucm/apq8064-tabla-snd-card/apq8064-tabla-snd-card.conf +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ alsa-lib-1.0.27.2/src/conf/ucm/apq8064-tabla-snd-card/apq8064-tabla-snd-card.conf 2014-03-10 02:06:53.000000000 -0300 +@@ -0,0 +1,8 @@ ++SectionUseCase."HiFi" { ++ File "HiFi" ++ Comment "Play HiFi quality Music." ++} ++SectionUseCase."Voice Call" { ++ File "VoiceCall" ++ Comment "Make a phone call" ++} diff --git a/debian/patches/0002-Add-UCM-config-file-for-Galaxy-Nexus-maguro.patch b/debian/patches/0002-Add-UCM-config-file-for-Galaxy-Nexus-maguro.patch new file mode 100644 index 00000000..b0f2d1fe --- /dev/null +++ b/debian/patches/0002-Add-UCM-config-file-for-Galaxy-Nexus-maguro.patch @@ -0,0 +1,681 @@ +From 68f94a1fa946e8a3035a7c2cc6c62058fd9b8070 Mon Sep 17 00:00:00 2001 +From: David Henningsson <david.henningsson@canonical.com> +Date: Tue, 27 Aug 2013 09:43:31 +0200 +Subject: [PATCH 2/4] Add UCM config file for Galaxy Nexus (maguro) + +--- + configure.ac | 1 + + src/conf/ucm/Makefile.am | 2 +- + src/conf/ucm/Tuna/HiFi | 354 +++++++++++++++++++++++++++++++++++++++++ + src/conf/ucm/Tuna/Makefile.am | 4 + + src/conf/ucm/Tuna/Tuna.conf | 14 ++ + src/conf/ucm/Tuna/VoiceCall | 245 ++++++++++++++++++++++++++++ + 6 files changed, 619 insertions(+), 1 deletion(-) + create mode 100644 src/conf/ucm/Tuna/HiFi + create mode 100644 src/conf/ucm/Tuna/Makefile.am + create mode 100644 src/conf/ucm/Tuna/Tuna.conf + create mode 100644 src/conf/ucm/Tuna/VoiceCall + +diff --git a/configure.ac b/configure.ac +index 25fdc81..de4e2ef 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -670,6 +670,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ + src/conf/ucm/SDP4430/Makefile \ + src/conf/ucm/tegraalc5632/Makefile \ + src/conf/ucm/apq8064-tabla-snd-card/Makefile \ ++ src/conf/ucm/Tuna/Makefile \ + modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \ + alsalisp/Makefile aserver/Makefile \ + test/Makefile test/lsb/Makefile \ +diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am +index adb3c87..029e1e8 100644 +--- a/src/conf/ucm/Makefile.am ++++ b/src/conf/ucm/Makefile.am +@@ -1 +1 @@ +-SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 apq8064-tabla-snd-card ++SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 apq8064-tabla-snd-card Tuna +diff --git a/src/conf/ucm/Tuna/HiFi b/src/conf/ucm/Tuna/HiFi +new file mode 100644 +index 0000000..3a7fe5e +--- /dev/null ++++ b/src/conf/ucm/Tuna/HiFi +@@ -0,0 +1,354 @@ ++# Use case Configuration for TI Tuna HiFi audio playback and capture ++# By Liam Girdwood <lrg@ti.com> ++# Updated by Sebastien Jan <s-jan@ti.com> ++# Adapted to Ubuntu Touch by David Henningsson <david.henningsson@canonical.com> ++ ++######### Main Verb Config ################# ++ ++SectionVerb { ++ ++ EnableSequence [ ++ # Set SDP device for following cset commands ++ cdev "hw:Tuna" ++ ++ # Enable ABE playback path through DL1 ++ cset "name='DL1 Mixer Multimedia' 1" ++ cset "name='Sidetone Mixer Playback' 1" ++ cset "name='DL1 PDM Switch' 1" ++ ++ # set ABE playback gains to 0dB ++ cset "name='DL1 Media Playback Volume' 120" ++ cset "name='DL2 Media Playback Volume' 120" ++ cset "name='SDT DL Volume' 120" ++ ++ # Enable ABE PDM-UL Capture path ++ cset "name='MUX_UL10' 11" ++ cset "name='MUX_UL11' 12" ++ ++ # set ABE capture gains to 0dB ++ cset "name='AMIC UL Volume' 120" ++ ++ # Disable Earpiece output, leave enabling to device enable ++ # sequence ++ cset "name='Earphone Enable Switch' 0" ++ ] ++ ++ DisableSequence [ ++ # Set SDP device for following cset commands ++ cdev "hw:Tuna" ++ ++ # Disable ABE playback path through DL1 ++ cset "name='DL1 Mixer Multimedia' 0" ++ cset "name='Sidetone Mixer Playback' 0" ++ cset "name='DL1 PDM Switch' 0" ++ ++ # mute ABE playback gains ++ cset "name='DL1 Media Playback Volume' 0" ++ cset "name='DL2 Media Playback Volume' 0" ++ cset "name='SDT DL Volume' 0" ++ ++ # Disable ABE PDM-UL Capture path ++ cset "name='MUX_UL10' 0" ++ cset "name='MUX_UL11' 0" ++ ++ # mute ABE capture gains ++ cset "name='AMIC UL Volume' 0" ++ ++ ] ++ ++ # ALSA PCM ++ Value { ++ ++ TQ "HiFi" ++ ++ # ALSA PCM device for HiFi ++ PlaybackPCM "hw:Tuna,0" ++ CapturePCM "hw:Tuna,1" ++ } ++} ++ ++###### Headset Devices Options ############ ++ ++SectionDevice."Headset" { ++ Comment "Headset Microphone" ++ ++ # Headset is mutually exclusive to some devices ++ ConflictingDevice [ ++ "Mainmic" ++ "Submic" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:Tuna" ++ ++ # TWL6040 Capture Path ++ cset "name='Analog Left Capture Route' 0" ++ cset "name='Analog Right Capture Route' 0" ++ cset "name='Capture Preamplifier Volume' 2" ++ ++ cset "name='Capture Volume' 4" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:Tuna" ++ ++ # TWL6040 Capture path ++ cset "name='Analog Left Capture Route' 3" ++ cset "name='Analog Right Capture Route' 3" ++ cset "name='Capture Preamplifier Volume' 0" ++ ] ++ ++ Value { ++ CaptureChannels "2" ++ } ++} ++ ++###### Headphones Devices Options ############ ++ ++SectionDevice."Headphones" { ++ Comment "Tuna 3.5mm Headphones playback" ++ ++ # Headphones is mutually exclusive to some devices ++ ConflictingDevice [ ++ "Speaker" ++ "Earpiece" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:Tuna" ++ ++ # TWL6040 playback path ++ cset "name='HS Left Playback' 1" ++ cset "name='HS Right Playback' 1" ++ ++ cset "name='Headset Playback Volume' 14" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:Tuna" ++ ++ cset "name='Headset Playback Volume' 0" ++ # TWL6040 playback path ++ cset "name='HS Right Playback' 0" ++ cset "name='HS Left Playback' 0" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++########### Earpiece Device Options ################ ++ ++SectionDevice."Earpiece" { ++ Comment "Earpiece playback" ++ ++ EnableSequence [ ++ cdev "hw:Tuna" ++ ++ # TWL6040 playback path ++ cset "name='Earphone Enable Switch' 1" ++ ++ cset "name='Earphone Enable Volume' 13" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:Tuna" ++ ++ cset "name='Earphone Enable Volume' 0" ++ ++ # TWL6040 playback path ++ cset "name='Earphone Enable Switch' 0" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++########### Speaker Device Options ################ ++ ++SectionDevice."Speaker" { ++ Comment "Main speaker playback" ++ ++ EnableSequence [ ++ cdev "hw:Tuna" ++ ++ # ABE playback path through DL2 ++ cset "name='DL2 Mixer Multimedia' 1" ++ ++ # TWL6040 playback path ++ cset "name='HF Left Playback' 1" ++ cset "name='HF Right Playback' 1" ++ ++ cset "name='Handsfree Playback Volume' 28" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:Tuna" ++ ++ cset "name='Handsfree Playback Volume' 0" ++ ++ # ABE playback path through DL2 ++ cset "name='DL2 Mixer Multimedia' 0" ++ ++ # TWL6040 playback path ++ cset "name='HF Left Playback' 0" ++ cset "name='HF Right Playback' 0" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++############ Main Mic Device ######################### ++ ++SectionDevice."Handset" { ++ Comment "Main Microphone Left Channel Capture" ++ ++ ConflictingDevice [ ++ "Headset" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:Tuna" ++ ++ # TWL6040 Capture Path ++ cset "name='Analog Left Capture Route' 0" ++ cset "name='Capture Volume' 4" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:Tuna" ++ ++ # TWL6040 Capture path ++ cset "name='Analog Left Capture Route' 3" ++ ] ++ ++ Value { ++ # Default ALSA volume gain and mute kcontrols ++ CaptureChannels "2" ++ } ++} ++ ++############ Sub Mic Device ######################### ++ ++SectionDevice."Submic" { ++ Comment "Sub Microphone Right Channel Capture" ++ ++ ConflictingDevice [ ++ "Headset" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:Tuna" ++ ++ # TWL6040 Capture Path ++ cset "name='Analog Right Capture Route' 1" ++ ++ cset "name='Capture Volume' 4" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:Tuna" ++ ++ # TWL6040 Capture path ++ cset "name='Analog Right Capture Route' 3" ++ ] ++ ++ Value { ++ CaptureChannels "2" ++ } ++} ++ ++############## Play Tone Modifier #################### ++# ++# We have 2 PlayTone modifiers. Each one supports different devices as the ++# path configuration is different depending on the device being used when ++# the modifier is enabled. ++# ++ ++SectionModifier."PlayTone" { ++ Comment "Play a ring tone or system sound" ++ ++ # For the following devices we need to set the DL2 path ++ SupportedDevice [ ++ "Headphones" ++ "Earpiece" ++ ] ++ ++ EnableSequence [ ++ ++ # Set SDP device for following cset commands ++ cdev "hw:Tuna" ++ ++ # ABE playback path through DL2 ++ cset "name='DL2 Mixer Tones' 1" ++ cset "name='DL2 Tones Playback Volume' 120" ++ cset "name='DL1 Mixer Tones' 1" ++ cset "name='DL1 Tones Playback Volume' 120" ++ ++# # TWL6040 playback path ++# cset "name='HF Left Playback' 1" ++# cset "name='HF Right Playback' 1" ++ ] ++ ++ DisableSequence [ ++ ++ # Set SDP device for following cset commands ++ cdev "hw:Tuna" ++ ++ # ABE playback path through DL2 ++ cset "name='DL2 Mixer Tones' 0" ++ cset "name='DL2 Tones Playback Volume' 0" ++ cset "name='DL1 Mixer Tones' 0" ++ cset "name='DL1 Tones Playback Volume' 0" ++ ++# # TWL6040 playback path ++# cset "name='HF Left Playback' 0" ++# cset "name='HF Right Playback' 0" ++ ] ++ ++ # QoS, Mixers and ALSA PCMs ++ Value { ++ TQ "Tones" ++ PlaybackPCM "hw:Tuna,3" ++ PlaybackVolume "name='DL2 Tones Playback Volume' 120" ++ } ++} ++ ++SectionModifier."PlayTone" { ++ Comment "Play a ring tone or system sound" ++ ++ # For the following devices we dont need to set the DL2 path ++ SupportedDevice [ ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ ++ # Set SDP device for following cset commands ++ cdev "hw:Tuna" ++ ++ # ABE playback path through DL2 ++ cset "name='DL2 Mixer Tones' 1" ++ cset "name='DL2 Tones Playback Volume' 120" ++ ] ++ ++ DisableSequence [ ++ ++ # Set SDP device for following cset commands ++ cdev "hw:Tuna" ++ ++ cset "name='DL2 Mixer Tones' 0" ++ ] ++ ++ # QoS, Mixers and ALSA PCMs ++ Value { ++ TQ "Tones" ++ PlaybackPCM "hw:Tuna,3" ++ PlaybackVolume "name='DL2 Tones Playback Volume' 120" ++ } ++} ++ +diff --git a/src/conf/ucm/Tuna/Makefile.am b/src/conf/ucm/Tuna/Makefile.am +new file mode 100644 +index 0000000..f8a69dd +--- /dev/null ++++ b/src/conf/ucm/Tuna/Makefile.am +@@ -0,0 +1,4 @@ ++alsaconfigdir = @ALSA_CONFIG_DIR@ ++ucmdir = $(alsaconfigdir)/ucm/Tuna ++ucm_DATA = Tuna.conf HiFi VoiceCall ++EXTRA_DIST = $(ucm_DATA) +diff --git a/src/conf/ucm/Tuna/Tuna.conf b/src/conf/ucm/Tuna/Tuna.conf +new file mode 100644 +index 0000000..c517b21 +--- /dev/null ++++ b/src/conf/ucm/Tuna/Tuna.conf +@@ -0,0 +1,14 @@ ++# UCM configuration for SDP4430 ++SectionUseCase."HiFi" { ++ File "HiFi" ++ Comment "Play HiFi quality Music" ++} ++ ++SectionUseCase."Voice Call" { ++ File "VoiceCall" ++ Comment "Voice Phone Call" ++} ++ ++SectionDefaults [ ++ cdev "hw:Tuna" ++] +diff --git a/src/conf/ucm/Tuna/VoiceCall b/src/conf/ucm/Tuna/VoiceCall +new file mode 100644 +index 0000000..47a2ba3 +--- /dev/null ++++ b/src/conf/ucm/Tuna/VoiceCall +@@ -0,0 +1,245 @@ ++# Use case Configuration for TI Tuna RF MODEM Voice Call ++# By Liam Girdwood <lrg@ti.com> ++# Adapted to Ubuntu Touch by David Henningsson <david.henningsson@canonical.com> ++ ++SectionVerb { ++ ++ EnableSequence [ ++ cdev "hw:Tuna" ++ ++ # Enable ABE sidetone paths at 0dB (needs tuned) ++ cset "name='Sidetone Mixer Capture' 1" ++ cset "name='Sidetone Mixer Playback' 1" ++ cset "name='SDT DL Volume' 120" ++ cset "name='SDT UL Volume' 120" ++ ++ # Enable ABE DL1 Voice at 0dB ++ cset "name='DL1 Mixer Multimedia' 1" ++ cset "name='DL1 Mixer Voice' 1" ++ cset "name='DL1 Voice Playback Volume' 120" ++ ++ # Only enabled for Speaker ++ cset "name='DL2 Mixer Multimedia' 0" ++ cset "name='DL2 Mixer Voice' 0" ++ ++ # Disable DL2 Mono Mixer ++ cset "name='DL2 Mono Mixer' 0" ++ ++ # Enable Uplink ++ cset "name='Voice Capture Mixer Capture' 1" ++ ++ # Todo - Execute modem startup command if required. ++ ++ # FIXME: Copying Handset enable here to allow the PCM to be ++ # opened. Better fix required, possibly driver-side. ++ # Enable ABE paths to PDM and AMIC ++ cset "name='DL1 PDM Switch' 1" ++ cset "name='MUX_VX0' 11" ++ cset "name='MUX_VX1' 12" ++ ++ # set ABE capture gains to 0dB ++ cset "name='AMIC UL Volume' 120" ++ ++ # TWL6040 playback path ++ cset "name='Earphone Enable Switch' 1" ++ ++ # TWL6040 Capture Path with Main Mic and Sub Mic ++ cset "name='Analog Left Capture Route' 1" ++ cset "name='Analog Right Capture Route' 1" ++ cset "name='Capture Preamplifier Volume' 2" ++ # END OF FIXME ++ ++ # Enable extra PCMs ++ ++ # ABE Music playback path through DL1 at 0dB (tune this) ++ cset "name='DL1 Mixer Multimedia' 1" ++ cset "name='DL1 Media Playback Volume' 120" ++ ++ # Enable VX_REC for call capture at 0dB ++ cset "name='Capture Mixer Voice Playback' 1" ++ cset "name='Capture Mixer Voice Capture' 1" ++ cset "name='VXREC Voice UL Volume' 120" ++ cset "name='VXREC Voice DL Volume' 120" ++ ++ # set ROUTE_UL path ++ cset "name='MUX_UL10' 13" ++ cset "name='MUX_UL11' 14" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:Tuna" ++ ++ # Disable Extra PCMs ++ ++ # Enable VX_REC for call capture at 0dB ++ cset "name='Capture Mixer Voice Playback' 0" ++ cset "name='Capture Mixer Voice Capture' 0" ++ cset "name='VXREC Voice UL Volume' 0" ++ cset "name='VXREC Voice DL Volume' 0" ++ ++ # set ROUTE_UL path ++ cset "name='MUX_UL10' 0" ++ cset "name='MUX_UL11' 0" ++ ++ # disable ABE Music path to near end ++ cset "name='DL1 Mixer Tones' 0" ++ cset "name='DL1 Tones Playback Volume' 0" ++ ++ # ABE mute tone playback path through DL2 ++ cset "name='DL2 Mixer Tones' 0" ++ cset "name='DL2 Tones Playback Volume' 0" ++ ++ # Todo - Execute modem shutdown command if required. ++ ++ # Disable ABE sidetone paths and mute (needs tuned) ++ cset "name='Sidetone Mixer Capture' 0" ++ cset "name='Sidetone Mixer Playback' 0" ++ cset "name='SDT DL Volume' 0" ++ cset "name='SDT UL Volume' 0" ++ ++ # Disable ABE DL1 Voice and mute ++ cset "name='DL1 Mixer Voice' 0" ++ cset "name='DL1 Voice Playback Volume' 0" ++ ++ # Enable DL2 Multimedia ++ cset "name='DL2 Mixer Multimedia' 1" ++ ++ # Enable DL2 Mono Mixer ++ cset "name='DL2 Mono Mixer' 1" ++ ++ # Disable Uplink ++ cset "name='Voice Capture Mixer Capture' 0" ++ ++ # FIXME: Copying Handset disable here to allow the PCM to be ++ # opened. Better fix required, possibly driver-side. ++ # Set SDP device for following cset commands ++ cdev "hw:Tuna" ++ ++ # Enable ABE paths ++ cset "name='DL1 PDM Switch' 0" ++ cset "name='MUX_VX0' 0" ++ cset "name='MUX_VX1' 0" ++ ++ # mute ABE capture gains ++ cset "name='AMIC UL Volume' 120" ++ ++ # TWL6040 playback path ++ cset "name='HS Right Playback' 0" ++ cset "name='HS Left Playback' 0" ++ ++ # TWL6040 Capture path ++ cset "name='Analog Left Capture Route' 3" ++ cset "name='Analog Right Capture Route' 3" ++ cset "name='Capture Preamplifier Volume' 0" ++ # END OF FIXME ++ ] ++ ++ # QoS and ALSA PCMs ++ Value { ++ TQ "Voice" ++ ++ CapturePCM "hw:Tuna,1" ++ PlaybackPCM "hw:Tuna,0" ++ } ++} ++ ++SectionDevice."Earpiece" { ++ #Name "Earpiece" ++ Comment "Earpiece output" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Headphones" ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ ] ++ DisableSequence [ ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Headphones" { ++ #Name "Earpiece" ++ Comment "Headphone output" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Earpiece" ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ ] ++ DisableSequence [ ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Speaker" { ++ #Name "Earpiece" ++ Comment "Speaker output" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Earpiece" ++ "Headphones" ++ ] ++ ++ EnableSequence [ ++ ] ++ DisableSequence [ ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++ ++SectionDevice."Handset" { ++ Comment "Main mic input" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Headset" ++ ] ++ ++ EnableSequence [ ++ ] ++ DisableSequence [ ++ ] ++ ++ Value { ++ CaptureChannels "2" ++ } ++} ++ ++SectionDevice."Headset" { ++ Comment "Headset mic input" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Handset" ++ ] ++ ++ EnableSequence [ ++ ] ++ DisableSequence [ ++ ] ++ ++ Value { ++ CaptureChannels "2" ++ } ++} ++ ++ ++ ++ +-- +1.7.9.5 + diff --git a/debian/patches/0003-Add-UCM-files-for-Nexus-7.patch b/debian/patches/0003-Add-UCM-files-for-Nexus-7.patch new file mode 100644 index 00000000..30abd235 --- /dev/null +++ b/debian/patches/0003-Add-UCM-files-for-Nexus-7.patch @@ -0,0 +1,166 @@ +From b2f9e96bb12f2df988d47bd392418fec7a5a4043 Mon Sep 17 00:00:00 2001 +From: David Henningsson <david.henningsson@canonical.com> +Date: Wed, 28 Aug 2013 11:35:24 +0200 +Subject: [PATCH 3/4] Add UCM files for Nexus 7 + +--- + configure.ac | 1 + + src/conf/ucm/Makefile.am | 2 +- + src/conf/ucm/tegra-rt5640/HiFi | 98 +++++++++++++++++++++++++++ + src/conf/ucm/tegra-rt5640/Makefile.am | 4 ++ + src/conf/ucm/tegra-rt5640/tegra-rt5640.conf | 8 +++ + 5 files changed, 112 insertions(+), 1 deletion(-) + create mode 100644 src/conf/ucm/tegra-rt5640/HiFi + create mode 100644 src/conf/ucm/tegra-rt5640/Makefile.am + create mode 100644 src/conf/ucm/tegra-rt5640/tegra-rt5640.conf + +diff --git a/configure.ac b/configure.ac +index de4e2ef..92e5db5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -671,6 +671,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ + src/conf/ucm/tegraalc5632/Makefile \ + src/conf/ucm/apq8064-tabla-snd-card/Makefile \ + src/conf/ucm/Tuna/Makefile \ ++ src/conf/ucm/tegra-rt5640/Makefile \ + modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \ + alsalisp/Makefile aserver/Makefile \ + test/Makefile test/lsb/Makefile \ +diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am +index 029e1e8..e8cc02d 100644 +--- a/src/conf/ucm/Makefile.am ++++ b/src/conf/ucm/Makefile.am +@@ -1 +1 @@ +-SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 apq8064-tabla-snd-card Tuna ++SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 apq8064-tabla-snd-card Tuna tegra-rt5640 +diff --git a/src/conf/ucm/tegra-rt5640/HiFi b/src/conf/ucm/tegra-rt5640/HiFi +new file mode 100644 +index 0000000..3f2e77b +--- /dev/null ++++ b/src/conf/ucm/tegra-rt5640/HiFi +@@ -0,0 +1,98 @@ ++# Use case Configuration for Nexus 7 ++# Adapted to Ubuntu Touch by David Henningsson <david.henningsson@canonical.com> ++ ++SectionVerb { ++ ++ EnableSequence [ ++ ] ++ ++ DisableSequence [ ++ ] ++ ++ # ALSA PCM ++ Value { ++ # ALSA PCM device for HiFi ++ PlaybackPCM "hw:tegrart5640" ++ CapturePCM "hw:tegrart5640" ++ } ++} ++ ++SectionDevice."Headphones" { ++ Comment "Headphones playback" ++ ++ ConflictingDevice [ ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:tegrart5640" ++ cset "name='Headphone Jack Switch' on" ++ cset "name='HP Playback Switch' on" ++ cset "name='HP Playback Volume' 29" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:tegrart5640" ++ cset "name='Headphone Jack Switch' on" ++ cset "name='HP Playback Switch' off" ++ cset "name='HP Playback Volume' 0" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Speaker" { ++ Comment "Speaker playback" ++ ++ ConflictingDevice [ ++ "Headphones" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:tegrart5640" ++ cset "name='Int Spk Switch' on" ++ cset "name='Speaker Playback Switch' on" ++ cset "name='Speaker Playback Volume' 29" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:tegrart5640" ++ cset "name='Int Spk Switch' off" ++ cset "name='Speaker Playback Switch' off" ++ cset "name='Speaker Playback Volume' 0" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Handset" { ++ Comment "Main Microphone" ++ ++ EnableSequence [ ++ cdev "hw:tegrart5640" ++ ++ cset "name='ADC Switch' on" ++ cset "name='ADC Capture Switch' on" ++ cset "name='ADC Capture Volume' 100" ++ cset "name='ADC Boost Gain' 1" ++ cset "name='DMIC Switch' DMIC1" ++ cset "name='Int Mic Switch' on" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:tegrart5640" ++ cset "name='ADC Switch' off" ++ cset "name='ADC Capture Switch' off" ++ cset "name='Int Mic Switch' off" ++ ] ++ ++ Value { ++ CaptureChannels "2" ++ } ++} ++ ++ +diff --git a/src/conf/ucm/tegra-rt5640/Makefile.am b/src/conf/ucm/tegra-rt5640/Makefile.am +new file mode 100644 +index 0000000..408e065 +--- /dev/null ++++ b/src/conf/ucm/tegra-rt5640/Makefile.am +@@ -0,0 +1,4 @@ ++alsaconfigdir = @ALSA_CONFIG_DIR@ ++ucmdir = $(alsaconfigdir)/ucm/tegra-rt5640 ++ucm_DATA = tegra-rt5640.conf HiFi ++EXTRA_DIST = $(ucm_DATA) +diff --git a/src/conf/ucm/tegra-rt5640/tegra-rt5640.conf b/src/conf/ucm/tegra-rt5640/tegra-rt5640.conf +new file mode 100644 +index 0000000..f86e080 +--- /dev/null ++++ b/src/conf/ucm/tegra-rt5640/tegra-rt5640.conf +@@ -0,0 +1,8 @@ ++SectionUseCase."HiFi" { ++ File "HiFi" ++ Comment "Play HiFi quality Music" ++} ++ ++SectionDefaults [ ++ cdev "hw:tegrart5640" ++] +-- +1.7.9.5 + diff --git a/debian/patches/0004-Add-UCM-config-files-for-Nexus-10.patch b/debian/patches/0004-Add-UCM-config-files-for-Nexus-10.patch new file mode 100644 index 00000000..3408fb07 --- /dev/null +++ b/debian/patches/0004-Add-UCM-config-files-for-Nexus-10.patch @@ -0,0 +1,317 @@ +From c148a16236422ad36320029cb72b920e3fc589f0 Mon Sep 17 00:00:00 2001 +From: David Henningsson <david.henningsson@canonical.com> +Date: Tue, 3 Sep 2013 13:35:35 +0200 +Subject: [PATCH 4/4] Add UCM config files for Nexus 10 + +Signed-off-by: David Henningsson <david.henningsson@canonical.com> +--- + configure.ac | 2 + + src/conf/ucm/Makefile.am | 2 +- + src/conf/ucm/Manta-I2S/HiFi | 211 ++++++++++++++++++++++++++++++ + src/conf/ucm/Manta-I2S/Makefile.am | 4 + + src/conf/ucm/Manta-I2S/Manta-I2S.conf | 7 + + src/conf/ucm/Manta-SPDIF/Dummy | 3 + + src/conf/ucm/Manta-SPDIF/Makefile.am | 4 + + src/conf/ucm/Manta-SPDIF/Manta-SPDIF.conf | 6 + + 8 files changed, 238 insertions(+), 1 deletion(-) + create mode 100644 src/conf/ucm/Manta-I2S/HiFi + create mode 100644 src/conf/ucm/Manta-I2S/Makefile.am + create mode 100644 src/conf/ucm/Manta-I2S/Manta-I2S.conf + create mode 100644 src/conf/ucm/Manta-SPDIF/Dummy + create mode 100644 src/conf/ucm/Manta-SPDIF/Makefile.am + create mode 100644 src/conf/ucm/Manta-SPDIF/Manta-SPDIF.conf + +diff --git a/configure.ac b/configure.ac +index 92e5db5..daf3b91 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -672,6 +672,8 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ + src/conf/ucm/apq8064-tabla-snd-card/Makefile \ + src/conf/ucm/Tuna/Makefile \ + src/conf/ucm/tegra-rt5640/Makefile \ ++ src/conf/ucm/Manta-I2S/Makefile \ ++ src/conf/ucm/Manta-SPDIF/Makefile \ + modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \ + alsalisp/Makefile aserver/Makefile \ + test/Makefile test/lsb/Makefile \ +diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am +index e8cc02d..d284864 100644 +--- a/src/conf/ucm/Makefile.am ++++ b/src/conf/ucm/Makefile.am +@@ -1 +1 @@ +-SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 apq8064-tabla-snd-card Tuna tegra-rt5640 ++SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 apq8064-tabla-snd-card Tuna tegra-rt5640 Manta-I2S Manta-SPDIF +diff --git a/src/conf/ucm/Manta-I2S/HiFi b/src/conf/ucm/Manta-I2S/HiFi +new file mode 100644 +index 0000000..9e0f00c +--- /dev/null ++++ b/src/conf/ucm/Manta-I2S/HiFi +@@ -0,0 +1,211 @@ ++# By David Henningsson <david.henningsson@canonical.com> ++# Translated from mixer_paths.xml in Manta repository ++ ++SectionVerb { ++ ++ EnableSequence [ ++ cdev "hw:MantaI2S" ++ ++ # A lot of defaults ++ cset "name='DAC2 Switch' 0" ++ cset "name='AIF1DRC1 Mode' Default" ++ cset "name='AIF1DAC1 DRC Switch' 0" ++ cset "name='Speaker Switch' 0" ++ cset "name='SPKR DAC1 Switch' 0" ++ cset "name='SPKL DAC1 Switch' 0" ++ cset "name='Speaker Mixer Volume' 0" ++ ++ cset "name='Headphone Switch' 0" ++ cset "name='Left Output Mixer DAC Switch' 0" ++ cset "name='Right Output Mixer DAC Switch' 0" ++ ++ cset "name='MIXINL IN1L Switch' 0" ++ cset "name='IN1L Switch' 0" ++ cset "name='IN1L PGA IN1LP Switch' 0" ++ cset "name='IN1L PGA IN1LN Switch' 1" ++ ++ cset "name='MIXINL IN2L Switch' 0" ++ cset "name='IN2L Switch' 0" ++ cset "name='IN2L PGA IN2LP Switch' 0" ++ cset "name='IN2L PGA IN2LN Switch' 1" ++ ++ cset "name='MIXINR IN1R Switch' 0" ++ cset "name='IN1R Switch' 0" ++ cset "name='IN1R PGA IN1RP Switch' 0" ++ cset "name='IN1R PGA IN1RN Switch' 1" ++ ++ cset "name='MIXINR IN2R Switch' 0" ++ cset "name='IN2R Switch' 0" ++ cset "name='IN2R PGA IN2RP Switch' 0" ++ cset "name='IN2R PGA IN2RN Switch' 1" ++ ++ cset "name='AIF2DACL Mux' AIF3" ++ cset "name='AIF2DACR Mux' AIF3" ++ cset "name='AIF2DAC Mux' AIF3DACDAT" ++ cset "name='AIF3ADC Mux' AIF2ADCDAT" ++ ++ cset "name='AIF1ADC1L Mixer AIF2 Switch' 0" ++ cset "name='AIF1ADC1R Mixer AIF2 Switch' 0" ++ cset "name='AIF1ADC2L Mixer AIF2 Switch' 0" ++ cset "name='AIF1ADC2R Mixer AIF2 Switch' 0" ++ ++ # Enable dac1 ++ cset "name='DAC1R Mixer AIF1.1 Switch' 1" ++ cset "name='DAC1L Mixer AIF1.1 Switch' 1" ++ cset "name='DAC1 Switch' 1" ++ ++ # Enable adc to aif1adc ++ cset "name='AIF1ADC1L Mixer ADC/DMIC Switch' 1" ++ cset "name='AIF1ADC1R Mixer ADC/DMIC Switch' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:MantaI2S" ++ ++ # Disable dac1 ++ cset "name='DAC1R Mixer AIF1.1 Switch' 0" ++ cset "name='DAC1L Mixer AIF1.1 Switch' 0" ++ cset "name='DAC1 Switch' 0" ++ ++ # Disable adc to aif1adc ++ cset "name='AIF1ADC1L Mixer ADC/DMIC Switch' 0" ++ cset "name='AIF1ADC1R Mixer ADC/DMIC Switch' 0" ++ ] ++ ++ # ALSA PCM ++ Value { ++ ++ TQ "HiFi" ++ ++ # ALSA PCM device for HiFi ++ PlaybackPCM "hw:MantaI2S,0" ++ CapturePCM "hw:MantaI2S,0" ++ } ++ ++} ++ ++SectionDevice."Speaker" { ++ Comment "Main speaker" ++ ++ EnableSequence [ ++ cdev "hw:MantaI2S" ++ ++ # Enable speaker ++ cset "name='Speaker Switch' 1" ++ cset "name='SPKR DAC1 Switch' 1" ++ cset "name='SPKL DAC1 Switch' 1" ++ cset "name='Speaker Mixer Volume' 3" ++ cset "name='Speaker Boost Volume' 5" ++ cset "name='AIF1DRC1 Mode' 'Speakers Media'" ++ cset "name='AIF1DAC1 DRC Switch' 1" ++ ++ # Set EQ for speaker ++ cset "name='AIF1DAC1 EQ Switch' 1" ++ cset "name='AIF1DAC1 EQ1 Volume' 3" ++ cset "name='AIF1DAC1 EQ2 Volume' 8" ++ cset "name='AIF1DAC1 EQ3 Volume' 16" ++ cset "name='AIF1DAC1 EQ4 Volume' 10" ++ cset "name='AIF1DAC1 EQ5 Volume' 11" ++ ++ # Set Volume for speaker ++ cset "name='Speaker Volume' 61,62" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:MantaI2S" ++ ++ cset "name='Speaker Switch' 0" ++ cset "name='AIF1DAC1 EQ Switch' 0" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ PlaybackPriority "150" ++ } ++} ++ ++SectionDevice."Headphones" { ++ Comment "Headphone jack" ++ ++ EnableSequence [ ++ cdev "hw:MantaI2S" ++ ++ cset "name='Headphone Switch' 1" ++ cset "name='AIF1DAC1 EQ Switch' 0" ++ cset "name='Headphone Volume' 55,55" ++ cset "name='Left Headphone Mux' 'DAC'" ++ cset "name='Right Headphone Mux' 'DAC'" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:MantaI2S" ++ ++ cset "name='Headphone Switch' 0" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Microphone" { ++ Comment "Internal microphone" ++ ++ EnableSequence [ ++ cdev "hw:MantaI2S" ++ ++ # Main mic ++ cset "name='MIXINR IN2R Switch' 1" ++ cset "name='MIXINR IN2R Volume' 1" ++ cset "name='IN2R Switch' 1" ++ cset "name='AIF1ADCL Source' Right" ++ ++ # Second mic right ++ cset "name='MIXINL IN2L Switch' 1" ++ cset "name='MIXINL IN2L Volume' 1" ++ cset "name='IN2L Switch' 1" ++ cset "name='AIF1ADCR Source' Left" ++ ++ # Volume ++ cset "name='IN2R Volume' 16" ++ cset "name='IN2L Volume' 16" ++ cset "name='AIF1ADC1 HPF Switch' 1" ++ cset "name='AIF1ADC1 HPF Mode' HiFi" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:MantaI2S" ++ ++ ] ++ ++ Value { ++ CaptureChannels "2" ++ } ++} ++ ++SectionDevice."HeadsetMic" { ++ Comment "Headset microphone" ++ ++ EnableSequence [ ++ cdev "hw:MantaI2S" ++ ++ # Headset Mic ++ # Is this really correct? It looks a lot like main mic ++ cset "name='MIXINR IN2R Switch' 1" ++ cset "name='MIXINR IN2R Volume' 1" ++ cset "name='IN2R Switch' 1" ++ cset "name='AIF1ADCL Source' Right" ++ ++ cset "name='IN2R Volume' 16" ++ cset "name='AIF1ADC1 HPF Mode' HiFi" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:MantaI2S" ++ ++ ] ++ ++ Value { ++ CaptureChannels "1" ++ } ++} +diff --git a/src/conf/ucm/Manta-I2S/Makefile.am b/src/conf/ucm/Manta-I2S/Makefile.am +new file mode 100644 +index 0000000..f053707 +--- /dev/null ++++ b/src/conf/ucm/Manta-I2S/Makefile.am +@@ -0,0 +1,4 @@ ++alsaconfigdir = @ALSA_CONFIG_DIR@ ++ucmdir = $(alsaconfigdir)/ucm/Manta-I2S ++ucm_DATA = Manta-I2S.conf HiFi ++EXTRA_DIST = $(ucm_DATA) +diff --git a/src/conf/ucm/Manta-I2S/Manta-I2S.conf b/src/conf/ucm/Manta-I2S/Manta-I2S.conf +new file mode 100644 +index 0000000..83b61ec +--- /dev/null ++++ b/src/conf/ucm/Manta-I2S/Manta-I2S.conf +@@ -0,0 +1,7 @@ ++# UCM configuration for Manta / Nexus 10 ++ ++SectionUseCase."HiFi" { ++ File "HiFi" ++ Comment "Play HiFi quality Music." ++} ++ +diff --git a/src/conf/ucm/Manta-SPDIF/Dummy b/src/conf/ucm/Manta-SPDIF/Dummy +new file mode 100644 +index 0000000..a2ad2a7 +--- /dev/null ++++ b/src/conf/ucm/Manta-SPDIF/Dummy +@@ -0,0 +1,3 @@ ++SectionVerb { ++} ++SectionDevice.Dummy { } +diff --git a/src/conf/ucm/Manta-SPDIF/Makefile.am b/src/conf/ucm/Manta-SPDIF/Makefile.am +new file mode 100644 +index 0000000..0e2c0dc +--- /dev/null ++++ b/src/conf/ucm/Manta-SPDIF/Makefile.am +@@ -0,0 +1,4 @@ ++alsaconfigdir = @ALSA_CONFIG_DIR@ ++ucmdir = $(alsaconfigdir)/ucm/Manta-SPDIF ++ucm_DATA = Manta-SPDIF.conf Dummy ++EXTRA_DIST = $(ucm_DATA) +diff --git a/src/conf/ucm/Manta-SPDIF/Manta-SPDIF.conf b/src/conf/ucm/Manta-SPDIF/Manta-SPDIF.conf +new file mode 100644 +index 0000000..1db14c9 +--- /dev/null ++++ b/src/conf/ucm/Manta-SPDIF/Manta-SPDIF.conf +@@ -0,0 +1,6 @@ ++# This empty file makes PulseAudio avoid the card. ++ ++SectionUseCase."Dummy" { ++ File Dummy ++ Comment "Dummy" ++} +-- +1.8.3.2 + diff --git a/debian/patches/0005-Add-UCM-config-files-for-Nexus-5.patch b/debian/patches/0005-Add-UCM-config-files-for-Nexus-5.patch new file mode 100644 index 00000000..e98928ec --- /dev/null +++ b/debian/patches/0005-Add-UCM-config-files-for-Nexus-5.patch @@ -0,0 +1,404 @@ +## Description: add some description +## Origin/Author: add some origin or author +## Bug: bug URL +Index: alsa-lib-1.0.27.2/src/conf/ucm/msm8974-taiko-mtp-snd-card/HiFi +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ alsa-lib-1.0.27.2/src/conf/ucm/msm8974-taiko-mtp-snd-card/HiFi 2014-02-24 13:57:38.000000000 +0100 +@@ -0,0 +1,259 @@ ++SectionVerb { ++ EnableSequence [ ++ cdev "hw:msm8974taikomtp" ++ ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:msm8974taikomtp" ++ ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 0" ++ ] ++ ++ Value { ++ TQ "HiFi" ++ ++ CapturePCM "hw:msm8974taikomtp,0" ++ PlaybackPCM "hw:msm8974taikomtp,0" ++ } ++} ++ ++SectionDevice."Earpiece" { ++ #Name "Earpiece" ++ Comment "Earpiece speaker" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Headphones" ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:msm8974taikomtp" ++ ++ # We need to disable this while setting up the route, else the ++ # driver will hang if the stream is open. ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ ++ cset "name='SLIM RX1 MUX' AIF1_PB" ++ cset "name='SLIM_0_RX Channels' One" ++ cset "name='RX1 MIX1 INP1' RX1" ++ cset "name='CLASS_H_DSM MUX' DSM_HPHL_RX1" ++ cset "name='RX1 Digital Volume' 65" ++ cset "name='EAR PA Gain' POS_6_DB" ++ cset "name='DAC1 Switch' 1" ++ ++ # Route has been set up, re-enable the mixer. ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:msm8974taikomtp" ++ ++ # See comment in EnableSequence ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ ++ cset "name='SLIM RX1 MUX' ZERO" ++ cset "name='RX1 MIX1 INP1' ZERO" ++ cset "name='CLASS_H_DSM MUX' ZERO" ++ cset "name='RX1 Digital Volume' 0" ++ cset "name='DAC1 Switch' 0" ++ ++ # See comment in EnableSequence ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Speaker" { ++ #Name "Speaker" ++ Comment "Main speaker" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Earpiece" ++ "Headphones" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:msm8974taikomtp" ++ ++ # We need to disable this while setting up the route, else the ++ # driver will hang if the stream is open. ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ ++ cset "name='SLIM RX1 MUX' AIF1_PB" ++ cset "name='SLIM_0_RX Channels' One" ++ cset "name='RX7 MIX1 INP1' RX1" ++ cset "name='RX7 Digital Volume' 88" ++ cset "name='SPK DRV Volume' 6" ++ ++ # Route has been set up, re-enable the mixer. ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:msm8974taikomtp" ++ ++ # See comment in EnableSequence ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ ++ cset "name='SLIM RX1 MUX' ZERO" ++ cset "name='RX7 MIX1 INP1' ZERO" ++ cset "name='RX7 Digital Volume' 0" ++ cset "name='SPK DRV Volume' 0" ++ ++ # See comment in EnableSequence ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ PlaybackPriority "150" ++ } ++} ++ ++SectionDevice."Headphones" { ++ #Name "Headphones" ++ Comment "Headphones" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Earpiece" ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:msm8974taikomtp" ++ ++ # We need to disable this while setting up the route, else the ++ # driver will hang if the stream is open. ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ ++ cset "name='SLIM RX1 MUX' AIF1_PB" ++ cset "name='SLIM RX2 MUX' AIF1_PB" ++ cset "name='SLIM_0_RX Channels' Two" ++ cset "name='RX1 MIX1 INP1' RX1" ++ cset "name='RX2 MIX1 INP1' RX2" ++ cset "name='CLASS_H_DSM MUX' DSM_HPHL_RX1" ++ cset "name='HPHL DAC Switch' 1" ++ cset "name='HPHL Volume' 15" ++ cset "name='HPHR Volume' 15" ++ cset "name='RX1 Digital Volume' 83" ++ cset "name='RX2 Digital Volume' 83" ++ ++ ++ ++ # Route has been set up, re-enable the mixer. ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:msm8974taikomtp" ++ ++ # See comment in EnableSequence ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ ++ cset "name='SLIM RX1 MUX' ZERO" ++ cset "name='SLIM RX2 MUX' ZERO" ++ cset "name='RX1 MIX1 INP1' ZERO" ++ cset "name='RX2 MIX1 INP1' ZERO" ++ cset "name='CLASS_H_DSM MUX' ZERO" ++ cset "name='HPHL DAC Switch' 0" ++ cset "name='HPHL Volume' 0" ++ cset "name='HPHR Volume' 0" ++ cset "name='RX1 Digital Volume' 0" ++ cset "name='RX2 Digital Volume' 0" ++ ++ # See comment in EnableSequence ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Headset" { ++ #Name "Headset" ++ Comment "Headset Microphone" ++ ++ ConflictingDevice [ ++ "Handset" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:msm8974taikomtp" ++ ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 0" ++ cset "name='AIF1_CAP Mixer SLIM TX7' 1" ++ cset "name='SLIM_0_TX Channels' One" ++ cset "name='SLIM TX7 MUX' DEC5" ++ cset "name='DEC5 MUX' ADC2" ++ cset "name='DEC5 Volume' 84" ++ cset "name='ADC2 Volume' 16" ++ cset "name='IIR1 INP1 MUX' DEC5" ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:msm8974taikomtp" ++ ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 0" ++ cset "name='AIF1_CAP Mixer SLIM TX7' 0" ++ cset "name='SLIM TX7 MUX' ZERO" ++ cset "name='DEC5 MUX' ZERO" ++ cset "name='ADC2 Volume' 0" ++ cset "name='DEC5 Volume' 0" ++ cset "name='IIR1 INP1 MUX' ZERO" ++ ] ++ ++ Value { ++ CaptureChannels "1" ++ } ++} ++ ++SectionDevice."Handset" { ++ #Name "Handset" ++ Comment "Handset Microphone" ++ ++ ConflictingDevice [ ++ "Headset" ++ ] ++ ++ EnableSequence [ ++ cdev "hw:msm8974taikomtp" ++ ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 0" ++ cset "name='AIF1_CAP Mixer SLIM TX7' 1" ++ cset "name='SLIM_0_TX Channels' One" ++ cset "name='SLIM TX7 MUX' DEC6" ++ cset "name='DEC6 MUX' ADC1" ++ cset "name='ADC1 Volume' 16" ++ cset "name='DEC6 Volume' 86" ++ cset "name='IIR1 INP1 MUX' DEC6" ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:msm8974taikomtp" ++ ++ cset "name='MultiMedia1 Mixer SLIM_0_TX' 0" ++ cset "name='AIF1_CAP Mixer SLIM TX7' 0" ++ cset "name='SLIM TX7 MUX' ZERO" ++ cset "name='DEC6 MUX' ZERO" ++ cset "name='ADC1 Volume' 0" ++ cset "name='DEC6 Volume' 0" ++ cset "name='IIR1 INP1 MUX' ZERO" ++ ] ++ ++ Value { ++ CaptureChannels "1" ++ } ++} +Index: alsa-lib-1.0.27.2/src/conf/ucm/msm8974-taiko-mtp-snd-card/VoiceCall +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ alsa-lib-1.0.27.2/src/conf/ucm/msm8974-taiko-mtp-snd-card/VoiceCall 2014-02-23 13:05:15.000000000 +0100 +@@ -0,0 +1,119 @@ ++# There is no mixer setup here - it is handled by PulseAudio's audio HAL module. ++ ++SectionVerb { ++ EnableSequence [ ++ cdev "hw:msm8974taikomtp" ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:msm8974taikomtp" ++ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0" ++ ] ++ ++ Value { ++ CapturePCM "hw:msm8974taikomtp,0" ++ PlaybackPCM "hw:msm8974taikomtp,0" ++ } ++} ++ ++SectionDevice."Earpiece" { ++ #Name "Earpiece" ++ Comment "Earpiece speaker" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Headphones" ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ ] ++ ++ DisableSequence [ ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Speaker" { ++ #Name "Speaker" ++ Comment "Main speaker" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Earpiece" ++ "Headphones" ++ ] ++ ++ EnableSequence [ ++ ] ++ ++ DisableSequence [ ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Headphones" { ++ #Name "Headphones" ++ Comment "Headphones" ++ ++ # FIXME ++ ConflictingDevice [ ++ "Earpiece" ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ ] ++ ++ DisableSequence [ ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Headset" { ++ #Name "Headset" ++ Comment "Headset Microphone" ++ ++ ConflictingDevice [ ++ "Handset" ++ ] ++ ++ EnableSequence [ ++ ] ++ ++ DisableSequence [ ++ ] ++ ++ Value { ++ CaptureChannels "1" ++ } ++} ++ ++SectionDevice."Handset" { ++ #Name "Handset" ++ Comment "Handset Microphone" ++ ++ ConflictingDevice [ ++ "Headset" ++ ] ++ ++ EnableSequence [ ++ ] ++ ++ DisableSequence [ ++ ] ++ ++ Value { ++ CaptureChannels "1" ++ } ++} +Index: alsa-lib-1.0.27.2/src/conf/ucm/msm8974-taiko-mtp-snd-card/msm8974-taiko-mtp-snd-card.conf +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ alsa-lib-1.0.27.2/src/conf/ucm/msm8974-taiko-mtp-snd-card/msm8974-taiko-mtp-snd-card.conf 2014-02-23 13:05:07.000000000 +0100 +@@ -0,0 +1,8 @@ ++SectionUseCase."HiFi" { ++ File "HiFi" ++ Comment "Play HiFi quality Music." ++} ++SectionUseCase."Voice Call" { ++ File "VoiceCall" ++ Comment "Make a phone call" ++} diff --git a/debian/patches/add-tegra-alc5632.patch b/debian/patches/add-tegra-alc5632.patch new file mode 100644 index 00000000..a6820e03 --- /dev/null +++ b/debian/patches/add-tegra-alc5632.patch @@ -0,0 +1,40 @@ +Index: alsa-lib-1.0.25/src/conf/cards/Makefile.am +=================================================================== +--- alsa-lib-1.0.25.orig/src/conf/cards/Makefile.am 2012-02-15 16:19:51.444263639 +1100 ++++ alsa-lib-1.0.25/src/conf/cards/Makefile.am 2012-02-15 16:20:48.900265439 +1100 +@@ -45,6 +45,7 @@ + RME9652.conf \ + SI7018.conf \ + SB-XFi.conf \ ++ tegra-alc5632.conf \ + TRID4DWAVENX.conf \ + USB-Audio.conf \ + YMF744.conf \ +Index: alsa-lib-1.0.25/src/conf/cards/tegra-alc5632.conf +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ alsa-lib-1.0.25/src/conf/cards/tegra-alc5632.conf 2012-02-15 16:21:06.228265983 +1100 +@@ -0,0 +1,23 @@ ++# default with dmix/dsnoop ++tegra-alc5632.pcm.default { ++ @args [ CARD ] ++ @args.CARD { ++ type string ++ } ++ type asym ++ playback.pcm { ++ type plug ++ slave.pcm { ++ @func concat ++ strings [ "dmix:CARD=" $CARD ",RATE=44100" ] ++ } ++ } ++ capture.pcm { ++ type plug ++ slave.pcm { ++ @func concat ++ strings [ "dsnoop:CARD=" $CARD ",RATE=44100" ] ++ } ++ } ++} ++ diff --git a/debian/patches/lp652035-use-extended-namehints.patch b/debian/patches/lp652035-use-extended-namehints.patch new file mode 100644 index 00000000..bff4aa63 --- /dev/null +++ b/debian/patches/lp652035-use-extended-namehints.patch @@ -0,0 +1,18 @@ +Index: alsa-lib-1.0.23/src/conf/alsa.conf +=================================================================== +--- alsa-lib-1.0.23.orig/src/conf/alsa.conf 2010-10-03 15:05:47.000000000 -0400 ++++ alsa-lib-1.0.23/src/conf/alsa.conf 2010-10-03 15:09:27.000000000 -0400 +@@ -54,11 +54,11 @@ + # + + # show all name hints also for definitions without hint {} section +-defaults.namehint.showall off ++defaults.namehint.showall on + # show just basic name hints + defaults.namehint.basic on + # show extended name hints +-defaults.namehint.extended off ++defaults.namehint.extended on + # + defaults.ctl.card 0 + defaults.pcm.card 0 diff --git a/debian/patches/series b/debian/patches/series index a827fa8e..b61cfe58 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,7 @@ -tests_lm_ftbfs.patch +lp652035-use-extended-namehints.patch +add-tegra-alc5632.patch +0001-Add-UCM-configuration-for-Nexus-4-Mako.patch +0002-Add-UCM-config-file-for-Galaxy-Nexus-maguro.patch +0003-Add-UCM-files-for-Nexus-7.patch +0004-Add-UCM-config-files-for-Nexus-10.patch +0005-Add-UCM-config-files-for-Nexus-5.patch diff --git a/debian/patches/tests_lm_ftbfs.patch b/debian/patches/tests_lm_ftbfs.patch deleted file mode 100644 index 7aa11d0b..00000000 --- a/debian/patches/tests_lm_ftbfs.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 7a794ce0d1e28f191e113742ce1604334b4187f2 Mon Sep 17 00:00:00 2001 -From: Jordi Mallach <jordi@debian.org> -Date: Fri, 28 Jun 2013 15:01:40 +0200 -Subject: [PATCH] Add -lm to test programs to fix build failure. - -Add -lm to test programs that use sin(), to fix a build failure with recent -binutils. - -Signed-off-by: Jordi Mallach <jordi@debian.org> ---- - test/Makefile.am | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/test/Makefile.am b/test/Makefile.am -index 8705402..c1896f8 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 --- -1.8.3.1 - diff --git a/debian/tests/build-seq b/debian/tests/build-seq new file mode 100644 index 00000000..d9d6ec13 --- /dev/null +++ b/debian/tests/build-seq @@ -0,0 +1,26 @@ +#!/bin/sh +# autopkgtest check: Builds a small application against libasound2, checking +# if it compiles, links and runs successfully +# Author: Rafał Cieślak <rafalcieslak256@ubuntu.com> + +set -e + +WORKDIR=$(mktemp -d) +trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM +cd $WORKDIR +cat <<EOF > asound_build_test.c +#include <alsa/asoundlib.h> +int main(int argc, char **argv) +{ + //Simple test that opens MIDI seq. That will work regardless of hardware factors. + snd_seq_t *seq_handle; + snd_seq_open(&seq_handle, "default", SND_SEQ_OPEN_INPUT, 0); + return 0; +} +EOF + +gcc -o asound_build_test asound_build_test.c -lasound +echo "build: OK" +[ -x asound_build_test ] +./asound_build_test 2>&1 +echo "run: OK" diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 00000000..0d2d2893 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,2 @@ +Tests: build-seq +Depends: libasound2-dev, build-essential 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" @@ -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; -} @@ -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: @@ -1 +1 @@ -1.0.27.2 +1.0.28 |