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

Issue 748201 link

Starred by 3 users

Issue metadata

Status: Verified
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Onboard audio is not working after Suspend/Resume.

Project Member Reported by sontis@chromium.org, Jul 24 2017

Issue description

Chrome Version: 9774.0.0/ 62.0.3165.0
OS: ChromeOS

What steps will reproduce the problem?
(1) Sign in  to the device.
(2) Play any youtube video.
(3) Close lid to suspend the device.
(4) Open lid to resume the device.

What is the expected result?
Audio should work properly.

What happens instead?
Onboard audio is missing after suspend/resume.

Please use labels and text to provide additional information.


For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.

 
Summary: Onboard audio is not working after Suspend/Resume. (was: [Kevin] Onboard audio is not working after Suspend/Resume.)
Able to repro the same on Auron-Paine with 9774.0.0 / 62.0.3165.0
Labels: Arch-ARM
Reproducible in Bob in 9774.0.0 / 62.0.3165.0. 
But Caroline works fine. 

Comment 4 by ka...@chromium.org, Jul 24 2017

Cc: bhthompson@chromium.org
Labels: -Arch-ARM
The audio_AudioAfterSuspend.internal_speaker test does not show this issue on kevin - https://screenshot.googleplex.com/uyK81hnYuar
All boards - https://screenshot.googleplex.com/adQcPeCGAcx

is there anything else specific to the test? Can you try audio player, and not youtube?
Cc: hychao@chromium.org cychiang@chromium.org
Owner: cychiang@chromium.org
Status: Assigned (was: Untriaged)
Status: Started (was: Assigned)
This can be reproduced on 9774.0 image.

However, this can NOT be reproduced when using sox or cras_test_client to play audio.

However, playing audio from Chrome can repro the issue.
This might be an issue of Chrome.


      1571.608417104  STREAM_REMOVED                 id:1
      1571.608418667  ODEV_NO_STREAMS                dev:8
      1571.608433958  FILL_ODEV_ZEROS                dev:8 write:144
      1571.608537190  FILL_ODEV_ZEROS                dev:8 write:0
      1571.608540107  SET_DEV_WAKE                   dev:8 hw_level:2048 sleep:1024
      1571.608540593  DEV_SLEEP_TIME                 dev:8 wake:000001571.629872889
      1571.608541756  SLEEP                          sleep:000000000.021334987 longest_wake:001037209
      1571.629892677  WAKE                           num_fds:0
      1571.629906830  FILL_ODEV_ZEROS                dev:8 write:1040
      1571.630073070  SET_DEV_WAKE                   dev:8 hw_level:2048 sleep:1024
      1571.630073388  DEV_SLEEP_TIME                 dev:8 wake:000001571.651406079
      1571.630074003  SLEEP                          sleep:000000000.021335540 longest_wake:001037209
      1571.651446818  WAKE                           num_fds:0
      1571.651482907  SLEEP                          sleep:000000000.000000000 longest_wake:001037209
      1573.152638038  WAKE                           num_fds:1
      1573.152642098  PB_MSG                         msg_id:2
      1573.152642459  WRITE_STREAMS_WAIT             stream:1
      1573.152651154  STREAM_ADDED                   id:1 dev:8
      1573.152660891  WRITE_STREAMS_FETCH_STREAM     id:1 cbth:1024 delay:1296
      1573.152670184  SLEEP                          sleep:000000000.000000000 longest_wake:001037209
      1573.152731048  WAKE                           num_fds:1
      1573.152738759  ODEV_LEAVE_NO_STREAMS          dev:8
      1573.152870027  DEV_REMOVED                    dev:8 -----------------> Device is removed because there is an error from do_playback.

Now we need to check why do_playback fails after suspend for chrome client.


It turned out that there are two issues:
1. Pinned stream playback resume does not work.
2. Chrome accidentally uses pinned stream after CL https://chromium-review.googlesource.com/538754.

The chrome change will be reverted. Track it in  issue 748267 .

In this issue I am going to fix the resume path for pinned stream.

The step to repro for pinned stream playback after resume:

cras_test_client --playback_f /usr/local/autotest/cros/audio/fix_440_16.raw --pin 8

powerd_dbus_suspend

After resume audio does not come back.

I found that the device is not closed.
So after resume, CRAS thinks device is still open, so it does not open and trigger it.
So the device state remains SUSPENDED.

I think we should fix dev_has_pinned_stream and close_dev.


Labels: M-61
reproducible in falco in Chrome OS 9765.5.0, 61.0.3163.11. 
cychiang@ can you please revert this for 61 Chrome as well?

Comment 13 by x...@chromium.org, Jul 25 2017

I'll do it on behalf of cychiang@.

Comment 14 by x...@chromium.org, Jul 25 2017

Re#13: warx@ has reverted the suspicious CL so nothing to revert anymore:)
Not able to reproduce this issue on M61 build 9765.7.0
Google Chrome : 62.0.3166.0 (Official Build) dev (32-bit)
Platform: 9781.0.0 (Official Build) dev-channel bob

The issue is still reproducible.  

CL is still on R62 and ToT waiting to be fixed.
https://bugs.chromium.org/p/chromium/issues/detail?id=748267#c25
Labels: -M-61
Project Member

Comment 19 by bugdroid1@chromium.org, Jul 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/adhd/+/9c03f0511c73e21a6d91b0c4402aaab5be95681d

commit 9c03f0511c73e21a6d91b0c4402aaab5be95681d
Author: Cheng-Yi Chiang <cychiang@chromium.org>
Date: Thu Jul 27 09:42:52 2017

CRAS: iodev_list - Fix closing pinned stream

