[alsa-devel] [alsa-lib][PATCH 1/2] ucm: adding the folder of card_long_name when finding verb conf file
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@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);
Otherwise, the boost value is 0, and the sound captured from that LineIn jack is too weak for users.
Signed-off-by: Hui Wang hui.wang@canonical.com --- src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf index 5096789..ece780d 100644 --- a/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf +++ b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf @@ -99,6 +99,7 @@ SectionDevice."LineIn" { EnableSequence [ cdev "hw:PCH" cset "name='Input Source' Line" + cset "name='Line Boost Volume' 3" ] }
Applied. Thanks.
Dne 2.5.2018 v 08:08 Hui Wang napsal(a):
Otherwise, the boost value is 0, and the sound captured from that LineIn jack is too weak for users.
Signed-off-by: Hui Wang hui.wang@canonical.com
src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf index 5096789..ece780d 100644 --- a/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf +++ b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf @@ -99,6 +99,7 @@ SectionDevice."LineIn" { EnableSequence [ cdev "hw:PCH" cset "name='Input Source' Line"
]cset "name='Line Boost Volume' 3"
}
Applied. Thanks.
Dne 2.5.2018 v 08:08 Hui Wang napsal(a):
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@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);
else snprintf(filename, sizeof(filename), "%s/ucm/%s/%s",env, folder_name, file);
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);
participants (2)
-
Hui Wang
-
Jaroslav Kysela