New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 633809 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Setting CFM volume to 1% does not reflect correctly in cras_test_client output

Project Member Reported by harpreet@chromium.org, Aug 3 2016

Issue description

Steps to repro on CFM device:
- Use window.hrSetAudioOutVolumeLevelForTest('1') to set the CFM volume to 1%  (note: this is the API available in CFM https://critique.corp.google.com/#review/120696233/depot/google3/javascript/apps/gcomm/mods/gvc/telemetry/devicehelper.js)
- Run "cras_test_client --dump_server_info" to check the volume of the USB jabra unit

***** It should be 1, instead it is 0.

This was caught with enterprise_CFM_VolumeChange test. Each time this test fails, its because of this https://wmatrix.googleplex.com/matrix/unfiltered?hide_missing=True&tests=enterprise_CFM_VolumeChange.usb_speaker&days_back=30&releases=53


Here is the output of the autotest which tries to do exactly this;

8/01 10:27:51.620 DEBUG|inspector_websocke:0097| sent [{
  "id": 60, 
  "method": "Runtime.evaluate", 
  "params": {
    "expression": "window.hrSetAudioOutVolumeLevelForTest('1'); 0;", 
    "returnByValue": true
  }
}]
08/01 10:27:51.620 DEBUG|inspector_websocke:0164| got [{
  "id": 60, 
  "result": {
    "result": {
      "description": "0", 
      "type": "number", 
      "value": 0
    }, 
    "wasThrown": false
  }
}]
08/01 10:27:51.621 INFO |          cfm_util:0339| Set speaker volume to 1
08/01 10:27:53.623 DEBUG|        base_utils:0185| Running 'cras_test_client --dump_server_info | awk '/Output Nodes:/,/Input Devices:/' | grep -E 'USB' | awk -v N=3 '{print $N}''
08/01 10:27:53.663 DEBUG|    cros_interface:0354| ListProcesses(<predicate>)->[159 processes]
08/01 10:27:53.668 INFO |    cros_interface:0525| (Re)starting the ui (logs the user out)
08/01 10:27:53.693 DEBUG|    cros_interface:0422| IsServiceRunning(ui)->True
08/01 10:27:53.694 DEBUG|    cros_interface:0058| sh -c restart ui 
08/01 10:28:14.143 DEBUG|    cros_interface:0067|  > stdout=[ui start/running, process 17829
], stderr=[]
08/01 10:28:14.144 DEBUG|    cros_interface:0058| sh -c cryptohome-path user 'test@test.test' 
08/01 10:28:14.161 DEBUG|    cros_interface:0067|  > stdout=[/home/user/877e596b26e6fe7e6a2ca736f9301d1629d8c5fb
], stderr=[]
08/01 10:28:14.162 DEBUG|    cros_interface:0058| sh -c /bin/df /home/user/877e596b26e6fe7e6a2ca736f9301d1629d8c5fb 
08/01 10:28:14.176 DEBUG|    cros_interface:0067|  > stdout=[], stderr=[df: '/home/user/877e596b26e6fe7e6a2ca736f9301d1629d8c5fb': No such file or directory
]
08/01 10:28:14.177 DEBUG|        base_utils:0185| Running 'mkdir -p /usr/local/autotest/results/default/enterprise_CFM_VolumeChangeClient/sysinfo/iteration.1/var/spool'
08/01 10:28:14.190 DEBUG|        base_utils:0185| Running 'rsync --no-perms --chmod=ugo+r -a --exclude=autoserv*  /var/spool/crash /usr/local/autotest/results/default/enterprise_CFM_VolumeChangeClient/sysinfo/iteration.1/var/spool'
08/01 10:28:14.241 DEBUG|        base_utils:0185| Running 'rm -rf /var/spool/crash/*'
08/01 10:28:14.254 DEBUG|        base_utils:0185| Running 'logger "autotest finished iteration /usr/local/autotest/results/default/enterprise_CFM_VolumeChangeClient/sysinfo/iteration.1"'
08/01 10:28:14.268 WARNI|              test:0606| Autotest caught exception when running test:
Traceback (most recent call last):
  File "/usr/local/autotest/common_lib/test.py", line 600, in _exec
    _call_test_function(self.execute, *p_args, **p_dargs)
  File "/usr/local/autotest/common_lib/test.py", line 804, in _call_test_function
    return func(*args, **dargs)
  File "/usr/local/autotest/common_lib/test.py", line 461, in execute
    dargs)
  File "/usr/local/autotest/common_lib/test.py", line 347, in _call_run_once_with_retry
    postprocess_profiled_run, args, dargs)
  File "/usr/local/autotest/common_lib/test.py", line 376, in _call_run_once
    self.run_once(*args, **dargs)
  File "/usr/local/autotest/tests/enterprise_CFM_VolumeChangeClient/enterprise_CFM_VolumeChangeClient.py", line 95, in run_once
    (cras_volume, cfm_volume))
TestFail: Cras volume (0) does not match volume set by CFM (1).
 
Owner: hychao@chromium.org
Status: Assigned (was: Untriaged)
hychao@ - could you please take a look at this as well. thanks
Owner: jen...@chromium.org
There are many layers between CRAS and this test, and it doesn't look like a CRAS issue.

I tried sending dbus method to CRAS to set output volume to 1%:
dbus-send --system  --type=method_call  --print-reply
    --dest=org.chromium.cras /org/chromium/cras
    org.chromium.cras.Control.SetOutputNodeVolume
    uint64:0x0000000500000001 
    int32:1

and cras_test_client --dump_server_info prints the correct volume = 1%.

Jenny: is there any code in audio handler to cut volume to zero when the value is too small?
Status: WontFix (was: Assigned)
This is by design.
https://cs.chromium.org/chromium/src/chromeos/audio/cras_audio_handler.cc?sq=package:chromium&rcl=1470410650&l=830

There is a minimum volume threshold, if the volume to set is less or equal to it, the volume will be set to 0 to mute the output.
Ok. Changed the test to adjust the range between 2 - 100%

Sign in to add a comment