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

Issue 776773 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocked on:
issue 779936

Blocking:
issue 794954



Sign in to add a comment

audio_AlsaLoopback failing on many boards

Project Member Reported by wuchengli@chromium.org, Oct 20 2017

Issue description

audio_AlsaLoopback failed on eve, elm, kevin, snappy, cave, banon, and asuka.

Here's the error on eve.
# amixer -c 0 sset Master 100%
amixer: Unable to find simple control 'Master',0



It looks like alsa_rms_test_setup should be fixed.


def alsa_rms_test_setup():
    card_id = alsa_utils.get_first_soundcard_with_control('Mic Jack', 'Mic')
    arch = utils.get_arch()
    board = utils.get_board()
    uses_max98090 = os.path.exists('/sys/module/snd_soc_max98090')
    if board in ['daisy_spring', 'daisy_skate']:
        # The MIC controls of the boards do not support dB syntax.
        alsa_utils.mixer_cmd(card_id,
                             ['sset', 'Headphone', _DEFAULT_ALSA_MAX_VOLUME])
        alsa_utils.mixer_cmd(card_id, ['sset', 'MIC1',
                                       _DEFAULT_ALSA_MAX_VOLUME])
        alsa_utils.mixer_cmd(card_id, ['sset', 'MIC2',
                                       _DEFAULT_ALSA_MAX_VOLUME])
    elif arch in ['armv7l', 'aarch64'] or uses_max98090:
        # ARM platforms or Intel platforms that uses max98090 codec driver.
        alsa_utils.mixer_cmd(card_id,
                             ['sset', 'Headphone', _DEFAULT_ALSA_MAX_VOLUME])
        alsa_utils.mixer_cmd(card_id, ['sset', 'MIC1',
                                       _DEFAULT_ALSA_CAPTURE_GAIN])
        alsa_utils.mixer_cmd(card_id, ['sset', 'MIC2',
                                       _DEFAULT_ALSA_CAPTURE_GAIN])
    else:
        # The rest of Intel platforms.
        alsa_utils.mixer_cmd(card_id, ['sset', 'Master',
                                       _DEFAULT_ALSA_MAX_VOLUME])
        alsa_utils.mixer_cmd(card_id,
                             ['sset', 'Capture', _DEFAULT_ALSA_CAPTURE_GAIN])


Jimmy. What should we do? Is this logic from UCM? Should we use cras to get this data?
 
I discussed with Jimmy. We should not hardcode mixer control names in alsa_rms_test_setup. UCM has those information and cras knows how to configure them.

https://chromium-review.googlesource.com/#/c/chromiumos/third_party/autotest/+/735100
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/d0f7e814760c93fd6f8ebff56b636e590a515dc6

commit d0f7e814760c93fd6f8ebff56b636e590a515dc6
Author: Wu-Cheng Li <wuchengli@google.com>
Date: Tue Oct 24 14:29:42 2017

audio_helper: use cras to setup rms test.

Different boards and chipsets have different mixer controls.
alsa_rms_test_setup hardcoded the mixer control names. UCM
has those information and we should use CRAS to set up the
controls.

BUG= chromium:776773 
TEST=Run audio_AlsaLoopback on eve.

Change-Id: I3dd8aa5d87586b94c1af64470b4fc2d98be56c3b
Reviewed-on: https://chromium-review.googlesource.com/735100
Commit-Ready: Wu-Cheng Li <wuchengli@chromium.org>
Tested-by: Wu-Cheng Li <wuchengli@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>

[modify] https://crrev.com/d0f7e814760c93fd6f8ebff56b636e590a515dc6/client/cros/audio/audio_helper.py

veyron_jerry 10067.0.0 failed. chrome was using the device? We should nuke chrome in autotest.

