summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2004-03-19 13:29:23 +0000
committerTakashi Iwai <tiwai@suse.de>2004-03-19 13:29:23 +0000
commit789ca41f1b45aa5bf602eccf8d1400ba9865df94 (patch)
tree86235ac28ee62fd61b7549936117502dbb2ece34
parente9dc0c0ace8b2468ec2e86fb461abcd59cb2969d (diff)
downloadalsa-utils-789ca41f1b45aa5bf602eccf8d1400ba9865df94.tar.gz
fixed the legacy detection with the recent modprobe
-rw-r--r--alsaconf/alsaconf.in14
1 files changed, 12 insertions, 2 deletions
diff --git a/alsaconf/alsaconf.in b/alsaconf/alsaconf.in
index cd022a6..841c13e 100644
--- a/alsaconf/alsaconf.in
+++ b/alsaconf/alsaconf.in
@@ -723,7 +723,12 @@ check_irq_avail () {
ac_try_load () {
test $do_logging = 1 && echo "$1 ${*:2}" >> $LOGFILE
/sbin/modprobe snd-$1 ${*:2} >/dev/null 2>&1
- $lsmod | grep -E '(snd-|snd_)'$1 >/dev/null 2>&1 || return 1
+ if $lsmod | grep -E '^(snd-|snd_)'$1' ' >/dev/null 2>&1; then
+ : ;
+ else
+ modprobe -r snd-$1 >/dev/null 2>&1
+ return 1
+ fi
# mute mixers
amixer set Master 0% mute >/dev/null 2>&1
@@ -757,7 +762,12 @@ ac_try_load () {
ac_try_capture () {
test $do_logging = 1 && echo "$1 ${*:2}" >> $LOGFILE
/sbin/modprobe snd-$1 ${*:3} >/dev/null 2>&1
- $lsmod | grep -E '(snd-|snd_)'$1 >/dev/null 2>&1 || return 1
+ if $lsmod | grep -E '^(snd-|snd_)'$1' ' >/dev/null 2>&1; then
+ : ;
+ else
+ modprobe -r snd-$1 >/dev/null 2>&1
+ return 1
+ fi
# mute mixers
amixer set Master 0% mute >/dev/null 2>&1