Skip to contentSkip to conversation

snd_hda_intel for F/S T4210

PATCH In review Thomas Richter 2 participants 3 messages Aug 29, 2007 – Aug 31, 2007 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 snd_hda_intel for F/S T4210

Hi folks,

the patch below, to be applied to sound/pci/hda/patch_sigmatel.c fixes the audio output on the Fujiutsu/Siemens lifebook T4210 (and probably on others). It is suitable for the kernel 2.6.23-rc4 (and probably others).

Without the patch, audio fails and the hda driver fails to load with

No available DAC for pin 0x0

However, the indicated pin has no connections in first place and thus should be ignored. With the patch applied audio output works fine.

Here's the patch:

/* snip */

patch_sigmatel.c 2007-08-29 17:21:25.000000000 +0200 renamed from patch_sigmatel_old.c 2007-08-29 17:17:51.000000000 +0200 +10 -0
@@ -1250,6 +1250,16 @@
                nid = cfg->line_out_pins[i];
                conn_len = snd_hda_get_connections(codec, nid, conn,
                                                   HDA_MAX_CONNECTIONS);
+               /* FIX THOR: For some hardware (notably the Fujiutsu/Siemens T4210
+               ** lifebook), we have nids with no pins whatsoever. Ignore
+               ** them.
+               */
+               if (conn_len == 0) {
+                 snd_printk(KERN_ERR "%s: Found zero connections for pin 0x%0x "
+                            "ignoring it.\n",__func__,nid);
+                 continue;
+               }
+
                for (j = 0; j < conn_len; j++) {
                        wcaps = snd_hda_param_read(codec, conn[j],
                                                   AC_PAR_AUDIO_WIDGET_CAP);

/* snip */

Greetings,
Thomas

#1 lore raw

At Wed, 29 Aug 2007 17:34:19 +0200,

Quoted 7 lines · Thomas Richter

Hi folks,

the patch below, to be applied to sound/pci/hda/patch_sigmatel.c fixes the audio output on the Fujiutsu/Siemens lifebook T4210 (and probably on others). It is suitable for the kernel 2.6.23-rc4 (and probably others).

Quoted 6 lines

Without the patch, audio fails and the hda driver fails to load with

No available DAC for pin 0x0

However, the indicated pin has no connections in first place and thus should be ignored. With the patch applied audio output works fine.

The problem is that nid = 0 is used. So, your patch just hides another bug.

Please check whether the bug still exists with git.kernel.org perex/alsa.git mm branch. If still there, build with CONFIG_SND_DEBUG and show the autoconfig output.

thanks,

Takashi

Quoted 33 lines

Here's the patch:

/* snip */

patch_sigmatel.c 2007-08-29 17:21:25.000000000 +0200 renamed from patch_sigmatel_old.c 2007-08-29 17:17:51.000000000 +0200 +10 -0
@@ -1250,6 +1250,16 @@
                nid = cfg->line_out_pins[i];
                conn_len = snd_hda_get_connections(codec, nid, conn,
                                                   HDA_MAX_CONNECTIONS);
+               /* FIX THOR: For some hardware (notably the Fujiutsu/Siemens T4210
+               ** lifebook), we have nids with no pins whatsoever. Ignore
+               ** them.
+               */
+               if (conn_len == 0) {
+                 snd_printk(KERN_ERR "%s: Found zero connections for pin 0x%0x "
+                            "ignoring it.\n",__func__,nid);
+                 continue;
+               }
+
                for (j = 0; j < conn_len; j++) {
                        wcaps = snd_hda_param_read(codec, conn[j],
                                                   AC_PAR_AUDIO_WIDGET_CAP);

/* snip */

Greetings,
Thomas
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw

At Thu, 30 Aug 2007 17:04:14 +0200,

Quoted 12 lines · I wrote:

At Wed, 29 Aug 2007 17:34:19 +0200,

Quoted 9 lines · Thomas Richter

Hi folks,

the patch below, to be applied to sound/pci/hda/patch_sigmatel.c fixes the audio output on the Fujiutsu/Siemens lifebook T4210 (and probably on others). It is suitable for the kernel 2.6.23-rc4 (and probably others).

Without the patch, audio fails and the hda driver fails to load with

Quoted 7 lines
Quoted 4 lines

No available DAC for pin 0x0

However, the indicated pin has no connections in first place and thus should be ignored. With the patch applied audio output works fine.

The problem is that nid = 0 is used. So, your patch just hides another bug.

Just looking at the code, the suspicious part is the automatic addition of shared I/O pins. Does the patch below fix?

Takashi

sound/pci/hda/patch_sigmatel.c +10 -5
diff -r e7c9355af3ff sound/pci/hda/patch_sigmatel.c
@@ -1479,7 +1479,8 @@ static int stac92xx_add_dyn_out_pins(str
 	case 3:
 		/* add line-in as side */
 		if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 3) {
-			cfg->line_out_pins[3] = cfg->input_pins[AUTO_PIN_LINE];
+			cfg->line_out_pins[cfg->line_outs] =
+				cfg->input_pins[AUTO_PIN_LINE];
 			spec->line_switch = 1;
 			cfg->line_outs++;
 		}
@@ -1487,12 +1488,14 @@ static int stac92xx_add_dyn_out_pins(str
 	case 2:
 		/* add line-in as clfe and mic as side */
 		if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 2) {
-			cfg->line_out_pins[2] = cfg->input_pins[AUTO_PIN_LINE];
+			cfg->line_out_pins[cfg->line_outs] =
+				cfg->input_pins[AUTO_PIN_LINE];
 			spec->line_switch = 1;
 			cfg->line_outs++;
 		}
 		if (cfg->input_pins[AUTO_PIN_MIC] && num_dacs > 3) {
-			cfg->line_out_pins[3] = cfg->input_pins[AUTO_PIN_MIC];
+			cfg->line_out_pins[cfg->line_outs] =
+				cfg->input_pins[AUTO_PIN_MIC];
 			spec->mic_switch = 1;
 			cfg->line_outs++;
 		}
@@ -1500,12 +1503,14 @@ static int stac92xx_add_dyn_out_pins(str
 	case 1:
 		/* add line-in as surr and mic as clfe */
 		if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 1) {
-			cfg->line_out_pins[1] = cfg->input_pins[AUTO_PIN_LINE];
+			cfg->line_out_pins[cfg->line_outs] =
+				cfg->input_pins[AUTO_PIN_LINE];
 			spec->line_switch = 1;
 			cfg->line_outs++;
 		}
 		if (cfg->input_pins[AUTO_PIN_MIC] && num_dacs > 2) {
-			cfg->line_out_pins[2] = cfg->input_pins[AUTO_PIN_MIC];
+			cfg->line_out_pins[cfg->line_outs] =
+				cfg->input_pins[AUTO_PIN_MIC];
 			spec->mic_switch = 1;
 			cfg->line_outs++;
 		}