* [PATCH] alsa-info: Run without lspci (if there is no pci bus)
@ 2013-08-09 12:47 David Henningsson
2013-08-09 13:55 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: David Henningsson @ 2013-08-09 12:47 UTC (permalink / raw)
To: tiwai, alsa-devel; +Cc: David Henningsson
On some embedded ARM hardware, there is no pci bus. In that case,
do not require lspci so we can still get as much info as we can.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
---
alsa/utils/alsa-info.sh | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/alsa/utils/alsa-info.sh b/alsa/utils/alsa-info.sh
index 9d996aa..2280af5 100755
--- a/alsa/utils/alsa-info.sh
+++ b/alsa/utils/alsa-info.sh
@@ -393,8 +393,10 @@ trap cleanup 0
if [ "$PROCEED" = "yes" ]; then
if [ -z "$LSPCI" ]; then
- echo "This script requires lspci. Please install it, and re-run this script."
- exit 0
+ if [ -d /sys/bus/pci ]; then
+ echo "This script requires lspci. Please install it, and re-run this script."
+ exit 0
+ fi
fi
#Fetch the info and store in temp files/variables
@@ -407,8 +409,6 @@ KERNEL_OS=`uname -o`
ALSA_DRIVER_VERSION=`cat /proc/asound/version |head -n1|awk {'print $7'} |sed 's/\.$//'`
get_alsa_library_version
ALSA_UTILS_VERSION=`amixer -v |awk {'print $3'}`
-VENDOR_ID=`lspci -vn | grep 040[1-3] | awk -F':' '{print $3}'| awk {'print substr($0, 2);}' >$TEMPDIR/vendor_id.tmp`
-DEVICE_ID=`lspci -vn | grep 040[1-3] | awk -F':' '{print $4}'| awk {'print $1'} >$TEMPDIR/device_id.tmp`
LAST_CARD=$((`grep "]: " /proc/asound/cards | wc -l` - 1 ))
ESDINST=$(which esd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
@@ -434,7 +434,9 @@ fi
cat /proc/asound/modules 2>/dev/null|awk {'print $2'}>$TEMPDIR/alsamodules.tmp
cat /proc/asound/cards >$TEMPDIR/alsacards.tmp
+if [[ ! -z "$LSPCI" ]]; then
lspci |grep -i "multi\|audio">$TEMPDIR/lspci.tmp
+fi
#Check for HDA-Intel cards codec#*
cat /proc/asound/card*/codec\#* > $TEMPDIR/alsa-hda-intel.tmp 2> /dev/null
@@ -547,6 +549,8 @@ echo "" >> $FILE
cat $TEMPDIR/alsacards.tmp >> $FILE
echo "" >> $FILE
echo "" >> $FILE
+
+if [[ ! -z "$LSPCI" ]]; then
echo "!!PCI Soundcards installed in the system" >> $FILE
echo "!!--------------------------------------" >> $FILE
echo "" >> $FILE
@@ -559,6 +563,7 @@ echo "" >> $FILE
lspci -vvn |grep -A1 040[1-3] >> $FILE
echo "" >> $FILE
echo "" >> $FILE
+fi
if [ "$SNDOPTIONS" ]
then
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] alsa-info: Run without lspci (if there is no pci bus)
2013-08-09 12:47 [PATCH] alsa-info: Run without lspci (if there is no pci bus) David Henningsson
@ 2013-08-09 13:55 ` Takashi Iwai
2013-08-27 0:12 ` David Henningsson
0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2013-08-09 13:55 UTC (permalink / raw)
To: David Henningsson; +Cc: alsa-devel
At Fri, 9 Aug 2013 14:47:49 +0200,
David Henningsson wrote:
>
> On some embedded ARM hardware, there is no pci bus. In that case,
> do not require lspci so we can still get as much info as we can.
>
> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Thanks, applied to my tree.
Takashi
> ---
> alsa/utils/alsa-info.sh | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/alsa/utils/alsa-info.sh b/alsa/utils/alsa-info.sh
> index 9d996aa..2280af5 100755
> --- a/alsa/utils/alsa-info.sh
> +++ b/alsa/utils/alsa-info.sh
> @@ -393,8 +393,10 @@ trap cleanup 0
> if [ "$PROCEED" = "yes" ]; then
>
> if [ -z "$LSPCI" ]; then
> - echo "This script requires lspci. Please install it, and re-run this script."
> - exit 0
> + if [ -d /sys/bus/pci ]; then
> + echo "This script requires lspci. Please install it, and re-run this script."
> + exit 0
> + fi
> fi
>
> #Fetch the info and store in temp files/variables
> @@ -407,8 +409,6 @@ KERNEL_OS=`uname -o`
> ALSA_DRIVER_VERSION=`cat /proc/asound/version |head -n1|awk {'print $7'} |sed 's/\.$//'`
> get_alsa_library_version
> ALSA_UTILS_VERSION=`amixer -v |awk {'print $3'}`
> -VENDOR_ID=`lspci -vn | grep 040[1-3] | awk -F':' '{print $3}'| awk {'print substr($0, 2);}' >$TEMPDIR/vendor_id.tmp`
> -DEVICE_ID=`lspci -vn | grep 040[1-3] | awk -F':' '{print $4}'| awk {'print $1'} >$TEMPDIR/device_id.tmp`
> LAST_CARD=$((`grep "]: " /proc/asound/cards | wc -l` - 1 ))
>
> ESDINST=$(which esd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
> @@ -434,7 +434,9 @@ fi
>
> cat /proc/asound/modules 2>/dev/null|awk {'print $2'}>$TEMPDIR/alsamodules.tmp
> cat /proc/asound/cards >$TEMPDIR/alsacards.tmp
> +if [[ ! -z "$LSPCI" ]]; then
> lspci |grep -i "multi\|audio">$TEMPDIR/lspci.tmp
> +fi
>
> #Check for HDA-Intel cards codec#*
> cat /proc/asound/card*/codec\#* > $TEMPDIR/alsa-hda-intel.tmp 2> /dev/null
> @@ -547,6 +549,8 @@ echo "" >> $FILE
> cat $TEMPDIR/alsacards.tmp >> $FILE
> echo "" >> $FILE
> echo "" >> $FILE
> +
> +if [[ ! -z "$LSPCI" ]]; then
> echo "!!PCI Soundcards installed in the system" >> $FILE
> echo "!!--------------------------------------" >> $FILE
> echo "" >> $FILE
> @@ -559,6 +563,7 @@ echo "" >> $FILE
> lspci -vvn |grep -A1 040[1-3] >> $FILE
> echo "" >> $FILE
> echo "" >> $FILE
> +fi
>
> if [ "$SNDOPTIONS" ]
> then
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] alsa-info: Run without lspci (if there is no pci bus)
2013-08-09 13:55 ` Takashi Iwai
@ 2013-08-27 0:12 ` David Henningsson
2013-08-29 16:11 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: David Henningsson @ 2013-08-27 0:12 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
On 08/09/2013 03:55 PM, Takashi Iwai wrote:
> At Fri, 9 Aug 2013 14:47:49 +0200,
> David Henningsson wrote:
>>
>> On some embedded ARM hardware, there is no pci bus. In that case,
>> do not require lspci so we can still get as much info as we can.
>>
>> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
>
> Thanks, applied to my tree.
Ping - did this ever get pushed to the official alsa-info?
>
>
> Takashi
>
>> ---
>> alsa/utils/alsa-info.sh | 13 +++++++++----
>> 1 file changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/alsa/utils/alsa-info.sh b/alsa/utils/alsa-info.sh
>> index 9d996aa..2280af5 100755
>> --- a/alsa/utils/alsa-info.sh
>> +++ b/alsa/utils/alsa-info.sh
>> @@ -393,8 +393,10 @@ trap cleanup 0
>> if [ "$PROCEED" = "yes" ]; then
>>
>> if [ -z "$LSPCI" ]; then
>> - echo "This script requires lspci. Please install it, and re-run this script."
>> - exit 0
>> + if [ -d /sys/bus/pci ]; then
>> + echo "This script requires lspci. Please install it, and re-run this script."
>> + exit 0
>> + fi
>> fi
>>
>> #Fetch the info and store in temp files/variables
>> @@ -407,8 +409,6 @@ KERNEL_OS=`uname -o`
>> ALSA_DRIVER_VERSION=`cat /proc/asound/version |head -n1|awk {'print $7'} |sed 's/\.$//'`
>> get_alsa_library_version
>> ALSA_UTILS_VERSION=`amixer -v |awk {'print $3'}`
>> -VENDOR_ID=`lspci -vn | grep 040[1-3] | awk -F':' '{print $3}'| awk {'print substr($0, 2);}' >$TEMPDIR/vendor_id.tmp`
>> -DEVICE_ID=`lspci -vn | grep 040[1-3] | awk -F':' '{print $4}'| awk {'print $1'} >$TEMPDIR/device_id.tmp`
>> LAST_CARD=$((`grep "]: " /proc/asound/cards | wc -l` - 1 ))
>>
>> ESDINST=$(which esd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
>> @@ -434,7 +434,9 @@ fi
>>
>> cat /proc/asound/modules 2>/dev/null|awk {'print $2'}>$TEMPDIR/alsamodules.tmp
>> cat /proc/asound/cards >$TEMPDIR/alsacards.tmp
>> +if [[ ! -z "$LSPCI" ]]; then
>> lspci |grep -i "multi\|audio">$TEMPDIR/lspci.tmp
>> +fi
>>
>> #Check for HDA-Intel cards codec#*
>> cat /proc/asound/card*/codec\#* > $TEMPDIR/alsa-hda-intel.tmp 2> /dev/null
>> @@ -547,6 +549,8 @@ echo "" >> $FILE
>> cat $TEMPDIR/alsacards.tmp >> $FILE
>> echo "" >> $FILE
>> echo "" >> $FILE
>> +
>> +if [[ ! -z "$LSPCI" ]]; then
>> echo "!!PCI Soundcards installed in the system" >> $FILE
>> echo "!!--------------------------------------" >> $FILE
>> echo "" >> $FILE
>> @@ -559,6 +563,7 @@ echo "" >> $FILE
>> lspci -vvn |grep -A1 040[1-3] >> $FILE
>> echo "" >> $FILE
>> echo "" >> $FILE
>> +fi
>>
>> if [ "$SNDOPTIONS" ]
>> then
>> --
>> 1.7.9.5
>>
>
--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] alsa-info: Run without lspci (if there is no pci bus)
2013-08-27 0:12 ` David Henningsson
@ 2013-08-29 16:11 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2013-08-29 16:11 UTC (permalink / raw)
To: David Henningsson; +Cc: alsa-devel
At Tue, 27 Aug 2013 02:12:46 +0200,
David Henningsson wrote:
>
> On 08/09/2013 03:55 PM, Takashi Iwai wrote:
> > At Fri, 9 Aug 2013 14:47:49 +0200,
> > David Henningsson wrote:
> >>
> >> On some embedded ARM hardware, there is no pci bus. In that case,
> >> do not require lspci so we can still get as much info as we can.
> >>
> >> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
> >
> > Thanks, applied to my tree.
>
> Ping - did this ever get pushed to the official alsa-info?
Pushed to alsa-driver.org git tree now.
Takashi
>
> >
> >
> > Takashi
> >
> >> ---
> >> alsa/utils/alsa-info.sh | 13 +++++++++----
> >> 1 file changed, 9 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/alsa/utils/alsa-info.sh b/alsa/utils/alsa-info.sh
> >> index 9d996aa..2280af5 100755
> >> --- a/alsa/utils/alsa-info.sh
> >> +++ b/alsa/utils/alsa-info.sh
> >> @@ -393,8 +393,10 @@ trap cleanup 0
> >> if [ "$PROCEED" = "yes" ]; then
> >>
> >> if [ -z "$LSPCI" ]; then
> >> - echo "This script requires lspci. Please install it, and re-run this script."
> >> - exit 0
> >> + if [ -d /sys/bus/pci ]; then
> >> + echo "This script requires lspci. Please install it, and re-run this script."
> >> + exit 0
> >> + fi
> >> fi
> >>
> >> #Fetch the info and store in temp files/variables
> >> @@ -407,8 +409,6 @@ KERNEL_OS=`uname -o`
> >> ALSA_DRIVER_VERSION=`cat /proc/asound/version |head -n1|awk {'print $7'} |sed 's/\.$//'`
> >> get_alsa_library_version
> >> ALSA_UTILS_VERSION=`amixer -v |awk {'print $3'}`
> >> -VENDOR_ID=`lspci -vn | grep 040[1-3] | awk -F':' '{print $3}'| awk {'print substr($0, 2);}' >$TEMPDIR/vendor_id.tmp`
> >> -DEVICE_ID=`lspci -vn | grep 040[1-3] | awk -F':' '{print $4}'| awk {'print $1'} >$TEMPDIR/device_id.tmp`
> >> LAST_CARD=$((`grep "]: " /proc/asound/cards | wc -l` - 1 ))
> >>
> >> ESDINST=$(which esd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
> >> @@ -434,7 +434,9 @@ fi
> >>
> >> cat /proc/asound/modules 2>/dev/null|awk {'print $2'}>$TEMPDIR/alsamodules.tmp
> >> cat /proc/asound/cards >$TEMPDIR/alsacards.tmp
> >> +if [[ ! -z "$LSPCI" ]]; then
> >> lspci |grep -i "multi\|audio">$TEMPDIR/lspci.tmp
> >> +fi
> >>
> >> #Check for HDA-Intel cards codec#*
> >> cat /proc/asound/card*/codec\#* > $TEMPDIR/alsa-hda-intel.tmp 2> /dev/null
> >> @@ -547,6 +549,8 @@ echo "" >> $FILE
> >> cat $TEMPDIR/alsacards.tmp >> $FILE
> >> echo "" >> $FILE
> >> echo "" >> $FILE
> >> +
> >> +if [[ ! -z "$LSPCI" ]]; then
> >> echo "!!PCI Soundcards installed in the system" >> $FILE
> >> echo "!!--------------------------------------" >> $FILE
> >> echo "" >> $FILE
> >> @@ -559,6 +563,7 @@ echo "" >> $FILE
> >> lspci -vvn |grep -A1 040[1-3] >> $FILE
> >> echo "" >> $FILE
> >> echo "" >> $FILE
> >> +fi
> >>
> >> if [ "$SNDOPTIONS" ]
> >> then
> >> --
> >> 1.7.9.5
> >>
> >
>
>
>
> --
> David Henningsson, Canonical Ltd.
> https://launchpad.net/~diwic
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-08-29 16:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-09 12:47 [PATCH] alsa-info: Run without lspci (if there is no pci bus) David Henningsson
2013-08-09 13:55 ` Takashi Iwai
2013-08-27 0:12 ` David Henningsson
2013-08-29 16:11 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.