New issue
Advanced search Search tips

Issue 866240 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Oct 4
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature



Sign in to add a comment

CRAS: Advanced feedback report

Project Member Reported by paulhsia@chromium.org, Jul 21

Issue description

crbug tracker for advanced feedback report for CRAS

After this change, several less frequent audio thread events like:
1. Busyloop
2. Underrun
3. Severe underrun

will trigger CRAS to take snapshot for audio thread and store in system state.

The snapshots could be print out by command

"cras_test_client --dump_e".

We'll dump snapshots in the feedback report sent from user to get more information for debugging less frequent event.

Please see detailed design from: https://docs.google.com/document/d/1gxyxBzHcUHgrlPhK3ptkGSUOxxHPNSv1pSDaNgkHPec/edit?usp=sharing
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 7

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

commit 087619bd1b0d772300e5f5ec87a13f19d243c395
Author: Paul Hsia <paulhsia@google.com>
Date: Tue Aug 07 08:50:06 2018

CRAS: Add audio_thread_monitor to CRAS

(Advanced feedback report for CRAS)

audio_thread_monitor will be used inside audio thread when some events
like busyloop, underrun and event underrun happen. The monitor will take
a snapshot for audio thread and store it to system state when events
occur.

Create new CRAS_MAIN_MESSAGE_TYPE - CRAS_MAIN_AUDIO_THREAD_EVENT for
audio thread events.
Create snapshot structure for storing audio thread information.
Create snapshot buffer structure and add it to server state structure.

BUG= chromium:866240 
TEST=audio_thread_monitor_unittest

Change-Id: If1240b95b57136b3d394af5d8cd746e0b8475e6e
Reviewed-on: https://chromium-review.googlesource.com/1148082
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/087619bd1b0d772300e5f5ec87a13f19d243c395/cras/src/common/cras_types.h
[add] https://crrev.com/087619bd1b0d772300e5f5ec87a13f19d243c395/cras/src/tests/audio_thread_monitor_unittest.cc
[modify] https://crrev.com/087619bd1b0d772300e5f5ec87a13f19d243c395/cras/src/server/cras_system_state.h
[modify] https://crrev.com/087619bd1b0d772300e5f5ec87a13f19d243c395/cras/src/server/cras_main_message.h
[modify] https://crrev.com/087619bd1b0d772300e5f5ec87a13f19d243c395/cras/src/Makefile.am
[modify] https://crrev.com/087619bd1b0d772300e5f5ec87a13f19d243c395/cras/src/server/cras_system_state.c
[add] https://crrev.com/087619bd1b0d772300e5f5ec87a13f19d243c395/cras/src/server/cras_audio_thread_monitor.h
[add] https://crrev.com/087619bd1b0d772300e5f5ec87a13f19d243c395/cras/src/server/cras_audio_thread_monitor.c

Project Member

Comment 2 by bugdroid1@chromium.org, Aug 7

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

commit 3c634b95e49898bbe76c7b2ca119ea1aa3f32aa9
Author: Paul Hsia <paulhsia@google.com>
Date: Tue Aug 07 08:50:06 2018

CRAS: Dump snapshots to shared memory with the client

(Advanced feedback report for CRAS)

Create new CRAS_SERVER_MESSAGE_ID - CRAS_SERVER_DUMP_SNAPSHOTS for
clients to send and handle it with dump_audio_thread_snapshots, which
will dump snapshots from system state to shared memory with the client
(exp_state).

BUG= chromium:866240 
TEST=rclient_unittest

Change-Id: Ibdf036f76b9a2ac428ce3d1c7b08b78624c095e1
Reviewed-on: https://chromium-review.googlesource.com/1148083
Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/3c634b95e49898bbe76c7b2ca119ea1aa3f32aa9/cras/src/common/cras_types.h
[modify] https://crrev.com/3c634b95e49898bbe76c7b2ca119ea1aa3f32aa9/cras/src/tests/rclient_unittest.cc
[modify] https://crrev.com/3c634b95e49898bbe76c7b2ca119ea1aa3f32aa9/cras/src/server/cras_system_state.h
[modify] https://crrev.com/3c634b95e49898bbe76c7b2ca119ea1aa3f32aa9/cras/src/server/cras_rclient.c
[modify] https://crrev.com/3c634b95e49898bbe76c7b2ca119ea1aa3f32aa9/cras/src/common/cras_messages.h
[modify] https://crrev.com/3c634b95e49898bbe76c7b2ca119ea1aa3f32aa9/cras/src/server/cras_system_state.c

Project Member

Comment 3 by bugdroid1@chromium.org, Aug 7

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

commit 000bd280370b9371b35da9a0f869d45ffb19a0e0
Author: Paul Hsia <paulhsia@google.com>
Date: Tue Aug 07 08:50:07 2018

CRAS: Expose snapshot update and get function for cras_client

Function cras_client_update_audio_thread_snapshots is for updating
snapshots with callback function.

Function cras_audio_thread_snapshot_buffer is for cras_client to get
snapshot_buffer pointer from the shared memory with server.

BUG= chromium:866240 
TEST=Apply full patch set to run
     $ cras_test_client --playback_file /dev/zero --playback_delay_us
     10000
     and input 'i' and 'key_enter' to cause underrun event. Then using
     $ cras_test_client --dump_e
     could see the audio thread snapshot for that event.

Change-Id: I9195f9bee6c690bd76a5c1ba0f40e2ca62ade533
Reviewed-on: https://chromium-review.googlesource.com/1148084
Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/000bd280370b9371b35da9a0f869d45ffb19a0e0/cras/src/libcras/cras_client.h
[modify] https://crrev.com/000bd280370b9371b35da9a0f869d45ffb19a0e0/cras/src/libcras/cras_client.c

