New issue
Advanced search Search tips

Issue 863284 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Oct 30
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

CRAS: crash signature dsp_util_interleave_s16le-abc023e4

Project Member Reported by hychao@chromium.org, Jul 13

Issue description

0x000055e7d441e888	(cras -dsp_util.c:333 )	dsp_util_interleave_s16le
0x000055e7d441e7a3	(cras -dsp_util.c:558 )	dsp_util_interleave
0x000055e7d43fc049	(cras -cras_dsp_pipeline.c:865 )	cras_dsp_pipeline_apply
0x000055e7d4401bc7	(cras -cras_iodev.c:348 )	cras_iodev_get_input_buffer
0x000055e7d440bd6f	(cras -dev_io.c:362 )	dev_io_capture
0x000055e7d440c6b1	(cras -dev_io.c:727 )	dev_io_run
0x000055e7d43f73ca	(cras -audio_thread.c:848 )	audio_io_thread
0x00007b63dc05b2b7	(libpthread-2.23.so -pthread_create.c:333 )	start_thread
0x00007b63db5d4fac	(libc-2.23.so + 0x000f6fac )	clone
 
note that this can be reproduced by enabling AEC and force SRC:

cras_test_client --capture_file /tmp/1 --effects aec --rate=16000

Project Member

Comment 2 by bugdroid1@chromium.org, Jul 20

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

commit 01cb7834245ded8ea4c72a777ad21ceee05aa193
Author: Hsin-Yu Chao <hychao@chromium.org>
Date: Fri Jul 20 12:30:59 2018

CRAS: iodev - Handle input_dsp_offset larger than read frames

input_dsp_offset is used to track to where in input buffer we've
applied dsp. Handle the case when number of read frames is smaller
than this offset value.

Note that this "input_dsp_offset >= frames" case didn't happen before
we add APM processing. The scenario to trigger this is by creating an
input stream of buffer size smaller than 10 ms equivalent of data,
which is the chunk size APM requires when processing data.

The exact detail is complicated when problem triggered. The rough idea
is that: suppose APM processes data in chunk of N frames which is larger
than stream shm size M.  At some point audio thread could read N frames of
data from device, which makes input_dsp_offset = N. But stream side has
only M frames of room, so the number of requested/read frames from device
is M.

It's very difficult to avoid the "input_dsp_offset >= frames" case.
One possible solution to avoid this is to rework the dev_stream_capture_avail()
to report something smarter.  But that doesn't work beceause of a
foundamental issue: when APM's buffer is full, the stream capture avail
has to report '0'.  And that will confuse audio thread with the case when
client is late to consume shm data.

BUG= chromium:863284 
TEST=cras_test_client --capture_file /tmp/1 --effects aec --block_size 170
And use valgrind to verify that there's no memory issue.

Change-Id: I6bca034b5c1fbff9d00cdb637015249953133d43
Reviewed-on: https://chromium-review.googlesource.com/1141680
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/01cb7834245ded8ea4c72a777ad21ceee05aa193/cras/src/server/cras_iodev.c

Status: Verified (was: Assigned)
There's no more crash on dsp_util_inetrleave after version > 10895

Sign in to add a comment