SHA256
1
0
forked from pool/alsa-utils
OBS User unknown 2009-02-16 15:03:39 +00:00 committed by Git OBS Bridge
parent 229cc8babd
commit 11f79dbc96
3 changed files with 164 additions and 1 deletions

View File

@ -1,3 +1,113 @@
diff --git a/Makefile.am b/Makefile.am
index 554617d..5296977 100644
--- a/Makefile.am
+++ b/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= TODO gitcompile
AUTOMAKE_OPTIONS=foreign
ACLOCAL_AMFLAGS = -I m4
diff --git a/alsactl/init/default b/alsactl/init/default
index 66692b3..e2dcfd6 100644
--- a/alsactl/init/default
+++ b/alsactl/init/default
@@ -11,6 +11,7 @@
# **************************************************************************
ENV{volume}:="-20dB"
+ENV{cvolume}:="12dB"
CTL{reset}="mixer"
CTL{name}="Playback Volume",PROGRAM=="__ctl_search", \
@@ -55,14 +56,21 @@ CTL{name}="PC Speaker Playback Switch",PROGRAM=="__ctl_search", \
CTL{values}="on"
CTL{reset}="mixer"
-CTL{name}="PCM Playback Volume",PROGRAM=="__ctl_search", \
- CTL{values}="$env{volume}",RESULT!="0",CTL{values}="75%"
+CTL{name}="PCM Playback Volume",PROGRAM!="__ctl_search",GOTO="pcm0_end"
+# exception - some HDA codecs have shifted dB range
+CTL{dBmin}=="-34.50dB",CTL{dBmax}=="12.00dB",CTL{values}="0dB",GOTO="pcm0_end"
+CTL{values}="$env{volume}",RESULT!="0",CTL{values}="75%"
+LABEL="pcm0_end"
CTL{name}="PCM Playback Switch",PROGRAM=="__ctl_search", \
CTL{values}="on"
CTL{reset}="mixer"
-CTL{name}="PCM Playback Volume",CTL{index}="1",PROGRAM=="__ctl_search", \
- CTL{values}="$env{volume}",RESULT!="0",CTL{values}="75%"
+CTL{name}="PCM Playback Volume",CTL{index}="1",PROGRAM!="__ctl_search", \
+ GOTO="pcm1_end"
+# exception - some HDA codecs have shifted dB range
+CTL{dBmin}=="-34.50dB",CTL{dBmax}=="12.00dB",CTL{values}="0dB",GOTO="pcm1_end"
+CTL{values}="$env{volume}",RESULT!="0",CTL{values}="75%"
+LABEL="pcm1_end"
CTL{name}="PCM Playback Switch",CTL{index}="1",PROGRAM=="__ctl_search", \
CTL{values}="on"
@@ -91,8 +99,11 @@ CTL{name}="Music Playback Switch",PROGRAM=="__ctl_search", \
CTL{values}="on"
CTL{reset}="mixer"
-CTL{name}="CD Playback Volume",PROGRAM=="__ctl_search", \
- CTL{values}="$env{volume}",RESULT!="0",CTL{values}="75%"
+CTL{name}="CD Playback Volume",PROGRAM!="__ctl_search", GOTO="cd0_end"
+# exception - some HDA codecs have shifted dB range
+CTL{dBmin}=="-34.50dB",CTL{dBmax}=="12.00dB",CTL{values}="0dB",GOTO="cd0_end"
+CTL{values}="$env{volume}",RESULT!="0",CTL{values}="75%"
+LABEL="cd0_end"
CTL{name}="CD Playback Switch",PROGRAM=="__ctl_search", \
CTL{values}="on"
@@ -130,15 +141,14 @@ ENV{volume}:="20dB"
CTL{reset}="mixer"
CTL{name}="Capture Volume",PROGRAM=="__ctl_search", \
- CTL{values}="$env{volume}",RESULT!="0",CTL{values}="75%"
+ CTL{values}="$env{cvolume}",RESULT!="0",CTL{values}="75%"
CTL{name}="Capture Switch",PROGRAM=="__ctl_search", \
CTL{values}="on"
-CTL{name}="Input Source",PROGRAM=="__ctl_search", \
- CTL{enums}=="*|Internal Mic|*",CTL{values}="Internal Mic", \
+CTL{name}="Input Source",PROGRAM!="__ctl_search", GOTO="end_input_source"
+CTL{enums}=="*|Internal Mic|*",CTL{values}="Internal Mic", \
GOTO="end_input_source"
-CTL{name}="Input Source",PROGRAM=="__ctl_search", \
- CTL{enums}=="*|Mic|*",CTL{values}="Mic"
+CTL{enums}=="*|Mic|*",CTL{values}="Mic"
LABEL="end_input_source"
CTL{name}="Internal Mic Boost",PROGRAM=="__ctl_search", \
diff --git a/alsactl/init_parse.c b/alsactl/init_parse.c
index 31ed56e..77146d2 100644
--- a/alsactl/init_parse.c
@ -20,3 +130,43 @@ index 31ed56e..77146d2 100644
if (tmp)
*tmp = '\0';
}
diff --git a/configure.in b/configure.in
index 59247ed..0facec4 100644
--- a/configure.in
+++ b/configure.in
@@ -29,10 +29,27 @@ AC_PROG_INSTALL
AC_PROG_LN_S
AM_PATH_ALSA(1.0.16)
+dnl Check components
+AC_CHECK_HEADERS([alsa/pcm.h], [have_pcm="yes"], [have_pcm="no"],
+ [#include <alsa/asoundlib.h>])
+AC_CHECK_HEADERS([alsa/mixer.h], [have_mixer="yes"], [have_mixer="no"],
+ [#include <alsa/asoundlib.h>])
+AC_CHECK_HEADERS([alsa/rawmidi.h], [have_rawmidi="yes"], [have_rawmidi="no"],
+ [#include <alsa/asoundlib.h>])
+AC_CHECK_HEADERS([alsa/seq.h], [have_seq="yes"], [have_seq="no"],
+ [#include <alsa/asoundlib.h>])
+
+AM_CONDITIONAL(HAVE_PCM, test "$have_pcm" = "yes")
+AM_CONDITIONAL(HAVE_MIXER, test "$have_mixer" = "yes")
+AM_CONDITIONAL(HAVE_RAWMIDI, test "$have_rawmidi" = "yes")
+AM_CONDITIONAL(HAVE_SEQ, test "$have_seq" = "yes")
+
dnl Disable alsamixer
CURSESINC=""
CURSESLIB=""
CURSES_CFLAGS=""
+alsamixer=
+if test "$have_mixer" = "yes"; then
AC_ARG_ENABLE(alsamixer,
[ --disable-alsamixer Disable alsamixer compilation],
[case "${enableval}" in
@@ -40,6 +57,7 @@ AC_ARG_ENABLE(alsamixer,
no) alsamixer=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-alsamixer) ;;
esac],[alsamixer=true])
+fi
AM_CONDITIONAL(ALSAMIXER, test x$alsamixer = xtrue)
dnl Disable alsaconf

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Feb 16 14:33:14 CET 2009 - tiwai@suse.de
- alsactl: init - modify default rule to better support some HDA
codecs
- Fix build with partially-installed alsa-lib
-------------------------------------------------------------------
Thu Jan 22 14:00:31 CET 2009 - tiwai@suse.de

View File

@ -28,7 +28,7 @@ Requires: dialog pciutils
AutoReqProv: on
Summary: Advanced Linux Sound Architecture Utilities
Version: 1.0.19
Release: 1
Release: 2
Source: ftp://ftp.alsa-project.org/pub/util/alsa-utils-%{package_version}.tar.bz2
Patch: alsa-utils-git-fixes.diff
Url: http://www.alsa-project.org/
@ -47,6 +47,8 @@ Authors:
%prep
%setup -q -n %{name}-%{package_version}
# fix stupid automake's automatic action
sed -i -e's/EXTRA_DIST= config.rpath /EXTRA_DIST=/' Makefile.am
%patch -p1
mv alsamixer/README alsamixer/README-alsamixer
@ -76,6 +78,10 @@ make %{?jobs:-j %jobs}
%{_datadir}/alsa
%changelog
* Mon Feb 16 2009 tiwai@suse.de
- alsactl: init - modify default rule to better support some HDA
codecs
- Fix build with partially-installed alsa-lib
* Thu Jan 22 2009 tiwai@suse.de
- updated to version 1.0.19
- use ANSI-C functions instead of index()