[alsa-devel] [PATCH 0/2] alsa-utils: improve alsa-info.sh
Provide additional DMI information and filter ACPI/HID device status to help with platform quirks
Pierre-Louis Bossart (2): alsa-info: provide more DMI information alsa-info: add ACPI device status
alsa-info/alsa-info.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
Some manufacturers don't provide useful information for Manufacturer and Product Name but instead use Board Vendor and Board Name fields, add them to alsa-info log
Example on Intel NUC:
!!DMI Information !!---------------
Manufacturer: Product Name: Product Version: Firmware Version: KYSKLi70.86A.0042.2016.0929.1933 Board Vendor: Intel Corporation Board Name: NUC6i7KYB
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- alsa-info/alsa-info.sh | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/alsa-info/alsa-info.sh b/alsa-info/alsa-info.sh index 0bc4cd0..9684c6f 100755 --- a/alsa-info/alsa-info.sh +++ b/alsa-info/alsa-info.sh @@ -430,11 +430,15 @@ if [ -d /sys/class/dmi/id ]; then DMI_SYSTEM_PRODUCT_NAME=$(cat /sys/class/dmi/id/product_name 2>/dev/null) DMI_SYSTEM_PRODUCT_VERSION=$(cat /sys/class/dmi/id/product_version 2>/dev/null) DMI_SYSTEM_FIRMWARE_VERSION=$(cat /sys/class/dmi/id/bios_version 2>/dev/null) + DMI_BOARD_VENDOR=$(cat /sys/class/dmi/id/board_vendor 2>/dev/null) + DMI_BOARD_NAME=$(cat /sys/class/dmi/id/board_name 2>/dev/null) elif [ -x $DMIDECODE ]; then DMI_SYSTEM_MANUFACTURER=$($DMIDECODE -s system-manufacturer 2>/dev/null) DMI_SYSTEM_PRODUCT_NAME=$($DMIDECODE -s system-product-name 2>/dev/null) DMI_SYSTEM_PRODUCT_VERSION=$($DMIDECODE -s system-version 2>/dev/null) DMI_SYSTEM_FIRMWARE_VERSION=$($DMIDECODE -s bios-version 2>/dev/null) + DMI_BOARD_VENDOR=$($DMIDECODE -s baseboard-manufacturer 2>/dev/null) + DMI_BOARD_NAME=$($DMIDECODE -s baseboard-product-name 2>/dev/null) fi
cat /proc/asound/modules 2>/dev/null|awk {'print $2'}>$TEMPDIR/alsamodules.tmp @@ -479,6 +483,8 @@ echo "Manufacturer: $DMI_SYSTEM_MANUFACTURER" >> $FILE echo "Product Name: $DMI_SYSTEM_PRODUCT_NAME" >> $FILE echo "Product Version: $DMI_SYSTEM_PRODUCT_VERSION" >> $FILE echo "Firmware Version: $DMI_SYSTEM_FIRMWARE_VERSION" >> $FILE +echo "Board Vendor: $DMI_BOARD_VENDOR" >> $FILE +echo "Board Name: $DMI_BOARD_NAME" >> $FILE echo "" >> $FILE echo "" >> $FILE echo "!!Kernel Information" >> $FILE
BIOS vendors typically reuse the same definitions between different platforms and expose the relevant hardware by changing the value of the _STA method.
For example on the Asus T100HA, there are 3 HID values for audio codecs in the DSDT table but two have a zero status and will be ignored by the ACPI subsystem.
$ more /sys/bus/acpi/devices/10EC*/status :::::::::::::: /sys/bus/acpi/devices/10EC3270:00/status :::::::::::::: 15 :::::::::::::: /sys/bus/acpi/devices/10EC5640:00/status :::::::::::::: 0 :::::::::::::: /sys/bus/acpi/devices/10EC5648:00/status :::::::::::::: 0
This information is very useful to figure out which HIDs/quirks need to be supported. Add log to alsa-info.sh to only expose non-zero results of the ACPI _STA method, e.g.
!!ACPI Device Status Information !!---------------
/sys/bus/acpi/devices/10EC3270:00/status 15
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- alsa-info/alsa-info.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/alsa-info/alsa-info.sh b/alsa-info/alsa-info.sh index 9684c6f..cda4125 100755 --- a/alsa-info/alsa-info.sh +++ b/alsa-info/alsa-info.sh @@ -441,6 +441,16 @@ elif [ -x $DMIDECODE ]; then DMI_BOARD_NAME=$($DMIDECODE -s baseboard-product-name 2>/dev/null) fi
+# Check for ACPI device status +if [ -d /sys/bus/acpi/devices ]; then + for f in /sys/bus/acpi/devices/*/status; do + ACPI_STATUS=$(cat $f 2>/dev/null); + if [[ "$ACPI_STATUS" -ne 0 ]]; then + echo $f $'\t' $ACPI_STATUS >>$TEMPDIR/acpidevicestatus.tmp; + fi + done +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 @@ -487,6 +497,12 @@ echo "Board Vendor: $DMI_BOARD_VENDOR" >> $FILE echo "Board Name: $DMI_BOARD_NAME" >> $FILE echo "" >> $FILE echo "" >> $FILE +echo "!!ACPI Device Status Information" >> $FILE +echo "!!---------------" >> $FILE +echo "" >> $FILE +cat $TEMPDIR/acpidevicestatus.tmp >> $FILE +echo "" >> $FILE +echo "" >> $FILE echo "!!Kernel Information" >> $FILE echo "!!------------------" >> $FILE echo "" >> $FILE
On Tue, 10 Jan 2017 01:32:22 +0100, Pierre-Louis Bossart wrote:
Provide additional DMI information and filter ACPI/HID device status to help with platform quirks
Pierre-Louis Bossart (2): alsa-info: provide more DMI information alsa-info: add ACPI device status
Applied both patches. Thanks.
Takashi
participants (2)
-
Pierre-Louis Bossart
-
Takashi Iwai