10/26 02:16:55.350 INFO |         cmd_utils:0220| [0008] Running: /usr/bin/aplay -c 2 -f S16_LE -r 48000 -D plughw:0 /usr/local/autotest/tests/audio_AlsaLoopback/10SEC.wav
10/26 02:16:55.361 INFO |         cmd_utils:0230| [0008] pid is 13844
10/26 02:16:55.367 ERROR|         cmd_utils:0092| [0008] aplay: main:788: audio open error: Device or resource busy
10/26 02:16:55.377 ERROR|         cmd_utils:0092| [0008] 
10/26 02:16:56.366 INFO |         cmd_utils:0220| [0009] Running: /usr/bin/amixer -c 0 controls
10/26 02:16:56.387 INFO |         cmd_utils:0230| [0009] pid is 13849
10/26 02:16:56.413 INFO |         cmd_utils:0220| [0010] Running: /usr/bin/amixer -c 0 scontrols
10/26 02:16:56.434 INFO |         cmd_utils:0230| [0010] pid is 13850
10/26 02:16:56.458 INFO |         cmd_utils:0220| [0011] Running: /usr/bin/arecord -l
10/26 02:16:56.468 INFO |         cmd_utils:0230| [0011] pid is 13851
10/26 02:16:56.475 INFO |         cmd_utils:0220| [0012] Running: /usr/bin/arecord -l
10/26 02:16:56.484 INFO |         cmd_utils:0230| [0012] pid is 13852
10/26 02:16:56.491 INFO |         cmd_utils:0220| [0013] Running: /usr/bin/arecord -d 1 -c 1 -f S16_LE -r 48000 -D plughw:0,0 /usr/local/autotest/results/default/audio_AlsaLoopback/results/hw_recorded.wav
10/26 02:16:56.500 INFO |         cmd_utils:0230| [0013] pid is 13853
10/26 02:16:56.507 ERROR|         cmd_utils:0092| [0013] Recording WAVE '/usr/local/autotest/results/default/audio_AlsaLoopback/results/hw_recorded.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
10/26 02:16:56.517 ERROR|         cmd_utils:0092| [0013] 
10/26 02:16:57.518 WARNI|         cmd_utils:0141| command exit (pid=13844, rc=1): /usr/bin/aplay -c 2 -f S16_LE -r 48000 -D plughw:0 /usr/local/autotest/tests/audio_AlsaLoopback/10SEC.wav
10/26 02:16:57.544 DEBUG|              test:0389| Test failed due to playback stopped. Exception log follows the after_iteration_hooks.
Blockedon: 779936
I believe some failures will be gone after 779936 is fixed. Let's revisit after 779936 is fixed.
Several boards have "Failure: iteration 0:rms_value > 0.05: constraint was not met". I'm looking into audio_CrasLoopback first.
Project Member

Comment 6 by bugdroid1@chromium.org, Nov 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/121ab63ab499edc4082797427fc294f7816c1e1a

commit 121ab63ab499edc4082797427fc294f7816c1e1a
Author: Wu-Cheng Li <wuchengli@google.com>
Date: Wed Nov 15 15:36:23 2017

audio_AlsaLoopback: use cras_util to get active output and output.

On eve, the audio was incorrectly output to internal speaker.
The default audio device may not be the active one. Use
cras_utils to get the active input and output device.

BUG= chromium:776773 
TEST=Run audio_AlsaLoopback on eve and elm.

Change-Id: Ia48b72fb9770557b3272177d593bf11e7c7c0e91
Reviewed-on: https://chromium-review.googlesource.com/770930
Commit-Ready: Wu-Cheng Li <wuchengli@chromium.org>
Tested-by: Wu-Cheng Li <wuchengli@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>

[modify] https://crrev.com/121ab63ab499edc4082797427fc294f7816c1e1a/client/cros/audio/alsa_utils.py
[modify] https://crrev.com/121ab63ab499edc4082797427fc294f7816c1e1a/client/cros/audio/cras_utils.py
[modify] https://crrev.com/121ab63ab499edc4082797427fc294f7816c1e1a/client/site_tests/audio_AlsaLoopback/audio_AlsaLoopback.py

Status: Fixed (was: Assigned)
Most boards are passing. The only ones failing are rikku and butterfly. They always recorded very low volume (RMS=0.03) even when there's no volume scale. It should not a test problem. Let me close this and file new bugs for rikku and butterfly. I've added audio_AlsaLoopback to email of test failure alert list.
Cc: ka...@chromium.org vsu...@chromium.org avkodipelli@chromium.org
Blocking: 794954

Sign in to add a comment