Skip to contentSkip to conversation

ucm: adding the folder of card_long_name when finding verb conf file

PATCH Applied Hui Wang 2 participants 4 messages May 2, 2018

lore
Share & tools
lore

Hui Wang

author
#0 lore raw

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.

---
 src/ucm/parser.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
src/ucm/parser.c +8 -2
index 2d76152..219edb9 100644
@@ -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);
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/2 conf/ucm: increase the input volume for LineIn

Otherwise, the boost value is 0, and the sound captured from that LineIn jack is too weak for users.

---
 src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf | 1 +
 1 file changed, 1 insertion(+)
src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf +1 -0
index 5096789..ece780d 100644
@@ -99,6 +99,7 @@ SectionDevice."LineIn" {
 	EnableSequence [
 		cdev "hw:PCH"
 		cset "name='Input Source' Line"
+		cset "name='Line Boost Volume' 3"
 	]
 }
 
Signature · 1 line
2.7.4
#2 lore raw

Re: [alsa-lib][PATCH 2/2] conf/ucm: increase the input volume for LineIn

Applied. Thanks.

Dne 2.5.2018 v 08:08 Hui Wang napsal(a):

Quoted 21 lines

Otherwise, the boost value is 0, and the sound captured from that LineIn jack is too weak for users.

---
 src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf | 1 +
 1 file changed, 1 insertion(+)
src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf +1 -0
index 5096789..ece780d 100644
@@ -99,6 +99,7 @@ SectionDevice."LineIn" {
 	EnableSequence [
 		cdev "hw:PCH"
 		cset "name='Input Source' Line"
+		cset "name='Line Boost Volume' 3"
 	]
 }
 
Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
#3 lore raw
In reply to Hui Wang

Applied. Thanks.

Dne 2.5.2018 v 08:08 Hui Wang napsal(a):

Quoted 43 lines

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.

---
 src/ucm/parser.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
src/ucm/parser.c +8 -2
index 2d76152..219edb9 100644
@@ -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);
Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.