From cc0bcef81389dab05ca9f150694a2969fae93656 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Mon, 15 Apr 2024 10:17:39 -0500 Subject: [PATCH] alsa-info.sh: log SoundWire devices reported in ACPI 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 Signed-off-by: Jaroslav Kysela --- alsa-info/alsa-info.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/alsa-info/alsa-info.sh b/alsa-info/alsa-info.sh index 8f05934..fda784d 100755 --- a/alsa-info/alsa-info.sh +++ b/alsa-info/alsa-info.sh @@ -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