Project Member

Comment 4 by bugdroid1@chromium.org, Aug 7

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

commit 0ac969032653ad0fcce106d425098d5fa10e27d1
Author: Paul Hsia <paulhsia@google.com>
Date: Tue Aug 07 08:50:07 2018

CRAS: Refactor audio_debug_info related functions

In cras_test_client, we'll need to use some code in those for printing
audio_debug_info when printing snapshot information.

BUG= chromium:866240 
TEST=Check if
     $ cras_test_client --dump_a
     works well.
TEST=Apply full patch set to run
     $ cras_test_client --playback_file /dev/zero --playback_delay_us
     10000
     and input 'i' and 'key_enter' to cause underrun event. Then using
     $ cras_test_client --dump_e"
     could see the audio thread snapshot for that event.

Change-Id: If7f30103ebe9913b635dbf460f940acbf4c40deb
Reviewed-on: https://chromium-review.googlesource.com/1148085
Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/0ac969032653ad0fcce106d425098d5fa10e27d1/cras/src/tests/cras_test_client.c

Project Member

Comment 5 by bugdroid1@chromium.org, Aug 7

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

commit 62f13cff586f323f1116c81f1be3842b57e961cb
Author: Paul Hsia <paulhsia@google.com>
Date: Tue Aug 07 08:50:08 2018

CRAS: Add methods to show snapshots in cras_test_client

Add option "--dump_events" in cras_test_client which will call
show_audio_thread_snapshots.

Function show_audio_thread_snapshots will use
audio_thread_snapshots as a callback function to call
cras_client_update_audio_thread_snapshots and print out audio thread
snapshots in snapshot buffer.

BUG= chromium:866240 
TEST=Apply full patch set to run
     $ cras_test_client --playback_file /dev/zero --playback_delay_us
     10000
     and input 'i' and 'key_enter' to cause underrun event. Then using
     $ cras_test_client --dump_e"
     could see the audio thread snapshot for that event.

Change-Id: I685b9c4ee813cfaaad3300866d780b030a16bb26
Reviewed-on: https://chromium-review.googlesource.com/1148086
Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/62f13cff586f323f1116c81f1be3842b57e961cb/cras/src/tests/cras_test_client.c

Project Member

Comment 6 by bugdroid1@chromium.org, Aug 7

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

commit 1ef46ee06cc610e139d834445837626686b41df4
Author: Paul Hsia <paulhsia@google.com>
Date: Tue Aug 07 08:50:08 2018

CRAS: Add busyloop event detection in audio_thread

Initialize audio thread monitor in cras_server.
Create a method - check_busyloop for detecting busyloop in audio thread
and take a snapshot for audio thread when busyloop occurs.

BUG= chromium:866240 
TEST=audio_thread_unittest

Change-Id: Iab6a05e16e4b17d1b6740e43562bfe8c5d193ec8
Reviewed-on: https://chromium-review.googlesource.com/1148087
Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/1ef46ee06cc610e139d834445837626686b41df4/cras/src/tests/audio_thread_unittest.cc
[modify] https://crrev.com/1ef46ee06cc610e139d834445837626686b41df4/cras/src/server/audio_thread.c
[modify] https://crrev.com/1ef46ee06cc610e139d834445837626686b41df4/cras/src/server/cras_server.c

Project Member

Comment 7 by bugdroid1@chromium.org, Aug 7

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

commit e2d6c6ab5f833a4c1a7bf3d95ebf268f9d2d69d4
Author: Paul Hsia <paulhsia@google.com>
Date: Tue Aug 07 08:50:09 2018

CRAS: Add underrun event detection in cras_iodev

Use audio_thread_monitor to take a snapshot for audio thread when
underrun, severe_underrun happen.

BUG= chromium:866240 
TEST=Apply full patch set to run
     $ cras_test_client --playback_file /dev/zero --playback_delay_us
     10000
     and input 'i' and 'key_enter' to cause underrun event. Then using
     $ cras_test_client --dump_e"
     could see the audio thread snapshot for that event.

Change-Id: I5cee8c12bf26f86e13f9c993bc5b95f3d135f5be
Reviewed-on: https://chromium-review.googlesource.com/1148088
Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/e2d6c6ab5f833a4c1a7bf3d95ebf268f9d2d69d4/cras/src/tests/iodev_unittest.cc
[modify] https://crrev.com/e2d6c6ab5f833a4c1a7bf3d95ebf268f9d2d69d4/cras/src/server/cras_iodev.c

Project Member

Comment 8 by bugdroid1@chromium.org, Aug 10

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

commit f4065c99bba1d98420e123ea11e87cc484293023
Author: Paul Hsia <paulhsia@google.com>
Date: Fri Aug 10 05:04:24 2018

adhd: Print snapshots in audio_diagnostics

Use command
$ cras_test_client --dump_events
to show the event snapshots for audio thread.

BUG= chromium:866240 
TEST=Run audio_diagnostics on DUT and check if snapshots are in
     the printed results.

Change-Id: Ic6124ae776f15bf7ebfc27eff1bfe3b731a56173
Reviewed-on: https://chromium-review.googlesource.com/1149760
Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>

[modify] https://crrev.com/f4065c99bba1d98420e123ea11e87cc484293023/scripts/audio_diagnostics

All CL are merged and seems it's stable.
Let's close the issue.
Status: Verified (was: Started)

Sign in to add a comment