New issue
Advanced search Search tips

Issue 916508 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

CRAS: Pending stream is not moved to stream

Project Member Reported by cychiang@chromium.org, Dec 19

Issue description

There is a bug in pending stream

23be69a9 CRAS: Do not mix stream before its first fetching

Steps to repro:

1. Plug in 3.5mm headphone
2. Play youtube
3. switch from headphone to speaker.

From audio thread log, it seems that the new stream is added in to pending stream, but audio thread does not have a chance to wake up and see that pending stream needs to be moved to stream list.

On the other hand, this process of moving pending stream into stream list is good for the very first stream.
So there is something wrong with this mechanism when fallback device is involved in the device switching process.
 
AI: add a test to check the switching while playing. Currently our tests does not cover this scenario.

Note that I spotted a possible bug:

get_next_output_wake should take pending stream into consideration.

But that does not look like the root cause.
Yes, it is the root cause. I've uploaded the CL on crrev.com/c/1385826
Because the audio thread didn't take pending streams in account, it causes audio thread can not wake up by itself.
Project Member

Comment 3 by bugdroid1@chromium.org, Dec 20

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

commit dc96519c4b8342f5b2ea49eb864ceef2a3193fd1
Author: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Date: Thu Dec 20 21:49:42 2018

CRAS: audio_thread - get_next_output_wake should consider pending stream

This bug is related to

23be69a CRAS: Do not mix stream before its first fetching

In get_next_output_wake function, also need to consider pending streams.

BUG= chromium:916508 , b:117915490
TEST=Playback works fine after switching output node.

Change-Id: I1e75b454d00a7a1e738acdbd705e272efcf520c1
Reviewed-on: https://chromium-review.googlesource.com/1385826
Commit-Ready: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Tested-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>

[modify] https://crrev.com/dc96519c4b8342f5b2ea49eb864ceef2a3193fd1/cras/src/server/audio_thread.c

Status: Fixed (was: Untriaged)

Sign in to add a comment