autotest: cras_utils: Use DBus API to control Cras
Use Cras DBus API to control Cras.
This includes:
1. Deprecate the usage of cras_test_client --dump_server_info to get selected
node, selected node types, number of active streams.
2. Use DBus API to set volume and gain and mute/unmute state.
3. Deprecate get_node_type method and use get_selected_node_types
instead.
4. Fix the usage in audio_helper in rms test setup.
BUG=chromium:491931
TEST=run audio_CrasLoopback test
Change-Id: I3fa404d4ee1cf8d0127289a4789c4fccd86ca18c
Reviewed-on: https://chromium-review.googlesource.com/273458
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
diff --git a/client/cros/audio/audio_helper.py b/client/cros/audio/audio_helper.py
index d254cea..269c279 100644
--- a/client/cros/audio/audio_helper.py
+++ b/client/cros/audio/audio_helper.py
@@ -555,10 +555,8 @@
"""
# TODO(owenlin): Now, the nodes are choosed by chrome.
# We should do it here.
- output_node, _ = cras_utils.get_selected_nodes()
-
cras_utils.set_system_volume(_DEFAULT_PLAYBACK_VOLUME)
- cras_utils.set_node_volume(output_node, _DEFAULT_PLAYBACK_VOLUME)
+ cras_utils.set_selected_output_node_volume(_DEFAULT_PLAYBACK_VOLUME)
cras_utils.set_capture_gain(_DEFAULT_CAPTURE_GAIN)