mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 02:25:23 +00:00
device: virtio: snd: Call release_worker in prepare
Since VIRTIO_SND_R_PCM_PREPARE -> VIRTIO_SND_R_PCM_PREPARE is a valid transition, we need to release the worker if it's already in VIRTIO_SND_R_PCM_PREPARE state. Or we could trigger ``` Error in handling tx queue: Error in mpsc: send failed because receiver is gone ``` in handle_pcm_queue while sending `desc_chain` to start_pcm_worker through the `stream_info.sender()`. BUG=b:202368198 TEST=Run alsa_conformance_test multiple times Change-Id: I5f8ee370832ee162fdef71d396dfe848d88af7e1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3317328 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org> Reviewed-by: Woody Chow <woodychow@google.com> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
This commit is contained in:
parent
c6d01914de
commit
049746fb8a
1 changed files with 3 additions and 0 deletions
|
@ -270,6 +270,9 @@ impl<'a> StreamInfo<'a> {
|
|||
);
|
||||
return Err(Error::OperationNotSupported);
|
||||
}
|
||||
if self.state == VIRTIO_SND_R_PCM_PREPARE {
|
||||
self.release_worker().await?;
|
||||
}
|
||||
let frame_size = self.channels as usize * self.format.sample_bytes();
|
||||
if self.period_bytes % frame_size != 0 {
|
||||
error!("period_bytes must be divisible by frame size");
|
||||
|
|
Loading…
Reference in a new issue