mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
Trying alsa output
This commit is contained in:
parent
0eec869c41
commit
522b114a7a
17
inxi
17
inxi
|
@ -990,7 +990,7 @@ set_calculated_variables()
|
|||
## create array of sound cards installed on system
|
||||
get_audio_data()
|
||||
{
|
||||
local i=''
|
||||
local i='' alsa_index=0
|
||||
|
||||
IFS=$'\n'
|
||||
A_AUDIO_DATA=( $( echo "$lspci_data" | gawk -F': ' '
|
||||
|
@ -1017,6 +1017,11 @@ 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
|
||||
alsa_index=${#A_AUDIO_DATA[@]}
|
||||
if [[ -e /proc/asound/version ]];then
|
||||
A_AUDIO_DATA[$alsa_index]="$( cat /proc/asound/version ),alsa"
|
||||
fi
|
||||
}
|
||||
|
||||
## create A_CPU_CORE_DATA, currently with two values: integer core count; core string text
|
||||
|
@ -1925,10 +1930,14 @@ print_audio_data()
|
|||
a_audio_working=( ${A_AUDIO_DATA[i]} )
|
||||
IFS="$ORIGINAL_IFS"
|
||||
port_data=''
|
||||
if [[ -n ${a_audio_working[1]} ]];then
|
||||
port_data=" ${C1}at port${C2} ${a_audio_working[1]}"
|
||||
if [[ ${a_audio_working[1]} == 'port' ]];then
|
||||
port_data=" ${C1}at port${C2} ${a_audio_working[2]}"
|
||||
fi
|
||||
if [[ ${a_audio_working[1]} != 'alsa' ]];then
|
||||
audio_data="${C1}Card-$(( $i + 1 )) ${C2}${a_audio_working[0]}$port_data"
|
||||
else
|
||||
audio_data="${C1}Sound Driver: ${C2}${a_audio_working[0]}"
|
||||
fi
|
||||
audio_data="${C1}Card-$(( $i + 1 )) ${C2}${a_audio_working[0]}$port_data"
|
||||
audio_data=$( create_print_line " " "$audio_data" )
|
||||
print_screen_output "$audio_data"
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue