mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 08:35:25 +00:00
synched audio output to use usb id as well if -x runs
This commit is contained in:
parent
ab23b48ae1
commit
949019f36e
33
inxi
33
inxi
|
@ -2147,12 +2147,19 @@ get_audio_data()
|
||||||
usb_data=$( gawk '
|
usb_data=$( gawk '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
IGNORECASE=1
|
IGNORECASE=1
|
||||||
|
string=""
|
||||||
|
separator=""
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
gsub( /,/, " ", $0 )
|
gsub( /,/, " ", $0 )
|
||||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
|
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
|
||||||
for( i=7; i <= NF; i++ ) {
|
gsub(/ [ \t]+/, " ", $0)
|
||||||
printf( $i " " )
|
for ( i=7; i<= NF; i++ ) {
|
||||||
|
string = string separator $i
|
||||||
|
separator = " "
|
||||||
|
}
|
||||||
|
if ( $6 != "" ){
|
||||||
|
print string ",snd-usb-audio,,," $6
|
||||||
}
|
}
|
||||||
}' <<< "$usb_data" )
|
}' <<< "$usb_data" )
|
||||||
# this method is interesting, it shouldn't work but it does
|
# this method is interesting, it shouldn't work but it does
|
||||||
|
@ -2160,7 +2167,7 @@ get_audio_data()
|
||||||
# but until we learn why the above worked, I'm using this one, which is safer
|
# but until we learn why the above worked, I'm using this one, which is safer
|
||||||
if [[ -n $usb_data ]];then
|
if [[ -n $usb_data ]];then
|
||||||
array_count=${#A_AUDIO_DATA[@]}
|
array_count=${#A_AUDIO_DATA[@]}
|
||||||
A_AUDIO_DATA[$array_count]="$usb_data,snd-usb-audio,,"
|
A_AUDIO_DATA[$array_count]="$usb_data"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -3360,6 +3367,7 @@ get_networking_data()
|
||||||
{
|
{
|
||||||
gsub( /,/, " ", $0 )
|
gsub( /,/, " ", $0 )
|
||||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
|
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
|
||||||
|
gsub(/ [ \t]+/, " ", $0)
|
||||||
gsub(/realtek semiconductor/, "Realtek", $0)
|
gsub(/realtek semiconductor/, "Realtek", $0)
|
||||||
gsub(/davicom semiconductor/, "Davicom", $0)
|
gsub(/davicom semiconductor/, "Davicom", $0)
|
||||||
for ( i=7; i<= NF; i++ ) {
|
for ( i=7; i<= NF; i++ ) {
|
||||||
|
@ -4777,6 +4785,7 @@ print_audio_data()
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local i='' card_one='Card-1' audio_data='' a_audio_data='' port_data='' pci_bus_id=''
|
local i='' card_one='Card-1' audio_data='' a_audio_data='' port_data='' pci_bus_id=''
|
||||||
local a_audio_working='' alsa_driver='' alsa_data='' port_plural='' module_version=''
|
local a_audio_working='' alsa_driver='' alsa_data='' port_plural='' module_version=''
|
||||||
|
local bus_usb_text='' bus_usb_id=''
|
||||||
# set A_AUDIO_DATA and get alsa data
|
# 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 )
|
||||||
|
@ -4811,7 +4820,13 @@ print_audio_data()
|
||||||
port_data=" ${C1}port$port_plural${C2} ${a_audio_working[2]}"
|
port_data=" ${C1}port$port_plural${C2} ${a_audio_working[2]}"
|
||||||
fi
|
fi
|
||||||
if [[ -n ${a_audio_working[4]} && $B_EXTRA_DATA == 'true' ]];then
|
if [[ -n ${a_audio_working[4]} && $B_EXTRA_DATA == 'true' ]];then
|
||||||
pci_bus_id=" ${C1}busID:${C2} ${a_audio_working[4]}"
|
if [[ ${a_audio_working[1]} != 'snd-usb-audio' ]];then
|
||||||
|
bus_usb_text='busID'
|
||||||
|
else
|
||||||
|
bus_usb_text='USB-ID'
|
||||||
|
fi
|
||||||
|
bus_usb_id=${a_audio_working[4]}
|
||||||
|
pci_bus_id=" ${C1}$bus_usb_text:${C2} $bus_usb_id"
|
||||||
fi
|
fi
|
||||||
audio_data="${C1}$card_one${C2} ${a_audio_working[0]}$alsa_driver$port_data$pci_bus_id"
|
audio_data="${C1}$card_one${C2} ${a_audio_working[0]}$alsa_driver$port_data$pci_bus_id"
|
||||||
audio_data=$( create_print_line "Audio:" "$audio_data" )
|
audio_data=$( create_print_line "Audio:" "$audio_data" )
|
||||||
|
@ -4827,6 +4842,8 @@ print_audio_data()
|
||||||
port_plural=''
|
port_plural=''
|
||||||
module_version=''
|
module_version=''
|
||||||
pci_bus_id=''
|
pci_bus_id=''
|
||||||
|
bus_usb_text=''
|
||||||
|
bus_usb_id=''
|
||||||
if [[ -n ${a_audio_working[3]} && $B_EXTRA_DATA == 'true' ]];then
|
if [[ -n ${a_audio_working[3]} && $B_EXTRA_DATA == 'true' ]];then
|
||||||
module_version=$( print_module_version "${a_audio_working[3]}" 'audio' )
|
module_version=$( print_module_version "${a_audio_working[3]}" 'audio' )
|
||||||
elif [[ -n ${a_audio_working[1]} && $B_EXTRA_DATA == 'true' ]];then
|
elif [[ -n ${a_audio_working[1]} && $B_EXTRA_DATA == 'true' ]];then
|
||||||
|
@ -4843,7 +4860,13 @@ print_audio_data()
|
||||||
port_data=" ${C1}port$port_plural${C2} ${a_audio_working[2]}"
|
port_data=" ${C1}port$port_plural${C2} ${a_audio_working[2]}"
|
||||||
fi
|
fi
|
||||||
if [[ -n ${a_audio_working[4]} && $B_EXTRA_DATA == 'true' ]];then
|
if [[ -n ${a_audio_working[4]} && $B_EXTRA_DATA == 'true' ]];then
|
||||||
pci_bus_id=" ${C1}busID:${C2} ${a_audio_working[4]}"
|
if [[ ${a_audio_working[1]} != 'snd-usb-audio' ]];then
|
||||||
|
bus_usb_text='busID'
|
||||||
|
else
|
||||||
|
bus_usb_text='USB-ID'
|
||||||
|
fi
|
||||||
|
bus_usb_id=${a_audio_working[4]}
|
||||||
|
pci_bus_id=" ${C1}$bus_usb_text:${C2} $bus_usb_id"
|
||||||
fi
|
fi
|
||||||
if [[ -n ${a_audio_working[0]} ]];then
|
if [[ -n ${a_audio_working[0]} ]];then
|
||||||
audio_data="${C1}Card-$(( $i + 1 ))${C2} ${a_audio_working[0]}$alsa_driver$port_data$pci_bus_id"
|
audio_data="${C1}Card-$(( $i + 1 ))${C2} ${a_audio_working[0]}$alsa_driver$port_data$pci_bus_id"
|
||||||
|
|
Loading…
Reference in a new issue