mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
Trying a bit more alsa tests, but I think it can't be done to compare lspci and /proc/asound/cards, because
strings aren't the same in all cases, and sometimes don't even have a single word in common. Oh well...
This commit is contained in:
parent
e1195797cc
commit
14746d68f1
26
inxi
26
inxi
|
@ -1933,13 +1933,11 @@ print_audio_data()
|
|||
card_one='Card '
|
||||
fi
|
||||
|
||||
if [[ -n ${a_audio_working[2]} ]];then
|
||||
port_data=" ${C1}at port${C2} ${a_audio_working[2]}"
|
||||
fi
|
||||
if [[ ${a_audio_working[1]} != 'alsa' ]];then
|
||||
if [[ -n ${a_audio_working[1]} ]];then
|
||||
alsa_driver=" ${C1}driver:${C2}${a_audio_working[1]}"
|
||||
fi
|
||||
# if [[ -n ${a_audio_working[2]} ]];then
|
||||
# port_data=" ${C1}at port${C2} ${a_audio_working[2]}"
|
||||
# fi
|
||||
if [[ -n ${a_audio_working[1]} && ${a_audio_working[1]} != 'alsa' ]];then
|
||||
alsa_driver=" ${C1}driver${C2} ${a_audio_working[1]}"
|
||||
fi
|
||||
audio_data="${C1}$card_one${C2}${a_audio_working[0]}$alsa_driver$port_data"
|
||||
audio_data=$( create_print_line "Audio:" "$audio_data" )
|
||||
|
@ -1950,16 +1948,16 @@ print_audio_data()
|
|||
IFS=","
|
||||
a_audio_working=( ${A_AUDIO_DATA[i]} )
|
||||
IFS="$ORIGINAL_IFS"
|
||||
port_data=''
|
||||
# port_data=''
|
||||
alsa_driver=''
|
||||
if [[ ${a_audio_working[1]} == 'port' ]];then
|
||||
port_data=" ${C1}at port${C2} ${a_audio_working[2]}"
|
||||
fi
|
||||
# if [[ ${a_audio_working[2]} == 'port' ]];then
|
||||
# port_data=" ${C1}at port${C2} ${a_audio_working[2]}"
|
||||
# fi
|
||||
# we're testing for the presence of the 2nd array item here
|
||||
if [[ ${a_audio_working[1]} != 'alsa' ]];then
|
||||
if [[ -n ${a_audio_working[1]} ]];then
|
||||
alsa_driver="${C2}driver:${a_audio_working[1]}"
|
||||
if [[ -n ${a_audio_working[1]} && ${a_audio_working[1]} != 'alsa' ]];then
|
||||
alsa_driver="${C1}driver${C2} ${a_audio_working[1]}"
|
||||
fi
|
||||
if [[ ${a_audio_working[1]} != 'alsa' ]];then
|
||||
audio_data="${C1}Card-$(( $i + 1 )) ${C2}${a_audio_working[0]}$alsa_driver$port_data"
|
||||
else
|
||||
audio_data="${C1}Sound: ${C2}${a_audio_working[0]}"
|
||||
|
|
Loading…
Reference in a new issue