Skip to content

Commit

Permalink
Update alsa-utils to version 1.0.23.
Browse files Browse the repository at this point in the history
Change-Id: I71d4636823c3ca585c2c8d3362ec9d227bda9e21
  • Loading branch information
smcneil committed Jul 2, 2010
1 parent b8cab81 commit 99c5118
Show file tree
Hide file tree
Showing 87 changed files with 10,083 additions and 4,114 deletions.
25 changes: 17 additions & 8 deletions Makefile.am
@@ -1,16 +1,25 @@
INCLUDES=-I$(top_srcdir)/include

SUBDIRS = include alsactl utils m4 po
if ALSAMIXER
ALSAMIXER_DIR=alsamixer
else
ALSAMIXER_DIR=
SUBDIRS += alsamixer
endif
if HAVE_MIXER
SUBDIRS += amixer
endif
if HAVE_RAWMIDI
SUBDIRS += amidi
endif
if ALSACONF
ALSACONF_DIR=alsaconf
else
ALSACONF_DIR=
SUBDIRS += alsaconf
endif
SUBDIRS= include alsactl $(ALSACONF_DIR) $(ALSAMIXER_DIR) amidi amixer \
aplay iecset seq speaker-test utils m4 po
if HAVE_PCM
SUBDIRS += aplay iecset speaker-test
endif
if HAVE_SEQ
SUBDIRS += seq
endif

EXTRA_DIST= config.rpath TODO gitcompile
AUTOMAKE_OPTIONS=foreign
ACLOCAL_AMFLAGS = -I m4
Expand Down
29 changes: 20 additions & 9 deletions Makefile.in
Expand Up @@ -35,6 +35,12 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@ALSAMIXER_TRUE@am__append_1 = alsamixer
@HAVE_MIXER_TRUE@am__append_2 = amixer
@HAVE_RAWMIDI_TRUE@am__append_3 = amidi
@ALSACONF_TRUE@am__append_4 = alsaconf
@HAVE_PCM_TRUE@am__append_5 = aplay iecset speaker-test
@HAVE_SEQ_TRUE@am__append_6 = seq
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/alsaconf/po/Makefile.in \
$(top_srcdir)/configure ABOUT-NLS COPYING ChangeLog INSTALL \
Expand Down Expand Up @@ -65,8 +71,8 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
uninstall-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = include alsactl alsaconf alsamixer amidi amixer aplay \
iecset seq speaker-test utils m4 po
DIST_SUBDIRS = include alsactl utils m4 po alsamixer amixer amidi \
alsaconf aplay iecset speaker-test seq
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
Expand Down Expand Up @@ -111,6 +117,14 @@ EXEEXT = @EXEEXT@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
HAVE_MIXER_FALSE = @HAVE_MIXER_FALSE@
HAVE_MIXER_TRUE = @HAVE_MIXER_TRUE@
HAVE_PCM_FALSE = @HAVE_PCM_FALSE@
HAVE_PCM_TRUE = @HAVE_PCM_TRUE@
HAVE_RAWMIDI_FALSE = @HAVE_RAWMIDI_FALSE@
HAVE_RAWMIDI_TRUE = @HAVE_RAWMIDI_TRUE@
HAVE_SEQ_FALSE = @HAVE_SEQ_FALSE@
HAVE_SEQ_TRUE = @HAVE_SEQ_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
Expand All @@ -121,6 +135,7 @@ LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBRT = @LIBRT@
LIBS = @LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
Expand Down Expand Up @@ -200,13 +215,9 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
xmlto = @xmlto@
INCLUDES = -I$(top_srcdir)/include
@ALSAMIXER_FALSE@ALSAMIXER_DIR =
@ALSAMIXER_TRUE@ALSAMIXER_DIR = alsamixer
@ALSACONF_FALSE@ALSACONF_DIR =
@ALSACONF_TRUE@ALSACONF_DIR = alsaconf
SUBDIRS = include alsactl $(ALSACONF_DIR) $(ALSAMIXER_DIR) amidi amixer \
aplay iecset seq speaker-test utils m4 po

SUBDIRS = include alsactl utils m4 po $(am__append_1) $(am__append_2) \
$(am__append_3) $(am__append_4) $(am__append_5) \
$(am__append_6)
EXTRA_DIST = config.rpath TODO gitcompile
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
Expand Down
9 changes: 9 additions & 0 deletions alsaconf/Makefile.in
Expand Up @@ -102,6 +102,14 @@ EXEEXT = @EXEEXT@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
HAVE_MIXER_FALSE = @HAVE_MIXER_FALSE@
HAVE_MIXER_TRUE = @HAVE_MIXER_TRUE@
HAVE_PCM_FALSE = @HAVE_PCM_FALSE@
HAVE_PCM_TRUE = @HAVE_PCM_TRUE@
HAVE_RAWMIDI_FALSE = @HAVE_RAWMIDI_FALSE@
HAVE_RAWMIDI_TRUE = @HAVE_RAWMIDI_TRUE@
HAVE_SEQ_FALSE = @HAVE_SEQ_FALSE@
HAVE_SEQ_TRUE = @HAVE_SEQ_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
Expand All @@ -112,6 +120,7 @@ LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBRT = @LIBRT@
LIBS = @LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
Expand Down
21 changes: 18 additions & 3 deletions alsaconf/alsaconf.in
Expand Up @@ -291,6 +291,8 @@ esac

