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

Issue 914254 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

CRAS: abnormal input buffer copy

Project Member Reported by hychao@chromium.org, Dec 12

Issue description

The problem is observed in a case of consecutive input device overrun.

2018-12-10T14:14:21.732401+05:30 ERR cras_server[1674]: pcm_avail returned frames larger than buf_size: sof-glkda7219max: :0,99: 16416 > 16320
2018-12-10T14:14:26.730359+05:30 ERR cras_server[1674]: trying to recover device 0x8 by resetting it
2018-12-10T14:14:26.750871+05:30 ERR cras_server[1674]: All streams read 48 frames exceeds 47 in input_data's buffer
2018-12-10T14:14:32.089873+05:30 ERR cras_server[1674]: trying to recover device 0x8 by resetting it
2018-12-10T14:14:32.110485+05:30 ERR cras_server[1674]: All streams read 192 frames exceeds 191 in input_data's buffer
2018-12-10T14:14:36.922626+05:30 WARNING metrics_daemon[2531]: [WARNING:metrics_daemon.cc(989)] cannot read /sys/class/thermal/thermal_zone6/temp: No data available
2018-12-10T14:14:37.447148+05:30 ERR cras_server[1674]: trying to recover device 0x8 by resetting it
2018-12-10T14:14:37.467228+05:30 ERR cras_server[1674]: All streams read 48 frames exceeds 47 in input_data's buffer
2018-12-10T14:14:42.815305+05:30 ERR cras_server[1674]: trying to recover device 0x8 by resetting it
2018-12-10T14:14:42.835697+05:30 ERR cras_server[1674]: All streams read 48 frames exceeds 47 in input_data's buffer

The line "All streams read 48 frames exceeds 47 in input_data's buffer" indicates CRAS detected incorrect input buffer copy, and tried to reset it.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 14

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

commit cbf0abd2354845249244569feca2e881be05cdb3
Author: Hsin-Yu Chao <hychao@google.com>
Date: Fri Dec 14 03:28:02 2018

CRAS: iodev - Reset input_dsp_offset at open

input_dsp_offset is used to track the position to where software
DSP has applied in last read. We should reset this value to zero
after iodev close/open, otherwise it may cause small amount of
buffer corruption at the start of new read.

BUG= chromium:914254 
TEST=Repeatedly start then stop audio input, verify there's no
err log regarding input buffer.

Change-Id: I624683e35cb4356a818f9ec38b34314f7be58940
Reviewed-on: https://chromium-review.googlesource.com/1373280
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/cbf0abd2354845249244569feca2e881be05cdb3/cras/src/server/cras_iodev.c

Labels: Merge-Request-72
This is a super low risk fix to cherry-pick to M72.
I've verified this on TOT. 
Project Member

Comment 3 by sheriffbot@chromium.org, Dec 14

Labels: -Merge-Request-72 Merge-Review-72 Hotlist-Merge-Review
This bug requires manual review: M72 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: govind@(Android), kariahda@(iOS), djmm@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: djmm@chromium.org
Labels: -Hotlist-Merge-Review -Merge-Review-72 Merge-Approved-72
Project Member

Comment 6 by bugdroid1@chromium.org, Dec 17

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

commit be75a0798f5b734ca12ce2e68190b29c846d5247
Author: Hsin-Yu Chao <hychao@google.com>
Date: Mon Dec 17 07:06:38 2018

CRAS: iodev - Reset input_dsp_offset at open

input_dsp_offset is used to track the position to where software
DSP has applied in last read. We should reset this value to zero
after iodev close/open, otherwise it may cause small amount of
buffer corruption at the start of new read.

BUG= chromium:914254 
TEST=Repeatedly start then stop audio input, verify there's no
err log regarding input buffer.

Change-Id: I624683e35cb4356a818f9ec38b34314f7be58940
Reviewed-on: https://chromium-review.googlesource.com/1373280
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
(cherry picked from commit cbf0abd2354845249244569feca2e881be05cdb3)
Reviewed-on: https://chromium-review.googlesource.com/c/1379440
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>

[modify] https://crrev.com/be75a0798f5b734ca12ce2e68190b29c846d5247/cras/src/server/cras_iodev.c

Labels: -Merge-Approved-72
Status: Fixed (was: Started)

Sign in to add a comment