New issue
Advanced search Search tips

Issue 788183 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Dec 20
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[factory] [UCMConfigManager] _GuessCardName Doesn't Consider Configs from UniBuild

Project Member Reported by marcochen@chromium.org, Nov 23 2017

Issue description

Currently _GuessCardName tries to

  1. get possible card name from `aplay -l`
  2. join a folder path by '/usr/share/alsa/ucm' + card_name_above
  3. check whether this folder exists or not

step 2 & 3 is not compatible with case of unibuild because the folder of UCM config will be called something like card_name.ucm_suffix. In this case, _GuessCardName will always return None.

Suggest to filter out information from 'ps aux | grep cras', it will show info like

  /usr/bin/cras --dsp_config=/etc/cras/model_name/dsp.ini --device_config_dir=/etc/cras/model_name --internal_ucm_suffix=1mic

Then we can get correct ucm_suffix then combine with cardname for checking the folder.
 

Comment 1 by hungte@chromium.org, Nov 23 2017

Cc: sjg@chromium.org
Relying on ps is not a good approach, since command may change the param anytime, especially programs may change the implementation to read configs internally.

Simon, is there a better way for factory to find out which ucm file that cras will be  using? Something from cros_config?
re#1

> Relying on ps is not a good approach, since command may change the param anytime
I agree that command may be changed anytime and it also means no matter what you choose to rely on it will always change too.

You can also refer to [1] which shows the example how cras asks cros_config to provide ucm-suffix. Again, cros_config will be changed anytime as your concern. Currently there are three ways to get ucm-suffix - 1. cros_config 2. get_internal_ucm_suffix 3. None. Hence instead of dealing with these three conditions, we can ask cras to expose these info since cras already needs to take care them. config_manager don't need to cover these 3 condition duplicately.

[1] https://chromium.googlesource.com/chromiumos/third_party/adhd/+/master/init/cras.sh#6

Comment 3 by sjg@chromium.org, Nov 24 2017

For unibuild we should use cros_config to find out the info we need. The script Marco points to in #2 should help with this. We don't use the get_internal_ucm_suffix scripts with unibuild

Project Member

Comment 4 by bugdroid1@chromium.org, Dec 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/a8925305c35d8f7c2f56ae0c1a6e08d3f2577ea8

commit a8925305c35d8f7c2f56ae0c1a6e08d3f2577ea8
Author: chuntsen <chuntsen@google.com>
Date: Fri Dec 14 03:28:26 2018

audio: Change the format of UCM directory.

The format of UCM directory is changed from "<card-name>" to
"<card-name>.<suffix>".

BUG=b:120574147,  chromium:788183 
TEST=manually test on my local device

Change-Id: I38d8b11080b903667aee28e72da3237c8163b9c0
Reviewed-on: https://chromium-review.googlesource.com/1371724
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Michael Yang <michael.h.yang@intel.corp-partner.google.com>
Reviewed-by: Ting Shen <phoenixshen@chromium.org>

[modify] https://crrev.com/a8925305c35d8f7c2f56ae0c1a6e08d3f2577ea8/py/device/audio/config_manager_unittest.py
[modify] https://crrev.com/a8925305c35d8f7c2f56ae0c1a6e08d3f2577ea8/py/device/audio/config_manager.py

Status: Fixed (was: Untriaged)

Sign in to add a comment