mirror of
https://github.com/alsa-project/alsa-utils
synced 2025-01-03 17:29:46 +01:00
- fixed the progress bar.
- fixed the detection on 2.6 kernels. - check root priv. after parsing the option (allow normal users to see help)
This commit is contained in:
parent
80476a0170
commit
cfe0a62da7
1 changed files with 36 additions and 12 deletions
|
@ -19,12 +19,6 @@
|
||||||
|
|
||||||
version=@VERSION@
|
version=@VERSION@
|
||||||
|
|
||||||
# Check for root privileges
|
|
||||||
if [ `id -u` -ne 0 ]; then
|
|
||||||
echo "You must be root to use this script."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check for GNU/Linux distributions
|
# Check for GNU/Linux distributions
|
||||||
if [ -f /etc/SuSE-release -o -f /etc/UnitedLinux-release ]; then
|
if [ -f /etc/SuSE-release -o -f /etc/UnitedLinux-release ]; then
|
||||||
distribution="suse"
|
distribution="suse"
|
||||||
|
@ -53,7 +47,7 @@ usage() {
|
||||||
echo " -u|--uid uid set the uid for the ALSA devices (default = 0) [obsoleted]"
|
echo " -u|--uid uid set the uid for the ALSA devices (default = 0) [obsoleted]"
|
||||||
echo " -g|--gid gid set the gid for the ALSA devices (default = 0) [obsoleted]"
|
echo " -g|--gid gid set the gid for the ALSA devices (default = 0) [obsoleted]"
|
||||||
echo " -d|--devmode mode"
|
echo " -d|--devmode mode"
|
||||||
echo " set the device mode for the ALSA devices (default = 0666) [obs.]"
|
echo " set the permission for ALSA devices (default = 0666) [obs.]"
|
||||||
echo " -r|--strict set strict device mode (equiv. with -g 17 -d 0660) [obsoleted]"
|
echo " -r|--strict set strict device mode (equiv. with -g 17 -d 0660) [obsoleted]"
|
||||||
echo " -L|--log logging on $LOGFILE"
|
echo " -L|--log logging on $LOGFILE"
|
||||||
echo " -p|--probe card-name"
|
echo " -p|--probe card-name"
|
||||||
|
@ -109,6 +103,12 @@ while true ; do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Check for root privileges
|
||||||
|
if [ `id -u` -ne 0 ]; then
|
||||||
|
echo "You must be root to use this script."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# check the snd_ prefix for ALSA module options
|
# check the snd_ prefix for ALSA module options
|
||||||
# snd_ prefix is obsoleted since 0.9.0rc4.
|
# snd_ prefix is obsoleted since 0.9.0rc4.
|
||||||
|
@ -267,6 +267,9 @@ set_mixers() {
|
||||||
# some notebooks use headphone instead of master
|
# some notebooks use headphone instead of master
|
||||||
mixer Headphone 75%
|
mixer Headphone 75%
|
||||||
mixer Playback 100%
|
mixer Playback 100%
|
||||||
|
# turn off digital switches
|
||||||
|
amixer set "SB Live Analog/Digital Output Jack" off >/dev/null 2>&1
|
||||||
|
amixer set "Audigy Analog/Digital Output Jack" off >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -416,6 +419,16 @@ build_card_db () {
|
||||||
echo "ISAPNP: $id1$dev1=$id2$dev2"
|
echo "ISAPNP: $id1$dev1=$id2$dev2"
|
||||||
fi
|
fi
|
||||||
done < $MODDIR/modules.isapnpmap >> $1
|
done < $MODDIR/modules.isapnpmap >> $1
|
||||||
|
|
||||||
|
while read driver id dev devs; do
|
||||||
|
if expr $driver : 'snd-.*' >/dev/null ; then
|
||||||
|
if [ "$last_driver" != "$driver" ]; then
|
||||||
|
echo $driver.o
|
||||||
|
last_driver=$driver
|
||||||
|
fi
|
||||||
|
echo "ISAPNP: $id=$dev"
|
||||||
|
fi
|
||||||
|
done < $MODDIR/modules.pnpmap >> $1
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -426,6 +439,16 @@ probe_cards () {
|
||||||
test -r /proc/isapnp || /sbin/modprobe isa-pnp >/dev/null 2>&1
|
test -r /proc/isapnp || /sbin/modprobe isa-pnp >/dev/null 2>&1
|
||||||
if [ -r /proc/isapnp ]; then
|
if [ -r /proc/isapnp ]; then
|
||||||
cat /proc/isapnp >"$DUMP"
|
cat /proc/isapnp >"$DUMP"
|
||||||
|
elif [ -d /sys/bus/pnp/devices/00:01.00 ]; then
|
||||||
|
# use 2.6 kernel's sysfs output
|
||||||
|
# fake the isapnp dump
|
||||||
|
# unfortunately, there is no card name information!
|
||||||
|
( cd /sys/bus/pnp/devices
|
||||||
|
for i in *:*.00; do
|
||||||
|
id=`cat $i/id`
|
||||||
|
echo "Card 0 '$id:ISAPnP $id' " >> "$DUMP"
|
||||||
|
done
|
||||||
|
)
|
||||||
else
|
else
|
||||||
echo -n >"$DUMP"
|
echo -n >"$DUMP"
|
||||||
fi
|
fi
|
||||||
|
@ -458,13 +481,13 @@ BEGIN {
|
||||||
sub(/.o$/, "");
|
sub(/.o$/, "");
|
||||||
driver=$0;
|
driver=$0;
|
||||||
perc=(idx * 100) / (ncards + 1);
|
perc=(idx * 100) / (ncards + 1);
|
||||||
print perc;
|
print int(perc);
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
/^[<literal space><literal tab>]*PCI: /{
|
/^[<literal space><literal tab>]*PCI: /{
|
||||||
gsub(/0x/, "");
|
gsub(/0x/, "");
|
||||||
gsub(/=/, ":");
|
gsub(/=/, ":");
|
||||||
x = sprintf ("'$lspci' -n | grep '"'Class 0401'"' | grep %s", $2);
|
x = sprintf ("'$lspci' -n 2>/dev/null| grep '"'Class 0401'"' | grep %s", $2);
|
||||||
if (system (x) == 0)
|
if (system (x) == 0)
|
||||||
printf "%s %s\n", $2, driver >>"'"$FOUND"'"
|
printf "%s %s\n", $2, driver >>"'"$FOUND"'"
|
||||||
}
|
}
|
||||||
|
@ -484,6 +507,7 @@ BEGIN {
|
||||||
while read i; do
|
while read i; do
|
||||||
i=${i##*/}
|
i=${i##*/}
|
||||||
i=${i%%.o}
|
i=${i%%.o}
|
||||||
|
i=${i%%.ko}
|
||||||
echo "PowerMac $i" >> $FOUND
|
echo "PowerMac $i" >> $FOUND
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
@ -494,7 +518,7 @@ BEGIN {
|
||||||
#
|
#
|
||||||
find_device_name () {
|
find_device_name () {
|
||||||
if expr "$1" : '[0-9a-f][0-9a-f][0-9a-f][0-9a-f]:[0-9a-f][0-9a-f][0-9a-f][0-9a-f]' >/dev/null; then
|
if expr "$1" : '[0-9a-f][0-9a-f][0-9a-f][0-9a-f]:[0-9a-f][0-9a-f][0-9a-f][0-9a-f]' >/dev/null; then
|
||||||
$lspci -d $1 | sed -e 's/^..:..\.. Multimedia audio controller: //g'
|
$lspci -d $1 2>/dev/null| sed -e 's/^.*:..\.. Multimedia audio controller: //g'
|
||||||
return
|
return
|
||||||
elif expr "$1" : '[A-Z@][A-Z@][A-Z@][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' >/dev/null; then
|
elif expr "$1" : '[A-Z@][A-Z@][A-Z@][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' >/dev/null; then
|
||||||
cardname=`grep '^Card [0-9]\+ '\'$1':' $DUMP | head -n 1 | sed -e 's/^Card [0-9]\+ '\''.*:\(.*\)'\'' .*$/\1/'`
|
cardname=`grep '^Card [0-9]\+ '\'$1':' $DUMP | head -n 1 | sed -e 's/^Card [0-9]\+ '\''.*:\(.*\)'\'' .*$/\1/'`
|
||||||
|
@ -1034,7 +1058,7 @@ devs_found=()
|
||||||
|
|
||||||
if [ -s "$FOUND" ]; then
|
if [ -s "$FOUND" ]; then
|
||||||
while read dev card ; do
|
while read dev card ; do
|
||||||
/sbin/modprobe -a -l | grep $card'\.o' >/dev/null 2>&1 || continue
|
/sbin/modprobe -a -l | grep -E $card'\.(o|ko)' >/dev/null 2>&1 || continue
|
||||||
cardname=`find_device_name $dev | cut -c 1-64`
|
cardname=`find_device_name $dev | cut -c 1-64`
|
||||||
if [ -z "$cardname" ]; then
|
if [ -z "$cardname" ]; then
|
||||||
cardname="$card"
|
cardname="$card"
|
||||||
|
@ -1048,7 +1072,7 @@ if [ x$devs_found != x ]; then
|
||||||
# check for TP600E
|
# check for TP600E
|
||||||
#
|
#
|
||||||
if [ ${devs_found[0]} = cs46xx ]; then
|
if [ ${devs_found[0]} = cs46xx ]; then
|
||||||
if $lspci -nv | grep -q "Subsystem: 1014:1010"; then
|
if $lspci -nv 2>/dev/null| grep -q "Subsystem: 1014:1010"; then
|
||||||
if $DIALOG --yesno "
|
if $DIALOG --yesno "
|
||||||
Looks like you having a Thinkpad 600E or 770 notebook.
|
Looks like you having a Thinkpad 600E or 770 notebook.
|
||||||
On this notebook, CS4236 driver should be used
|
On this notebook, CS4236 driver should be used
|
||||||
|
|
Loading…
Reference in a new issue