Modify chrome.audio API usage in audio_extension_handler for API change |
|||||
Issue descriptionAfter the change in https://bugs.chromium.org/p/chromium/issues/detail?id=673392 we should use getDevice instead of getInfo API to get device info. So, some test that select chrome active node type is currently broken.
,
Mar 8 2017
btw. I started working on a possible fix, but did not have time to test the change yet: https://chromium-review.googlesource.com/c/450833/1/client/cros/multimedia/audio_extension_handler.py#245
,
Mar 8 2017
Hi tbarzic@, The change looks awesome.
Thanks a lot for the efforts!
It will be easier to test the changes after fixing the usage in client/cros/multimedia/audio_facade_native.py.
As discussed, I will work on that based on your change in audio_extension_handler.
Also list the steps to test the API:
On any ChromeOS device.
$ stop ui
Start multimedia server.
$ /usr/local/autotest/cros/multimedia/multimedia_xmlrpc_server.py
On another ssh session to ChromeOS device, connect to multimedia server through a proxy.
$ /usr/local/autotest/cros/multimedia/multimedia_xmlrpc_server.py -d
Start Chrome browser through telemetry and load multimedia test extension.
>>>s.browser.start_default_chrome()
Try some functions provided in client/cros/multimedia/audio_facade_native.py
>>>s.audio.get_audio_info()
>>>s.audio.set_chrome_active_volume(50)
>>>s.audio.set_chrome_mute()
>>>s.audio.get_chrome_active_volume_mute()
>>>s.audio.set_chrome_active_node_type('INTERNAL_SPEAKER','INTERNAL_MIC')
,
Mar 8 2017
,
Mar 8 2017
https://chromium-review.googlesource.com/#/c/450833/ can fix the test issue.
,
Mar 9 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/autotest/+/402ddbdc1ec1151be2f47f8eaa1c6614196a70f9 commit 402ddbdc1ec1151be2f47f8eaa1c6614196a70f9 Author: Toni Barzic <tbarzic@google.com> Date: Thu Mar 09 09:09:39 2017 [autotest] audio_extension_handler: Use new chrome.audio API Use new API for the changes in crbug.com/673392 . - Replace getInfo with getDevices - Replace setProperties with setMute to mute system. BUG=chromium:699170, chromium:699007 TEST=test_that --fast --debug --board=auron_paine --args="chameleon_host=chromeos2-row10-rack9-host9-chameleon.cros" chromeos2-row10-rack9-host9.cros audio_AudioBasicHDMI TEST=check multimedia_xmlrpc_server audio facade. >>> s.browser.start_default_chrome() True >>> s.audio.set_chrome_active_node_type('INTERNAL_SPEAKER', 'INTERNAL_MIC') >>> s.audio.set_chrome_active_node_type('HEADPHONE', 'MIC') >>> s.audio.get_audio_devices() [{'deviceName': 'Post Mix Pre DSP Loopback', 'displayName': 'Post Mix Pre DSP Loopback', 'level': 75, 'stableDeviceId': '2315562897', 'streamType': 'INPUT', 'deviceType': 'POST_MIX_LOOPBACK', 'id': '12884901888', 'isActive': False}, {'deviceName': 'Post DSP Loopback', 'displayName': 'Post DSP Loopback', 'level': 75, 'stableDeviceId': '2356475750', 'streamType': 'INPUT', 'deviceType': 'POST_DSP_LOOPBACK', 'id': '17179869184', 'isActive': False}, {'deviceName': 'sklnau8825adi: :0,0', 'displayName': 'Headphone', 'level': 75, 'stableDeviceId': '2660450915', 'streamType': 'OUTPUT', 'deviceType': 'HEADPHONE', 'id': '21474836480', 'isActive': True}, {'deviceName': 'sklnau8825adi: :0,0', 'displayName': 'Speaker', 'level': 75, 'stableDeviceId': '1923447123', 'streamType': 'OUTPUT', 'deviceType': 'INTERNAL_SPEAKER', 'id': '21474836481', 'isActive': False}, {'deviceName': 'sklnau8825adi: :0,1', 'displayName': 'Mic', 'level': 75, 'stableDeviceId': '1638577850', 'streamType': 'INPUT', 'deviceType': 'MIC', 'id': '25769803776', 'isActive': True}, {'deviceName': 'sklnau8825adi: :0,1', 'displayName': 'Internal Mic', 'level': 75, 'stableDeviceId': '1289939621', 'streamType': 'INPUT', 'deviceType': 'INTERNAL_MIC', 'id': '25769803777', 'isActive': False}] >>> s.audio.get_chrome_active_volume_mute() [75, False] >>> s.set_chrome_active_volume(50) >>> s.audio.set_chrome_active_volume(50) >>> s.audio.get_chrome_active_volume_mute() [50, False] >>> s.audio.set_chrome_mute(True) >>> s.audio.get_chrome_active_volume_mute() [50, True] Change-Id: If6ea4db43df9f3ed32100f10dc7d1b1219831f2e Reviewed-on: https://chromium-review.googlesource.com/450833 Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org> Tested-by: Cheng-Yi Chiang <cychiang@chromium.org> Reviewed-by: Kalin Stoyanov <kalin@chromium.org> Reviewed-by: Hsu Wei-Cheng <mojahsu@chromium.org> [modify] https://crrev.com/402ddbdc1ec1151be2f47f8eaa1c6614196a70f9/client/cros/multimedia/audio_facade_native.py [modify] https://crrev.com/402ddbdc1ec1151be2f47f8eaa1c6614196a70f9/client/cros/multimedia/audio_extension_handler.py
,
Mar 9 2017
Thanks tbarzic for the quick fix!
,
Apr 7 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/autotest/+/6396f3d878c29a59702bc76da2232edc88f7dd49 commit 6396f3d878c29a59702bc76da2232edc88f7dd49 Author: Toni Barzic <tbarzic@google.com> Date: Fri Apr 07 04:20:19 2017 [autotest] audio_extension_handler: Use new chrome.audio API Use new API for the changes in crbug.com/673392 . - Replace getInfo with getDevices - Replace setProperties with setMute to mute system. BUG=chromium:699170, chromium:699007 TEST=test_that --fast --debug --board=auron_paine --args="chameleon_host=chromeos2-row10-rack9-host9-chameleon.cros" chromeos2-row10-rack9-host9.cros audio_AudioBasicHDMI TEST=check multimedia_xmlrpc_server audio facade. >>> s.browser.start_default_chrome() True >>> s.audio.set_chrome_active_node_type('INTERNAL_SPEAKER', 'INTERNAL_MIC') >>> s.audio.set_chrome_active_node_type('HEADPHONE', 'MIC') >>> s.audio.get_audio_devices() [{'deviceName': 'Post Mix Pre DSP Loopback', 'displayName': 'Post Mix Pre DSP Loopback', 'level': 75, 'stableDeviceId': '2315562897', 'streamType': 'INPUT', 'deviceType': 'POST_MIX_LOOPBACK', 'id': '12884901888', 'isActive': False}, {'deviceName': 'Post DSP Loopback', 'displayName': 'Post DSP Loopback', 'level': 75, 'stableDeviceId': '2356475750', 'streamType': 'INPUT', 'deviceType': 'POST_DSP_LOOPBACK', 'id': '17179869184', 'isActive': False}, {'deviceName': 'sklnau8825adi: :0,0', 'displayName': 'Headphone', 'level': 75, 'stableDeviceId': '2660450915', 'streamType': 'OUTPUT', 'deviceType': 'HEADPHONE', 'id': '21474836480', 'isActive': True}, {'deviceName': 'sklnau8825adi: :0,0', 'displayName': 'Speaker', 'level': 75, 'stableDeviceId': '1923447123', 'streamType': 'OUTPUT', 'deviceType': 'INTERNAL_SPEAKER', 'id': '21474836481', 'isActive': False}, {'deviceName': 'sklnau8825adi: :0,1', 'displayName': 'Mic', 'level': 75, 'stableDeviceId': '1638577850', 'streamType': 'INPUT', 'deviceType': 'MIC', 'id': '25769803776', 'isActive': True}, {'deviceName': 'sklnau8825adi: :0,1', 'displayName': 'Internal Mic', 'level': 75, 'stableDeviceId': '1289939621', 'streamType': 'INPUT', 'deviceType': 'INTERNAL_MIC', 'id': '25769803777', 'isActive': False}] >>> s.audio.get_chrome_active_volume_mute() [75, False] >>> s.set_chrome_active_volume(50) >>> s.audio.set_chrome_active_volume(50) >>> s.audio.get_chrome_active_volume_mute() [50, False] >>> s.audio.set_chrome_mute(True) >>> s.audio.get_chrome_active_volume_mute() [50, True] Change-Id: If6ea4db43df9f3ed32100f10dc7d1b1219831f2e Reviewed-on: https://chromium-review.googlesource.com/450833 Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org> Tested-by: Cheng-Yi Chiang <cychiang@chromium.org> Reviewed-by: Kalin Stoyanov <kalin@chromium.org> Reviewed-by: Hsu Wei-Cheng <mojahsu@chromium.org> (cherry picked from commit 402ddbdc1ec1151be2f47f8eaa1c6614196a70f9) Reviewed-on: https://chromium-review.googlesource.com/471186 Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org> Commit-Queue: Cheng-Yi Chiang <cychiang@chromium.org> [modify] https://crrev.com/6396f3d878c29a59702bc76da2232edc88f7dd49/client/cros/multimedia/audio_facade_native.py [modify] https://crrev.com/6396f3d878c29a59702bc76da2232edc88f7dd49/client/cros/multimedia/audio_extension_handler.py |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by cychiang@chromium.org
, Mar 8 2017