[PATCH] dapm_new_mixer and 32 bytes limitation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dapm mixer names are truncated to 32 bytes, while alsa control names are 44
bytes wide. 

Subsequent usage of functions like snd_ctl_find_id fail because of the
mismatch. Unless there's a limitation I don't understand, the following patch
fixes the limit back to 44 bytes.

--
Robert

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index ea20138..f22a1bb 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -281,7 +281,7 @@ static int dapm_new_mixer(struct snd_soc_codec *codec,
 	struct snd_soc_dapm_widget *w)
 {
 	int i, ret = 0;
-	char name[32];
+	char name[44];
 	struct snd_soc_dapm_path *path;
 
 	/* add kcontrol */
@@ -295,7 +295,8 @@ static int dapm_new_mixer(struct snd_soc_codec *codec,
 				continue;
 
 			/* add dapm control with long name */
-			snprintf(name, 32, "%s %s", w->name, w->kcontrols[i].name);
+			snprintf(name, 43, "%s %s", w->name, w->kcontrols[i].name);
+			name[43] = 0;
 			path->long_name = kstrdup (name, GFP_KERNEL);
 			if (path->long_name == NULL)
 				return -ENOMEM;
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux