Skip to content

Commit a2690ae

Browse files
Cranel WChromeos LUCI
Cranel W
authored and
Chromeos LUCI
committed
CRAS: support style transfer for ALSA_LOOPBACK
In the tast test cras_noise_cancellation.go, we're using alsa loopback to generate microphone input and trigger the invocation of the effect. Before this change, style transfer has been updated to support internal mic only, which resulted in testing with unexpected effect. This change makes style transfer not only support internal mic but also alsa loopback to make the test with correct effect. BUG=b:347911392 TEST=tast run ${D} audio.CrasNoiseCancellation.aec_nc_ast Change-Id: I418f23e6a8eb372d455e3b99a3955d54008e3fd8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/5633068 Tested-by: Cranel W <[email protected]> Reviewed-by: Li-Yu Yu <[email protected]> Commit-Queue: Cranel W <[email protected]>
1 parent 2c92694 commit a2690ae

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cras/src/server/cras_alsa_common_io.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ enum CRAS_NC_PROVIDER cras_alsa_common_get_nc_providers(
7171
struct cras_use_case_mgr* ucm,
7272
const struct cras_ionode* node) {
7373
enum CRAS_NC_PROVIDER provider = 0;
74-
if (node->type == CRAS_NODE_TYPE_MIC &&
75-
(node->position == NODE_POSITION_INTERNAL ||
76-
node->position == NODE_POSITION_FRONT) &&
77-
cras_system_get_style_transfer_supported()) {
74+
if ((node->type == CRAS_NODE_TYPE_ALSA_LOOPBACK || // Alsa loopback.
75+
(node->type == CRAS_NODE_TYPE_MIC && // Internal mic.
76+
(node->position == NODE_POSITION_INTERNAL ||
77+
node->position == NODE_POSITION_FRONT))) &&
78+
cras_system_get_style_transfer_supported()) { // Supportness.
7879
provider |= CRAS_NC_PROVIDER_AST;
7980
}
8081
if (ucm && cras_system_get_dsp_noise_cancellation_supported() &&

0 commit comments

Comments
 (0)