On Mon, Feb 2, 2009 at 4:21 AM, Andy Green <[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Somebody in the thread at some point said:
> | On Sun, Feb 1, 2009 at 11:51 AM, Andy Green <[email protected]>
> | (cut)
> |> r...@om-gta02:~# alsactl restore
> |> alsactl: set_control:989: warning: name mismatch (Playback Mixer Voice
> |> Capture Sw/Playback Mixer Voice Capture Switch) for control #68
> |> alsactl: set_control:991: warning: index mismatch (0/0) for control #68
> |> alsactl: set_control:993: failed to obtain info for control #68 (No
> |> buffer space available)
> |
> | I got sound / I'm using FSO unstable also. I haven't fixed whatever we
> | have to fix.
>
> Looks like Michael Trimarchi has jumped in there first thismorning, no
> worries.  I'll test it now.

Oh, great!

Do you think it's OK if we make the truncation verbose? I think it
might help avoid confusion later. I added some text you sent in
another email to the comment.
Make ALSA name truncation verbose

From: Nelson Castillo <[email protected]>

Make previous Michael's patch verbose about truncating
mixer names. Sample message:

 sound/soc/soc-dapm.c:349 mixer name 'Playback Mixer Voice Capture Switch' truncated
 to 32 bytes.

Signed-off-by: Nelson Castillo <[email protected]>
---

 sound/soc/soc-dapm.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)


diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 6df9aa5..b67e96f 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -333,12 +333,22 @@ static int dapm_new_mixer(struct snd_soc_codec *codec,
 			snprintf(path->long_name, name_len, "%s %s",
 				 w->name, w->kcontrols[i].name);
 
-			/* this is a ugly openmoko revert for name
-			   changing in alsa configuration file.  This is mergeable
-			   with the future linux version.  Remember to revert XXX
-			   We need it for compatability with previous state files.
+			/*
+			 * This is an ugly Openmoko revert for name
+			 * changes in alsa configuration. This is mergeable
+			 * with the future Linux version.
+			 * We force the truncation again for now because we
+			 * can't cope with mass breakage on alsa state files
+			 * that are spread all over the different distros.
+			 * FIXME: Remember to revert this change.
 			 */
-			name_len = (name_len > 32) ? 32 : name_len;
+
+			if (name_len > 32) {
+				printk(KERN_WARNING __FILE__ ":%d mixer name "
+				"'%s' truncated to 32 bytes.\n",
+				__LINE__, path->long_name);
+				name_len = 32;
+			}
 
 			path->long_name[name_len - 1] = '\0';
 

Reply via email to