Re: Problem setting mixer switch with amixer/alsactl.

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

 



Mark Brown <broonie@xxxxxxxxxxxxx> writes:

> On Thu, Oct 23, 2008 at 02:56:42PM +0100, Oliver Ford wrote:
>
>> The offending mixer switch has the truncated text name 'Speaker Mixer 
>> PCM Playback Swit' under amixer but it obviously is supposed to be 
>> 'Switch' on  the end. I don't know if that might somehow cause problems?
>
> This is normal - shouldn't be an issue except in UI terms, ALSA limits
> the length of names.

Mark, I don't think that's true.
I had that problem several monthes ago (remember my patch about alsa controls
length ?).

Do you remember that patch, which went into asoc-v2 ? :

--
Robert


>From a1b99c3bcef6bf4773e9b43335fe1f91424674c6 Mon Sep 17 00:00:00 2001
From: Robert Jarzmik <rjarzmik@xxxxxxx>
Date: Sun, 16 Mar 2008 22:48:17 +0100
Subject: [PATCH] Correct dapm controls length.

Dapm control names should follow alsa standard, which
defines controls name's length to 44 and not 32.

Signed-off-by: Robert Jarzmik <rjarzmik@xxxxxxx>
Signed-off-by: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
---
 sound/soc/soc-dapm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 4b03e3f..a61024c 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_card *soc_card,
 	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,7 @@ static int dapm_new_mixer(struct snd_soc_card *soc_card,
 				continue;
 
 			/* add dapm control with long name */
-			snprintf(name, 32, "%s %s", w->name, w->kcontrols[i].name);
+			snprintf(name, 44, "%s %s", w->name, w->kcontrols[i].name);
 			path->long_name = kstrdup (name, GFP_KERNEL);
 			if (path->long_name == NULL)
 				return -ENOMEM;
-- 
1.5.6.5
_______________________________________________
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