[alsa-devel] [alsa-lib][PATCH 1/2] ucm: adding the folder of card_long_name when finding verb conf file
Hui Wang
hui.wang at canonical.com
Wed May 2 08:08:05 CEST 2018
The board configuration file and verb conf file are allowed to be
in the folder named of card_long_name, so when finding the verb conf
file, we need to check if it is in the folder of card_long_name or
card_name.
Signed-off-by: Hui Wang <hui.wang at canonical.com>
---
src/ucm/parser.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/ucm/parser.c b/src/ucm/parser.c
index 2d76152..219edb9 100644
--- a/src/ucm/parser.c
+++ b/src/ucm/parser.c
@@ -1056,6 +1056,7 @@ static int parse_verb_file(snd_use_case_mgr_t *uc_mgr,
char filename[MAX_FILE];
char *env = getenv(ALSA_CONFIG_UCM_VAR);
int err;
+ char *folder_name;
/* allocate verb */
verb = calloc(1, sizeof(struct use_case_verb));
@@ -1082,12 +1083,17 @@ static int parse_verb_file(snd_use_case_mgr_t *uc_mgr,
}
/* open Verb file for reading */
+ if (!strncmp(uc_mgr->conf_file_name, uc_mgr->card_long_name, MAX_CARD_LONG_NAME))
+ folder_name = uc_mgr->card_long_name;
+ else
+ folder_name = uc_mgr->card_name;
+
if (env)
snprintf(filename, sizeof(filename), "%s/%s/%s",
- env, uc_mgr->card_name, file);
+ env, folder_name, file);
else
snprintf(filename, sizeof(filename), "%s/ucm/%s/%s",
- snd_config_topdir(), uc_mgr->card_name, file);
+ snd_config_topdir(), folder_name, file);
filename[sizeof(filename)-1] = '\0';
err = uc_mgr_config_load(filename, &cfg);
--
2.7.4
More information about the Alsa-devel
mailing list