# cfgfile = base config file to remove/update the sound setting
# cfgout = new config file to write the sound setting (if different from $cfgfile)
cfgout=""
cfgoldout=""
if [ -n "$cfgfile" ]; then
if [ ! -r "$cfgfile" ]; then
xecho "ERROR: The config file doesn't exist: "
Expand All @@ -301,10 +303,22 @@ else
if [ "$distribution" = "gentoo" ]; then
cfgfile="/etc/modules.d/alsa"
elif [ "$kernel" = "new" ]; then
cfgfile="/etc/modprobe.conf"
if [ -d /etc/modprobe.d ]; then
cfgout="/etc/modprobe.d/sound"
cfgout="/etc/modprobe.d/50-sound.conf"
cfgoldout="/etc/modprobe.d/sound"
if [ ! -f $cfgout ]; then
modver=$(modprobe -V | sed -e's/^module-init-tools version //')
case "$modver" in
3.[789]*)
;;
*)
cfgout="/etc/modprobe.d/sound"
cfgoldout=""
;;
esac
fi
fi
cfgfile="/etc/modprobe.conf"
elif [ "$distribution" = "debian" ]; then
cfgfile="/etc/modutils/sound"
elif [ -e /etc/modules.conf ]; then
Expand Down Expand Up @@ -818,7 +832,7 @@ ac_config_card () {
msg=$(xmsg "
Configuring %s
Do you want to modify %s (and %s if present)?" $CARD_DRIVER $cfgout $cfgfile)
$DIALOG --yesno "$msg" 8 50 || acex 0
$DIALOG --yesno "$msg" 10 50 || acex 0
else
msg=$(xmsg "
Configuring %s
Expand Down Expand Up @@ -875,6 +889,7 @@ alias sound-slot-0 $CARD_DRIVER" >> $addcfg
if [ -n "$cfgout" ]; then
[ ! -r "$cfgfile" ] || cmp -s "$TMP" "$cfgfile" || cat "$TMP" > "$cfgfile"
cmp -s "$addcfg" "$cfgout" || cat "$addcfg" > "$cfgout"
test -n "$cfgoldout" && rm -f "$cfgoldout"
else
echo "$ACB
# --- ALSACONF version $version ---" >> $TMP
Expand Down
9 changes: 9 additions & 0 deletions alsactl/Makefile.in
Expand Up @@ -119,6 +119,14 @@ EXEEXT = @EXEEXT@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
HAVE_MIXER_FALSE = @HAVE_MIXER_FALSE@
HAVE_MIXER_TRUE = @HAVE_MIXER_TRUE@
HAVE_PCM_FALSE = @HAVE_PCM_FALSE@
HAVE_PCM_TRUE = @HAVE_PCM_TRUE@
HAVE_RAWMIDI_FALSE = @HAVE_RAWMIDI_FALSE@
HAVE_RAWMIDI_TRUE = @HAVE_RAWMIDI_TRUE@
HAVE_SEQ_FALSE = @HAVE_SEQ_FALSE@
HAVE_SEQ_TRUE = @HAVE_SEQ_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
Expand All @@ -129,6 +137,7 @@ LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBRT = @LIBRT@
LIBS = @LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
Expand Down
7 changes: 4 additions & 3 deletions alsactl/alsactl.c
Expand Up @@ -97,7 +97,8 @@ int main(int argc, char *argv[])
};
char *cfgfile = SYS_ASOUNDRC;
char *initfile = DATADIR "/init/00main";
char *cardname, **tmp, ncardname[16];
char *cardname, ncardname[16];
const char *const *tmp;
int removestate = 0;
int init_fallback = 1; /* new default behavior */
int res;
Expand All @@ -106,7 +107,7 @@ int main(int argc, char *argv[])
while (1) {
int c;

if ((c = getopt_long(argc, argv, "hdvf:FgE:i:Pr:R", long_option, NULL)) < 0)
if ((c = getopt_long(argc, argv, "hdvf:FgE:i:IPr:R", long_option, NULL)) < 0)
break;
switch (c) {
case 'h':
Expand Down Expand Up @@ -188,5 +189,5 @@ int main(int argc, char *argv[])
}

snd_config_update_free_global();
return res < 0 ? res : 0;
return res < 0 ? -res : 0;
}
10 changes: 5 additions & 5 deletions alsactl/alsactl.h
Expand Up @@ -34,16 +34,16 @@ extern char *statefile;

#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
#define cerror(cond, ...) do {\
if (cond) { \
fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \
if (cond || debugflag) { \
fprintf(stderr, "%s%s: %s:%d: ", debugflag ? "WARNING: " : "", command, __FUNCTION__, __LINE__); \
fprintf(stderr, __VA_ARGS__); \
putc('\n', stderr); \
} \
} while (0)
#else
#define cerror(cond, args...) do {\
if (cond) { \
fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \
if (cond || debugflag) { \
fprintf(stderr, "%s%s: %s:%d: ", debugflag ? "WARNING: " : "", command, __FUNCTION__, __LINE__); \
fprintf(stderr, ##args); \
putc('\n', stderr); \
} \
Expand Down Expand Up @@ -78,7 +78,7 @@ int generate_names(const char *cfgfile);
int file_map(const char *filename, char **buf, size_t *bufsize);
void file_unmap(void *buf, size_t bufsize);
size_t line_width(const char *buf, size_t bufsize, size_t pos);
void initfailed(int cardnumber, const char *reason);
void initfailed(int cardnumber, const char *reason, int exitcode);

static inline int hextodigit(int c)
{
Expand Down
41 changes: 38 additions & 3 deletions alsactl/alsactl_init.xml
Expand Up @@ -270,6 +270,24 @@
comma (,).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>do_search</option></term>
<listitem>
<para>Search for a control. Value "1" is returned
if a control was found. The CTL{name} key might
contain match characters * and ?. An control index
might be specified as first argument starting from
zero (e.g. CTL{do_search 2}="1").</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>do_count</option></term>
<listitem>
<para>Search for a controls and return total count
of matched ones. The CTL{name} key might contain match
characters * and ?.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
Expand All @@ -279,7 +297,7 @@
<listitem>
<para>The relative path to sysfs subsystem specifying
the root directory of a soundcard device. Usually,
it should be set to "/class/sound/controlC$cardinfo{card}/device".
it should be set to "/class/sound/card$cardinfo{card}/device".
</para>
</listitem>
</varlistentry>
Expand Down Expand Up @@ -410,6 +428,15 @@
next key on line).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>CTL{write}</option></term>
<listitem>
<para>Value is set (written) also to soundcard's control
device (all control values are set to specified value).
The result of set operation is true when operation
succeed (it means continue with next key on line).</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>ENV{<replaceable>key</replaceable>}</option></term>
Expand Down Expand Up @@ -439,7 +466,8 @@
<varlistentry>
<term><option>GOTO</option></term>
<listitem>
<para>Jumps to the next LABEL with a matching name</para>
<para>Jumps to the next LABEL with a matching name.
The goto cannot jump backward.</para>
</listitem>
</varlistentry>

Expand All @@ -462,7 +490,7 @@
<listitem>
<para>The relative path to sysfs subsystem specifying
the root directory of a soundcard device. Usually,
it should be set to "/class/sound/controlC$cardinfo{card}/device".
it should be set to "/class/sound/card$cardinfo{card}/device".
</para>
</listitem>
</varlistentry>
Expand Down Expand Up @@ -552,6 +580,13 @@
</listitem>
</varlistentry>

<varlistentry>
<term><option>$config{<replaceable>key</replaceable>}</option>, <option>%g{<replaceable>key</replaceable>}</option></term>
<listitem>
<para>The value of a configuration variable. See CONFIG{} for more details.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>%%</option></term>
<listitem>
Expand Down
5 changes: 4 additions & 1 deletion alsactl/init/00main
Expand Up @@ -2,7 +2,9 @@
# See 'man alsactl_init' for syntax.

# set root device directory in sysfs for soundcard for ATTR{} command
CONFIG{sysfs_device}="/class/sound/controlC$cardinfo{card}/device"
CONFIG{sysfs_device}="/class/sound/card$cardinfo{card}/device"
ACCESS!="$sysfsroot$config{sysfs_device}", \
CONFIG{sysfs_device}="/class/sound/controlC$cardinfo{card}/device"

# test for extra commands
ENV{CMD}=="help", INCLUDE="help", GOTO="00main_end"
Expand All @@ -29,6 +31,7 @@ RESULT=="skip", GOTO="init_end"

# real ALSA configuration database
CARDINFO{driver}=="HDA-Intel", INCLUDE="hda", GOTO="init_end"
CARDINFO{driver}=="CA0106", INCLUDE="ca0106", GOTO="init_end"
CARDINFO{driver}=="Test", INCLUDE="test", GOTO="init_end"

LABEL="init_end"
Expand Down
9 changes: 9 additions & 0 deletions alsactl/init/Makefile.in
Expand Up @@ -95,6 +95,14 @@ EXEEXT = @EXEEXT@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
HAVE_MIXER_FALSE = @HAVE_MIXER_FALSE@
HAVE_MIXER_TRUE = @HAVE_MIXER_TRUE@
HAVE_PCM_FALSE = @HAVE_PCM_FALSE@
HAVE_PCM_TRUE = @HAVE_PCM_TRUE@
HAVE_RAWMIDI_FALSE = @HAVE_RAWMIDI_FALSE@
HAVE_RAWMIDI_TRUE = @HAVE_RAWMIDI_TRUE@
HAVE_SEQ_FALSE = @HAVE_SEQ_FALSE@
HAVE_SEQ_TRUE = @HAVE_SEQ_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
Expand All @@ -105,6 +113,7 @@ LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBRT = @LIBRT@
LIBS = @LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
Expand Down

0 comments on commit 99c5118

Please sign in to comment.