Skip to content

Commit

Permalink
sidetone: Restart sidetone when output device is changed
Browse files Browse the repository at this point in the history
Restart sidetone when output device is changed to enable/disable echo
cancellation.

BUG=b:368225372
TEST=Plug in a headphone, enable sidetone, then plug out the headphone

Change-Id: I568d121151e8f3b7b7f33b99407842b24cfad83d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/5872289
Auto-Submit: Norman Bintang <normanbt@chromium.org>
Reviewed-by: Li-Yu Yu <aaronyu@google.com>
Tested-by: Norman Bintang <normanbt@chromium.org>
Tested-by: chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com <chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com>
Commit-Queue: Norman Bintang <normanbt@chromium.org>
  • Loading branch information
Norman Bintang authored and Chromeos LUCI committed Sep 24, 2024
1 parent 61be0a3 commit 98d3cf8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cras/src/server/cras_iodev_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -2228,12 +2228,9 @@ void cras_iodev_list_select_node(enum CRAS_STREAM_DIRECTION direction,
}
}

if (direction == CRAS_STREAM_OUTPUT && new_dev && new_dev->active_node) {
bool available = is_sidetone_available(new_dev->active_node->type);
if (!available) {
cras_system_set_sidetone_enabled(false);
}
cras_observer_notify_sidetone_supported_changed(available);
if (direction == CRAS_STREAM_OUTPUT && cras_system_get_sidetone_enabled()) {
cras_system_set_sidetone_enabled(false);
cras_system_set_sidetone_enabled(true);
}

cras_iodev_list_notify_active_node_changed(direction);
Expand Down

0 comments on commit 98d3cf8

Please sign in to comment.