audio_helper - Use audio_diagnostics to build audio postmortem report.
Change to the existing audio diagnostics tools to build audio postmortem.
It logs more related information than we did, such as the codec info.
BUG=chromium:307379
TEST=Run audiovideo_LineOutToMicInLoopback test on link
Change-Id: Idea8d68bc56c50c61b469675350a1edad65003c6
Reviewed-on: https://chromium-review.googlesource.com/180393
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Owen Lin <owenlin@chromium.org>
Tested-by: Owen Lin <owenlin@chromium.org>
diff --git a/client/cros/audio/audio_helper.py b/client/cros/audio/audio_helper.py
index cbff735..462ab87 100644
--- a/client/cros/audio/audio_helper.py
+++ b/client/cros/audio/audio_helper.py
@@ -23,6 +23,8 @@
LD_LIBRARY_PATH = 'LD_LIBRARY_PATH'
+_AUDIO_DIAGNOSTICS_PATH = '/usr/bin/audio_diagnostics'
+
_DEFAULT_NUM_CHANNELS = 2
_DEFAULT_REC_COMMAND = 'arecord -D hw:0,0 -d 10 -f dat'
_DEFAULT_SOX_FORMAT = '-t raw -b 16 -e signed -r 48000 -L'
@@ -575,9 +577,9 @@
run_once(self, chrome_instance, *args, **kargs)
except error.TestFail:
logging.info('audio postmortem report')
- logging.info(cras_utils.dump_server_info())
log_loopback_dongle_status()
- logging.info(alsa_utils.dump_control_contents())
+ logging.info(cmd_utils.execute(
+ [_AUDIO_DIAGNOSTICS_PATH], stdout=cmd_utils.PIPE))
raise
return wrapper
@@ -593,9 +595,9 @@
run_once(*args, **kargs)
except error.TestFail:
logging.info('audio postmortem report')
- logging.info(cras_utils.dump_server_info())
log_loopback_dongle_status()
- logging.info(alsa_utils.dump_control_contents())
+ logging.info(cmd_utils.execute(
+ [_AUDIO_DIAGNOSTICS_PATH], stdout=cmd_utils.PIPE))
raise
return wrapper
@@ -618,6 +620,7 @@
except error.TestFail:
logging.info('audio postmortem report')
log_loopback_dongle_status()
- logging.info(alsa_utils.dump_control_contents())
+ logging.info(cmd_utils.execute(
+ [_AUDIO_DIAGNOSTICS_PATH], stdout=cmd_utils.PIPE))
raise
return wrapper