From bd5cde190dd90581797542e6a88f548ecbd56411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=2E=20Andrei=20M=C4=83ce=C8=99?= Date: Tue, 16 Jan 2018 21:26:06 +0200 Subject: audio: Make CVD version retrieval nonfatal with ACDB v1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This information is only needed at the initialization of ACDB v[23]. Change-Id: I5bbd99d661c55ca623cbe8fb56b54f29888de47c Signed-off-by: D. Andrei Măceș --- hal/acdb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hal/acdb.c b/hal/acdb.c index 58f219a8..0c008e19 100644 --- a/hal/acdb.c +++ b/hal/acdb.c @@ -99,7 +99,13 @@ int acdb_init(int snd_card_num) ctl = mixer_get_ctl_by_name(mixer, CVD_VERSION_MIXER_CTL); if (!ctl) { ALOGE("%s: Could not get ctl for mixer cmd - %s", __func__, CVD_VERSION_MIXER_CTL); - goto cleanup; + /* CVD is required for ACDB v2/3, so fail fully there. + * For ACDB v1, the CVD version code can be skipped. + */ + if (my_data->acdb_init_v2 || my_data->acdb_init_v3) + goto cleanup; + else + goto card_name; } mixer_ctl_update(ctl); @@ -114,6 +120,7 @@ int acdb_init(int snd_card_num) } } +card_name: /* Get Sound card name */ snd_card_name = strdup(mixer_get_name(mixer)); if (!snd_card_name) { -- cgit v1.2.3