mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
trying a few more fine tunings
This commit is contained in:
parent
a295ba44ba
commit
cde3d78ac4
9
inxi
9
inxi
|
@ -1005,7 +1005,7 @@ get_audio_data()
|
||||||
local i='' alsa_data='' alsa_driver='' device_count=''
|
local i='' alsa_data='' alsa_driver='' device_count=''
|
||||||
|
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
|
# this first step handles the drivers for cases where the second step fails to find one
|
||||||
device_count=$( egrep -ic '(multimedia audio controller|audio device)' <<< "$lspci_data" )
|
device_count=$( egrep -ic '(multimedia audio controller|audio device)' <<< "$lspci_data" )
|
||||||
if [[ $device_count -eq 1 && -f /proc/asound/cards ]];then
|
if [[ $device_count -eq 1 && -f /proc/asound/cards ]];then
|
||||||
alsa_driver=$( gawk -F ']: ' '
|
alsa_driver=$( gawk -F ']: ' '
|
||||||
|
@ -1021,9 +1021,8 @@ get_audio_data()
|
||||||
# this is to safeguard against line breaks from results > 1, which if inserted into following
|
# this is to safeguard against line breaks from results > 1, which if inserted into following
|
||||||
# array will create a false array entry. This is a hack, not a permanent solution.
|
# array will create a false array entry. This is a hack, not a permanent solution.
|
||||||
alsa_driver=$( echo $alsa_driver )
|
alsa_driver=$( echo $alsa_driver )
|
||||||
# this isn't perfect, but if one card was found in lscpci, we're passing
|
# now we'll build the main audio data, card name, driver, and port. If no driver is found,
|
||||||
# this array constructor that card driver name. This should work for most people
|
# and if the first method above is not null, and one card is found, it will use that instead.
|
||||||
# but if you can think of anything better, please post the code patch
|
|
||||||
A_AUDIO_DATA=( $( echo "$lspci_data" | gawk -F ': ' -v alsaDriver="$alsa_driver" '
|
A_AUDIO_DATA=( $( echo "$lspci_data" | gawk -F ': ' -v alsaDriver="$alsa_driver" '
|
||||||
BEGIN { IGNORECASE=1 }
|
BEGIN { IGNORECASE=1 }
|
||||||
#/^[0-9a-f:.]+ (ethernet|network) (controller|bridge)/ || /^[0-9a-f:.]+ [^:]+: .*(ethernet|network).*$/ {
|
#/^[0-9a-f:.]+ (ethernet|network) (controller|bridge)/ || /^[0-9a-f:.]+ [^:]+: .*(ethernet|network).*$/ {
|
||||||
|
@ -1040,8 +1039,6 @@ get_audio_data()
|
||||||
cards[audioCard]++
|
cards[audioCard]++
|
||||||
while (getline && !/^$/) {
|
while (getline && !/^$/) {
|
||||||
if (/driver in use/) {
|
if (/driver in use/) {
|
||||||
|
|
||||||
gsub(/^ +| +$/, "", audioCard)
|
|
||||||
drivers[audioCard] = drivers[audioCard] gensub(/(.*): (.*)/,"\\2","g",$0) ""
|
drivers[audioCard] = drivers[audioCard] gensub(/(.*): (.*)/,"\\2","g",$0) ""
|
||||||
}
|
}
|
||||||
if (/I\/O/) {
|
if (/I\/O/) {
|
||||||
|
|
Loading…
Reference in a new issue