diff options
-rw-r--r-- | Makefile | 10 | ||||
-rwxr-xr-x | scripts/audio_diagnostics | 44 |
2 files changed, 52 insertions, 2 deletions
@@ -52,13 +52,19 @@ optional_cras_conf := $(wildcard $(ADHD_DIR)/cras-config/$(BOARD)/*) ifneq ($(strip $(optional_cras_conf)),) -.PHONY: cras-config-files +.PHONY: cras-config-files cras-scripts cras-config-files: $(ECHO) "Installing cras config files" $(INSTALL) --mode 755 -d $(DESTDIR)etc/cras/ $(INSTALL) --mode 644 -D $(ADHD_DIR)/cras-config/$(BOARD)/* $(DESTDIR)etc/cras/ -install: cras-config-files +cras-scripts: + $(ECHO) "Installing cras scripts" + $(INSTALL) --mode 755 -d $(DESTDIR)usr/bin/ + $(INSTALL) --mode 755 -D $(ADHD_DIR)/scripts/audio_diagnostics \ + $(DESTDIR)usr/bin/ + +install: cras-config-files cras-scripts endif diff --git a/scripts/audio_diagnostics b/scripts/audio_diagnostics new file mode 100755 index 00000000..39e122ba --- /dev/null +++ b/scripts/audio_diagnostics @@ -0,0 +1,44 @@ +#!/bin/sh +# +# Copyright (c) 2013 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# Collect information about the audio system from top to bottom. + +echo '=== cras_test_client --dump_server_info ===' +cras_test_client --dump_server_info + +echo '=== aplay -l ===' +aplay -l +echo '=== arecord -l ===' +arecord -l + +cards=$(aplay -l | egrep ^card | sed 's/card \([0-9]\+\).*/\1/' | sort -u) +for card in $cards +do + echo '=== amixer -c' $card scontents '===' + amixer -c $card scontents + echo '=== amixer -c' $card contents '===' + amixer -c $card contents +done + +# HDA codec for codecs on x86. +codecs=$(find /proc/asound -mindepth 2 -maxdepth 2 -path '*card*/codec#*') +for codec in $codecs +do + echo '=== codec:' $codec '===' + cat $codec +done + +# I2C dump for codecs on arm. +# Find lines like "max98088.7-0010" and extract "7 0x0010" from it. +if [ -e /sys/kernel/debug/asoc/codecs ]; then + sed_expr='s/^\([^.-]\+\)\.\([0-9]\+\)-\([0-9]\+\)$/\2 0x\3/p' + sed -n "$sed_expr" /sys/kernel/debug/asoc/codecs | + while read i2c_addr + do + echo '===' i2cdump -f -y $i2c_addr '===' + i2cdump -f -y $i2c_addr + done +fi |