crosvm/devices
Pattara Teerapong f4e28dc292 devices: virtio: snd: Fix stream release when no data is received
Signal PCM worker on stream release to let the worker break out of the
main loop and be released successfully while CRAS is suspended/broken
and doesn't send data to the worker.

After receiving the stream release command, wait up to 2 periods to
respond to the last buffer and stop the worker. If 2 periods passed
without receiving a new buffer, then stop the worker anyway.

Originally this CL is to handle the case when CRAS is suspended, but we
fixed it by changing the suspend order. We found that this CL can help
with b/297454482 when the worker get stuck due to broken mic.

BUG=b:248470751, b:297454482
TEST=Open/Close stream in ARCVM multiple times and check there is no
     "Error reading msg" or "fetch err" error
TEST=`atest android.media.audio.cts.AudioNativeTest#testRecordAudit
      android.media.audio.cts.AudioNativeTest#testRecordStreamData` on
      chronicler

Change-Id: If9185e46173971d06af934d5054a0dda2866c592
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4054215
Auto-Submit: Pattara Teerapong <pteerapong@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Judy Hsiao <judyhsiao@google.com>
Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>
2023-08-31 08:23:40 +00:00
..
src devices: virtio: snd: Fix stream release when no data is received 2023-08-31 08:23:40 +00:00
tests/irqchip Remove target_arch = "x86" checks 2023-08-18 23:36:47 +00:00
Cargo.toml Cargo.toml: add version to chrono dependencies 2023-08-11 21:02:25 +00:00