The expected suspend/resume flow:
When system suspends, all the streams are disconnected from device, and
are kept in stream_list. After resume, the device will be opened, and
streams will be attached to devices.

When closing a device, we should check whether there is a pinned stream
currently attached to the device, instead of checking whether there is a
stream that should be pinned to device.
Otherwise, at suspend we will not close the device which has played
a pinned stream. This breaks the flow for resume where we skip opening
the device since it is in open state, while in fact it is in suspended
state.

BUG= chromium:748201 
TEST=make check
TEST=On auron_paine, play audio using pinned stream:
 $ cras_test_client --playback_f
/usr/local/autotest/cros/audio/fix_440_16.raw --pin 8
 $ powerd_dbus_suspend
 Then wake up system and make sure audio keeps playing.
Change-Id: I4cfe020db79bee21135df27da81042b98a83dbbc
Reviewed-on: https://chromium-review.googlesource.com/585033
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/9c03f0511c73e21a6d91b0c4402aaab5be95681d/cras/src/server/cras_iodev.h
[modify] https://crrev.com/9c03f0511c73e21a6d91b0c4402aaab5be95681d/cras/src/server/cras_iodev_list.c
[modify] https://crrev.com/9c03f0511c73e21a6d91b0c4402aaab5be95681d/cras/src/server/cras_iodev.c
[modify] https://crrev.com/9c03f0511c73e21a6d91b0c4402aaab5be95681d/cras/src/tests/iodev_list_unittest.cc

Project Member

Comment 20 by bugdroid1@chromium.org, Jul 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/adhd/+/0482e802cd71f301a844663245e176508507346f

commit 0482e802cd71f301a844663245e176508507346f
Author: Cheng-Yi Chiang <cychiang@chromium.org>
Date: Thu Jul 27 09:42:52 2017

CRAS: iodev_list_unittest - Remove unused variable

cras_system_get_suspended and cras_system_get_suspended_val are not used
anywhere in this unittest.

BUG= chromium:748201 
TEST=make check
Change-Id: Ifd3e8bdaef7aaad73f7d434e2dffce6e8f963a37
Reviewed-on: https://chromium-review.googlesource.com/586074
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>

[modify] https://crrev.com/0482e802cd71f301a844663245e176508507346f/cras/src/tests/iodev_list_unittest.cc

Status: Fixed (was: Started)
The latest build 9797.0.0 has the culprit CL in chrome reverted, and also has the pinned stream fixed. So the two different problems in #9 are both fixed now. 
Status: Verified (was: Fixed)
Verified in Chrome OS 9824.0.0, 62.0.3176.0 on Kevin. 
Project Member

Comment 23 by bugdroid1@chromium.org, Aug 13 2017

Labels: merge-merged-release-R61-9765.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/adhd/+/2d366c2e959333c2226cabfa212da684ae99728d

commit 2d366c2e959333c2226cabfa212da684ae99728d
Author: Cheng-Yi Chiang <cychiang@chromium.org>
Date: Sun Aug 13 02:13:17 2017

CRAS: iodev_list - Fix closing pinned stream

The expected suspend/resume flow:
When system suspends, all the streams are disconnected from device, and
are kept in stream_list. After resume, the device will be opened, and
streams will be attached to devices.

When closing a device, we should check whether there is a pinned stream
currently attached to the device, instead of checking whether there is a
stream that should be pinned to device.
Otherwise, at suspend we will not close the device which has played
a pinned stream. This breaks the flow for resume where we skip opening
the device since it is in open state, while in fact it is in suspended
state.

BUG= chromium:748201 
BUG=b:62333370
TEST=make check
TEST=On auron_paine, play audio using pinned stream:
 $ cras_test_client --playback_f
/usr/local/autotest/cros/audio/fix_440_16.raw --pin 8
 $ powerd_dbus_suspend
 Then wake up system and make sure audio keeps playing.
Change-Id: I4cfe020db79bee21135df27da81042b98a83dbbc
Reviewed-on: https://chromium-review.googlesource.com/585033
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
(cherry picked from commit 9c03f0511c73e21a6d91b0c4402aaab5be95681d)
Reviewed-on: https://chromium-review.googlesource.com/611751
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>

[modify] https://crrev.com/2d366c2e959333c2226cabfa212da684ae99728d/cras/src/server/cras_iodev.h
[modify] https://crrev.com/2d366c2e959333c2226cabfa212da684ae99728d/cras/src/server/cras_iodev_list.c
[modify] https://crrev.com/2d366c2e959333c2226cabfa212da684ae99728d/cras/src/server/cras_iodev.c
[modify] https://crrev.com/2d366c2e959333c2226cabfa212da684ae99728d/cras/src/tests/iodev_list_unittest.cc

Project Member

Comment 24 by bugdroid1@chromium.org, Aug 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/adhd/+/55b5dc5b2783167ad47578ebd5d3533530c08add

commit 55b5dc5b2783167ad47578ebd5d3533530c08add
Author: Cheng-Yi Chiang <cychiang@chromium.org>
Date: Thu Aug 31 04:23:16 2017

CRAS: iodev_list_unittest - Remove unused variable

cras_system_get_suspended and cras_system_get_suspended_val are not used
anywhere in this unittest.

BUG= chromium:748201 
TEST=make check

Change-Id: Ifd3e8bdaef7aaad73f7d434e2dffce6e8f963a37
Reviewed-on: https://chromium-review.googlesource.com/586074
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
(cherry picked from commit 0482e802cd71f301a844663245e176508507346f)
Reviewed-on: https://chromium-review.googlesource.com/644790
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>

[modify] https://crrev.com/55b5dc5b2783167ad47578ebd5d3533530c08add/cras/src/tests/iodev_list_unittest.cc

Sign in to add a comment