Improved audio device detection with new string

This commit is contained in:
inxi-svn 2008-11-05 02:05:26 +00:00
parent 582c6eecac
commit 99509242d1

75
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 0.3.19
#### version: 0.3.20
#### Date: November 4 2008
########################################################################
#### inxi is a fork of infobash, the original bash sys info script by locsmif
@ -748,7 +748,7 @@ get_audio_data()
IFS=$'\n'
A_AUDIO_DATA=( $( echo "$lspci_data" | gawk -F': ' '
{ IGNORECASE=1 }
/multimedia audio controller/ { print $NF }' ) )
/multimedia audio controller|audio device/ { print $NF }' ) )
IFS="$ORIGINAL_IFS"
for (( i=0; i < ${#A_AUDIO_DATA[@]}; i++ ))
do
@ -811,15 +811,19 @@ get_cpu_data()
cpu[nr, "model"] = $NF
}
/^cpu MHz|^clock\t+:/ {
/^cpu MHz|^clock\t+:/ {
if (!min) {
min = $NF
}
else {
if ($NF < min) { min = $NF }
if ($NF < min) {
min = $NF
}
}
if ($NF > max) { max = $NF }
if ($NF > max) {
max = $NF
}
gsub(/MHZ/,"",$NF) ## clears out for cell cpu
gsub(/.000000/,".00",$NF) ## clears out for cell cpu
cpu[nr, "speed"] = $NF
@ -869,31 +873,6 @@ get_cpu_data()
fi
done
done
## not using this now, replaced by new get_core_count, but if we need this in the future
## it will be in modules/legacy, for now leaving it here
# test for multi core cpu present
# multi_cpu=$( grep -i 'dual\|triple\|quad' <<< "${A_CPU_DATA[@]}" )
# if [ -n "$multi_cpu" ];then
# NO_CPU_COUNT=1
# else
# case $(( ${#A_CPU_DATA[@]}-1 )) in
# 2)
# CPU2="Dual"
# ;;
# 3)
# CPU2="Triple"
# ;;
# 4)
# CPU2="Quad"
# ;;
# [5-9]|[1-9][0-9])
# CPU2="${#A_CPU_DATA[@]}x"
# ;;
# *)
# unset CPU2
# ;;
# esac
# fi
IFS=","
a_cpu_working=(${A_CPU_DATA[0]})
@ -912,27 +891,37 @@ get_cpu_data()
# vmx = Intel IVT (vanderpool) virtualization extensions
CPU_FLAGS=$( echo "$CPU_FLAGS" | awk '
BEGIN {
RS=" "
ssel["sse"] = 1
ssel["sse2"] = 2
ssel["pni"] = 3
RS=" "
ssel["sse"] = 1
ssel["sse2"] = 2
ssel["pni"] = 3
sses[1] = "sse"
sses[2] = "sse2"
sses[3] = "sse3"
}
/^(nx|lm|svm|vmx)$/ {
if (s) { s = s " " $0 }
else { s = $0 }
if (s) {
s = s " " $0
}
else {
s = $0
}
}
/^(sse2?|pni)$/ {
if (ssel[$0] > sse) sse = ssel[$0]
}
if (ssel[$0] > sse) {
sse = ssel[$0]
}
}
END {
if (sse) {
if (s) s = sses[sse] " " s;
else s = sses[sse]
if (sse) {
if (s) {
s = sses[sse] " " s
}
print s
else {
s = sses[sse]
}
}
print s
}
' )
@ -952,7 +941,7 @@ get_distro_data()
a_distro_glob=(*[-_]{release,version})
cd "$OLDPWD"
shopt -u nullglob
if [ "${#a_distro_glob[@]}" -eq 1 ];then
distro_file="${a_distro_glob}"
elif [ "${#a_distro_glob[@]}" -gt 1 ];then