-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CRAS: alsa_jack - Simplify create node and associate jack
The caller to cras_jack_list_create() passes in a callback for jack plugged state change event. And originally we override this callback for node creation, which is unnecessary and causes confusion to developers. For example, it seems like jack plugging could add a new node but that's actually not allowed and guarded by other implicit assumptions. This commit separates the tasks of creating node or associate jack with existing node into another callback passed into cras_alsa_jack_list_find_jacks_by_name_matching() so we have a clear view of the functions' mission: - During alsa iodev creation: - cras_jack_list_create(... jack_plug_cb) - cras_alsa_jack_list_find_jacks_by_name_matching(... node_cb) - node_cb is called on each jack found - After iodev creation: - jack_plug_cb could be called to change node's "plugged" state - No chance for node_cb being called afterwards This is a preliminary change for future refactor to CRAS ALSA related modules. Various unittest cases are fixed for the incorrect sequence run around alsa_io and its node/jack creation. BUG=None TEST=unittest Change-Id: I4fe5a873314617a7569bfcf17b958a29750bf945 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/5016543 Reviewed-by: Ching Yun Chang <whalechang@google.com> Commit-Queue: Hsinyu Chao <hychao@chromium.org> Tested-by: chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com <chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com>
- Loading branch information
Hsin-yu Chao
authored and
Chromeos LUCI
committed
Nov 16, 2023
1 parent
cd7d20c
commit 3c05f2c
Showing
7 changed files
with
390 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.