New issue
Advanced search Search tips

Issue 821680 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Elm: audio_CRASFormatConversion failure

Project Member Reported by cychiang@chromium.org, Mar 14 2018

Issue description

I found out the reason of this failure. It's because function read_and_handle_client_message doesn't handle the situation about rc get 0(EOF) or -1(broken pipe). It causes audio thread wake up frequently.

I have the first patch to reduce probability of timeout. But it still have other bugs to cause timeout in elm.

https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/1049406
Project Member

Comment 3 by bugdroid1@chromium.org, May 9 2018

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

commit 63fb1d7d9ad67dd4fe9bb6a8a4664b59cd720e8b
Author: Yu-hsuan Hsu <yuhsuan@google.com>
Date: Wed May 09 18:21:35 2018

CRAS: rstream - Clear pending reply while stream disconnected

While stream disconnected, audio thread may not receive client's message
correctly. We need to handle the situation of read function returning
0 or -1.

When stream of client disconnected, we can get into this function
because its fd have POLLIN flag. We have two kind of return value from
read function now.

1. If there still exist data written by audio thread in socket fd and
it hasn't been read by client yet, read function will return -1
(Connection reset by peer).

2. If socket fd is empty, read function will return 0.

We need to clear pending reply in these two situations. If not, it may
cause audio thread wake up frequently.

BUG=chromium:821680
TEST=Reduce timeout probability of CRASFormatConversion test.

Change-Id: I91ead5f8585f366dfcdf4201ae2dcb9fd32fde12
Reviewed-on: https://chromium-review.googlesource.com/1049406
Commit-Ready: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Tested-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/63fb1d7d9ad67dd4fe9bb6a8a4664b59cd720e8b/cras/src/server/cras_rstream.c

Sign in to add a comment