New issue
Advanced search Search tips

Issue 756766 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

CRAS: system mute breaks when switching user mute from UI

Project Member Reported by hychao@chromium.org, Aug 18 2017

Issue description


What steps will reproduce the problem?
(1) cras_test_client --mute 1
(2) Play youtube
(3) toggle mute state from UI

What is the expected result?
when mute toggle, there should be no output at all

What happens instead?
during the short period of time user toggles mute, sound is heard.

We should fix this although the "system mute" state is never used.
And for testing purpose, I guess we should stick to "cras_test_client --user_mute" command.


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

 
Cc: dgreid@chromium.org
Hi kc, thank you for spotting this.
The root cause is that observer got the mute changed alert when system mute remains on, but user_mute changes.

The fix will be similar to

https://chromium-review.googlesource.com/428732

, where we do not notify observer that mute is changed.

In cras_system_notify_mute, we should only notify observer when the combined mute state:

mute || user_mute || mute_locked

is changed.

https://cs.corp.google.com/chromeos_public/src/third_party/adhd/cras/src/server/cras_system_state.c?type=cs&q=cras_system_notify_mute+package:%5Echromeos_public$&l=195

That is because what observer care should be the combined result of mute state.
If any observer is interested in individual mute, or user_mute, or mute_locked change, we should add a different API for that.

Project Member

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

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

commit 59b4d524a24d0f597b8a6da0c2647d27b096b7bf
Author: Cheng-Yi Chiang <cychiang@chromium.org>
Date: Thu Aug 24 10:24:13 2017

CRAS: system_state - Notify observers only when output mute is changed

System state should not notify observer when the output mute is not
changed.
For example, if system mute is set, switch user mute will not change
output mute. System state should not notify observers by
output_mute_changed alert.
This is needed since cras_iodev_list observe output_mute_changed to set
ramping up/down. It expects that whenever output_mute_changed is
observed, there should be mute->unmute or unmute->mute transition.

BUG= chromium:756766 
TEST=unittest
TEST=cras_test_client --mute 1. Then, press mute and volume up keys.
There will be no sound at all.

Change-Id: I9b79436829b61fc925aee6a6e273c27fbe7e806e
Reviewed-on: https://chromium-review.googlesource.com/627973
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/59b4d524a24d0f597b8a6da0c2647d27b096b7bf/cras/src/server/cras_system_state.c
[modify] https://crrev.com/59b4d524a24d0f597b8a6da0c2647d27b096b7bf/cras/src/tests/system_state_unittest.cc

Status: Fixed (was: Assigned)
Project Member

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

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

commit c8b70583dbd5167e82cd3d80d36aca91bdc17e61
Author: Cheng-Yi Chiang <cychiang@chromium.org>
Date: Thu Aug 31 04:24:11 2017

CRAS: system_state - Notify observers only when output mute is changed

System state should not notify observer when the output mute is not
changed.
For example, if system mute is set, switch user mute will not change
output mute. System state should not notify observers by
output_mute_changed alert.
This is needed since cras_iodev_list observe output_mute_changed to set
ramping up/down. It expects that whenever output_mute_changed is
observed, there should be mute->unmute or unmute->mute transition.

BUG= chromium:756766 
TEST=unittest
TEST=cras_test_client --mute 1. Then, press mute and volume up keys.
There will be no sound at all.

Change-Id: I9b79436829b61fc925aee6a6e273c27fbe7e806e
Reviewed-on: https://chromium-review.googlesource.com/627973
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 59b4d524a24d0f597b8a6da0c2647d27b096b7bf)
Reviewed-on: https://chromium-review.googlesource.com/645000
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>

[modify] https://crrev.com/c8b70583dbd5167e82cd3d80d36aca91bdc17e61/cras/src/server/cras_system_state.c
[modify] https://crrev.com/c8b70583dbd5167e82cd3d80d36aca91bdc17e61/cras/src/tests/system_state_unittest.cc

Sign in to add a comment