Skip to content

Commit

Permalink
floop: close output iodev when no stream attached
Browse files Browse the repository at this point in the history
Remember to close the floop internal device when all streams are removed.

BUG=b:362679648
TEST=stop audio stream when recording from floop device \
     output floop device should be closed

Change-Id: Ia3bf98e5a17278e859bb51589f9380301431eeca
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/5890787
Reviewed-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Commit-Queue: Terry Cheong <htcheong@chromium.org>
Tested-by: chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com <chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com>
Reviewed-by: Li-Yu Yu <aaronyu@google.com>
  • Loading branch information
terry182 authored and Chromeos LUCI committed Oct 1, 2024
1 parent f58e1ef commit 4c6288c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cras/src/server/cras_iodev_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,17 @@ static int possibly_close_enabled_devs(enum CRAS_STREAM_DIRECTION dir) {
idle_dev_check(NULL, NULL);
}

// Flexible loopback (internal) devices are not enabled
// and should not have pinned streams.
if (dir == CRAS_STREAM_OUTPUT) {
struct cras_floop_pair* fpair;
DL_FOREACH (floop_pair_list, fpair) {
if (cras_iodev_is_open(&fpair->output)) {
cras_iodev_list_disable_floop_pair(fpair);
}
}
}

return 0;
}

Expand Down

0 comments on commit 4c6288c

Please sign in to comment.