Trying to add driver to output

This commit is contained in:
inxi-svn 2008-11-14 02:33:04 +00:00
parent 2a7b3976cd
commit 8284050b51

18
inxi
View file

@ -990,7 +990,7 @@ set_calculated_variables()
## create array of sound cards installed on system, and if found, use asound data as well
get_audio_data()
{
local i='' alsa_index=0
local i='' alsa_index=0 alsa_driver=''
IFS=$'\n'
A_AUDIO_DATA=( $( echo "$lspci_data" | gawk -F': ' '
@ -1017,10 +1017,17 @@ get_audio_data()
if [[ ${#A_AUDIO_DATA[@]} -eq 0 ]];then
A_AUDIO_DATA[0]='Failed to Detect Sound Card!'
fi
# now we'll add in the alsa data if the file exists
# now we'll add in the alsa data if the file exists
alsa_index=${#A_AUDIO_DATA[@]}
if [[ -e /proc/asound/version ]];then
A_AUDIO_DATA[$alsa_index]=$( gawk '{
if [[ -f /proc/asound/cards ]];then
alsa_driver=$( gawk -F 'with ' '{
gsub(" at.*", "", $2)
print $2
}' /proc/asound/cards )
fi
echo alsa_driver $alsa_driver
A_AUDIO_DATA[$alsa_index]=$( gawk -v alsaDriver="$alsa_driver" '{
{ IGNORECASE=1 }
# some alsa strings have the build date in (...)
# also remove trailing .
@ -1028,8 +1035,11 @@ get_audio_data()
gsub(/,/, " ", $0)
gsub(/^ +| +$/, "", $0)
gsub(/ [ \t]+/, " ", $0)
if ( alsaDriver != "" ){
alsaDriver=","alsaDriver
}
if ( $0 != "" ){
print $0 ",alsa"
print $0 ",alsa"alsaDriver
}
}' /proc/asound/version )
fi