]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsa-info.sh: log SoundWire devices reported in ACPI
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 15 Apr 2024 15:17:39 +0000 (10:17 -0500)
committerJaroslav Kysela <perex@perex.cz>
Mon, 22 Apr 2024 08:03:28 +0000 (10:03 +0200)
Track SoundWire devices reported in ACPI, this will help detect
missing or invalid configurations.

For now we only filter information from Realtek, Cirrus Logic and TI,
based on the manufacturer ID of their devices.

Example log for the classic RT711/RT1316x2/RT714 configuration.

!!ACPI SoundWire Device Status Information
!!---------------

Realtek 0x000030025d071101
Realtek 0x000331025d131601
Realtek 0x000230025d131601
Realtek 0x000130025d071401

As noted by reviewers, the script reports everything exposed in
ACPI. In practice some of the devices listed may not be physically
populated in hardware, or be listed as attached on a link that's
disabled by the manager. The drivers can cope with this case, it's not
technically an error.

Closes: https://github.com/alsa-project/alsa-utils/pull/264
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
alsa-info/alsa-info.sh

index 8f0593456ac79796069036ec43f3a9c12fdf01c4..fda784d10245339b8e7813245ecf3d112a1dd5ed 100755 (executable)
@@ -461,6 +461,20 @@ if [ -d /sys/bus/acpi/devices ]; then
     done
 fi
 
+# Check for SoundWire ACPI _adr device status
+if [ -d /sys/bus/acpi/devices ]; then
+       for f in /sys/bus/acpi/devices/*/adr; do
+               ACPI_ADR=$(cat $f 2>/dev/null);
+               if [[ "$ACPI_ADR" -ne 0 ]]; then
+                       case $ACPI_ADR in
+                               0x??????025d*) echo "Realtek $ACPI_ADR" >>$TEMPDIR/sdwstatus.tmp;;
+                               0x??????01fa*) echo "Cirrus Logic $ACPI_ADR" >>$TEMPDIR/sdwstatus.tmp;;
+                               0x??????0102*) echo "TI $ACPI_ADR" >>$TEMPDIR/sdwstatus.tmp;;
+                       esac
+               fi
+       done
+fi
+
 awk '{ print $2 " (card " $1 ")" }' < /proc/asound/modules > $TEMPDIR/alsamodules.tmp 2> /dev/null
 cat /proc/asound/cards > $TEMPDIR/alsacards.tmp
 if [[ ! -z "$LSPCI" ]]; then
@@ -528,6 +542,12 @@ echo "" >> $FILE
 cat $TEMPDIR/acpidevicestatus.tmp >> $FILE
 echo "" >> $FILE
 echo "" >> $FILE
+echo "!!ACPI SoundWire Device Status Information" >> $FILE
+echo "!!---------------" >> $FILE
+echo "" >> $FILE
+cat $TEMPDIR/sdwstatus.tmp >> $FILE
+echo "" >> $FILE
+echo "" >> $FILE
 echo "!!Kernel Information" >> $FILE
 echo "!!------------------" >> $FILE
 echo "" >> $FILE