Fixed up and synced audio functions

This commit is contained in:
inxi-svn 2008-11-14 07:19:20 +00:00
parent 3d91871ffb
commit 3397457c45

12
inxi
View file

@ -1942,8 +1942,8 @@ print_audio_data()
{ {
local i='' card_one='Card-1 ' audio_data='' a_audio_data='' port_data='' local i='' card_one='Card-1 ' audio_data='' a_audio_data='' port_data=''
local a_audio_working='' alsa_driver='' alsa_data='' local a_audio_working='' alsa_driver='' alsa_data=''
# set A_AUDIO_DATA
# and get als # set A_AUDIO_DATA and get alsa data
get_audio_data get_audio_data
alsa_data=$( get_audio_alsa_data ) alsa_data=$( get_audio_alsa_data )
IFS="," IFS=","
@ -1952,7 +1952,7 @@ print_audio_data()
if [[ -n ${A_AUDIO_DATA[@]} ]];then if [[ -n ${A_AUDIO_DATA[@]} ]];then
# slightly complicated because 2nd array item could be the alsa data # slightly complicated because 2nd array item could be the alsa data
if [[ ${#A_AUDIO_DATA[@]} -le 1 ]] || [[ ${#A_AUDIO_DATA[@]} -eq 2 && -n $( grep ',alsa' <<< ${A_AUDIO_DATA[@]} ) ]];then if [[ ${#A_AUDIO_DATA[@]} -le 1 ]];then
card_one='Card ' card_one='Card '
fi fi
@ -1960,7 +1960,7 @@ print_audio_data()
# port_data=" ${C1}at port${C2} ${a_audio_working[2]}" # port_data=" ${C1}at port${C2} ${a_audio_working[2]}"
# fi # fi
# this should only trigger if the /proc/asound/cards data is used, not lspci -nn # this should only trigger if the /proc/asound/cards data is used, not lspci -nn
if [[ -n ${a_audio_working[1]} && ${a_audio_working[1]} != 'alsa' ]];then if [[ -n ${a_audio_working[1]} ]];then
alsa_driver=" ${C1}driver${C2} ${a_audio_working[1]}" alsa_driver=" ${C1}driver${C2} ${a_audio_working[1]}"
fi fi
audio_data="${C1}$card_one${C2}${a_audio_working[0]}$alsa_driver$port_data" audio_data="${C1}$card_one${C2}${a_audio_working[0]}$alsa_driver$port_data"
@ -1978,10 +1978,10 @@ print_audio_data()
# port_data=" ${C1}at port${C2} ${a_audio_working[2]}" # port_data=" ${C1}at port${C2} ${a_audio_working[2]}"
# fi # fi
# we're testing for the presence of the 2nd array item here, which is the driver name # we're testing for the presence of the 2nd array item here, which is the driver name
if [[ -n ${a_audio_working[1]} && ${a_audio_working[1]} != 'alsa' ]];then if [[ -n ${a_audio_working[1]} ]];then
alsa_driver="${C1}driver${C2} ${a_audio_working[1]}" alsa_driver="${C1}driver${C2} ${a_audio_working[1]}"
fi fi
if [[ -n ${a_audio_working[1]} && ${a_audio_working[1]} != 'alsa' ]];then if [[ -n ${a_audio_working[0]} ]];then
audio_data="${C1}Card-$(( $i + 1 )) ${C2}${a_audio_working[0]}$alsa_driver$port_data" audio_data="${C1}Card-$(( $i + 1 )) ${C2}${a_audio_working[0]}$alsa_driver$port_data"
fi fi
if [[ -n $audio_data ]];then if [[ -n $audio_data ]];then