Skip to contentSkip to conversation

- Patch breaks audio report

Fwd: Re: Linux 2.6.10-ac8 Alan Cox 2 participants 7 messages Jan 10, 2005 – Jan 13, 2005 Sound

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

-----Forwarded Message-----

Quoted 102 lines

From: Jules Villard <[email protected]>
To: Alan Cox <[email protected]>
Cc: [email protected]
Subject: Re: Linux 2.6.10-ac8
Date: Sun, 09 Jan 2005 18:16:41 +0100

Hello,

I'm experiencing some troubles with the patches you included in 2.6.10-ac5 about ALSA : the files open and play ok, but no sound is actually outputed...

I've found that the patch sound/pci/ac97/ac97_patch.c (hereby attached) is responsible for that (ie when I boot with the full patch minus this one, the sound is ok).

Nothing special is printed in dmesg, so I've only attached my lspci output and my .config (along with the patch).

Feel free to CC me if more details are needed, for I'm not on the lkml.

Regards,

Jules

______________________________________________________________________
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.10/sound/pci/ac97/ac97_patch.c linux-2.6.10/sound/pci/ac97/ac97_patch.c

sound/pci/ac97/ac97_patch.c +21 -2
@@ -1013,8 +1013,20 @@
  	return patch_build_controls(ac97, &snd_ac97_ad198x_spdif_source, 1);
 }
 
+static const snd_kcontrol_new_t snd_ac97_ad1981x_jack_sense[] = {
+	AC97_SINGLE("Headphone Jack Sense", AC97_AD_JACK_SPDIF, 11, 1, 0),
+	AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 12, 1, 0),
+};
+
+static int patch_ad1981a_specific(ac97_t * ac97)
+{
+	return patch_build_controls(ac97, snd_ac97_ad1981x_jack_sense,
+				    ARRAY_SIZE(snd_ac97_ad1981x_jack_sense));
+}
+
 static struct snd_ac97_build_ops patch_ad1981a_build_ops = {
-	.build_post_spdif = patch_ad198x_post_spdif
+	.build_post_spdif = patch_ad198x_post_spdif,
+	.build_specific = patch_ad1981a_specific
 };
 
 int patch_ad1981a(ac97_t *ac97)
@@ -1023,6 +1035,7 @@
 	ac97->build_ops = &patch_ad1981a_build_ops;
 	snd_ac97_update_bits(ac97, AC97_AD_MISC, AC97_AD198X_MSPLT, AC97_AD198X_MSPLT);
 	ac97->flags |= AC97_STEREO_MUTES;
+	snd_ac97_update_bits(ac97, AC97_AD_JACK_SPDIF, 1<<11, 1<<11); /* HP jack sense */
 	return 0;
 }
 
@@ -1031,7 +1044,12 @@
 
 static int patch_ad1981b_specific(ac97_t *ac97)
 {
-	return patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1);
+	int err;
+
+	if ((err = patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1)) < 0)
+		return err;
+	return patch_build_controls(ac97, snd_ac97_ad1981x_jack_sense,
+				    ARRAY_SIZE(snd_ac97_ad1981x_jack_sense));
 }
 
 static struct snd_ac97_build_ops patch_ad1981b_build_ops = {
@@ -1045,6 +1063,7 @@
 	ac97->build_ops = &patch_ad1981b_build_ops;
 	snd_ac97_update_bits(ac97, AC97_AD_MISC, AC97_AD198X_MSPLT, AC97_AD198X_MSPLT);
 	ac97->flags |= AC97_STEREO_MUTES;
+	snd_ac97_update_bits(ac97, AC97_AD_JACK_SPDIF, 1<<11, 1<<11); /* HP jack sense */
 	return 0;
 }
 

______________________________________________________________________
00:00.0 Host bridge: Intel Corp. 82855PM Processor to I/O Controller (rev 03) 00:01.0 PCI bridge: Intel Corp. 82855PM Processor to AGP Controller (rev 03)
00:1d.0 USB Controller: Intel Corp. 82801DB (ICH4) USB UHCI #1 (rev 01)
00:1d.1 USB Controller: Intel Corp. 82801DB (ICH4) USB UHCI #2 (rev 01)
00:1d.2 USB Controller: Intel Corp. 82801DB (ICH4) USB UHCI #3 (rev 01)
00:1d.7 USB Controller: Intel Corp. 82801DB (ICH4) USB2 EHCI Controller (rev 01) 00:1e.0 PCI bridge: Intel Corp. 82801BAM/CAM PCI Bridge (rev 81)
00:1f.0 ISA bridge: Intel Corp. 82801DBM LPC Interface Controller (rev 01)
00:1f.1 IDE interface: Intel Corp. 82801DBM (ICH4) Ultra ATA Storage Controller (rev 01) 00:1f.3 SMBus: Intel Corp. 82801DB/DBM (ICH4) SMBus Controller (rev 01)
00:1f.5 Multimedia audio controller: Intel Corp. 82801DB (ICH4) AC'97 Audio Controller (rev 01) 00:1f.6 Modem: Intel Corp. 82801DB (ICH4) AC'97 Modem Controller (rev 01)
01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M7 LW [Radeon Mobility 7500] 02:00.0 CardBus bridge: Texas Instruments PCI4520 PC card Cardbus Controller (rev 01) 02:00.1 CardBus bridge: Texas Instruments PCI4520 PC card Cardbus Controller (rev 01) 02:01.0 Ethernet controller: Intel Corp. 82540EP Gigabit Ethernet Controller (Mobile) (rev 03) 02:02.0 Network controller: Intel Corp.: Unknown device 4220 (rev 05)

#1 lore raw

At Mon, 10 Jan 2005 18:28:31 +0000,

Quoted 5 lines · Alan Cox
Quoted 5 lines

I'm experiencing some troubles with the patches you included in 2.6.10-ac5 about ALSA : the files open and play ok, but no sound is actually outputed...

Quoted 8 lines
Quoted 8 lines

I've found that the patch sound/pci/ac97/ac97_patch.c (hereby attached) is responsible for that (ie when I boot with the full patch minus this one, the sound is ok).

Nothing special is printed in dmesg, so I've only attached my lspci output and my .config (along with the patch).

Feel free to CC me if more details are needed, for I'm not on the lkml.

He just needs to turn off "Headphone Jack Sense" mixer switch. That resets the bit which was turned on by the patch.

The bit was set since most of machines with this codec are laptops and need this feature.

Takashi

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt

author
#2 lore raw
Quoted 5 lines · Takashi Iwai

He just needs to turn off "Headphone Jack Sense" mixer switch. That resets the bit which was turned on by the patch.

The bit was set since most of machines with this codec are laptops and need this feature.

Are you sure - I've been _deluged_ by complaints about audio breakage from this change ?

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt

#3 lore raw

At Thu, 13 Jan 2005 17:02:34 +0000,

Quoted 11 lines · Alan Cox
Quoted 5 lines · Takashi Iwai

He just needs to turn off "Headphone Jack Sense" mixer switch. That resets the bit which was turned on by the patch.

The bit was set since most of machines with this codec are laptops and need this feature.

Are you sure - I've been _deluged_ by complaints about audio breakage from this change ?

Hmm, I didn't know this hits so many people. At least, didn't get complains on ALSA bugtracks.

The patch adds basically two controls to turn on/off bits 9 and 11 of a JACK_SPDIF register on AD1981A/B. The only influenceable change is that the bit 11 is turned on as default. Turning off via the control must restore the same register state as previous version.

Maybe, it'd be safer not to touch this bit except for certain machines? The additional patch is attached below.

Takashi

================================================================

Summary: [ALSA] Don't touch the HP sense bit as default

Disable the toggle of HP sense bit at the initialization since this looks hitting many people.

sound/pci/ac97/ac97_patch.c +4 -0
@@ -1113,7 +1113,9 @@
 	ac97->build_ops = &patch_ad1981a_build_ops;
 	snd_ac97_update_bits(ac97, AC97_AD_MISC, AC97_AD198X_MSPLT, AC97_AD198X_MSPLT);
 	ac97->flags |= AC97_STEREO_MUTES;
+#if 0
 	snd_ac97_update_bits(ac97, AC97_AD_JACK_SPDIF, 1<<11, 1<<11); /* HP jack sense */
+#endif
 	return 0;
 }
 
@@ -1144,7 +1146,9 @@
 	ac97->build_ops = &patch_ad1981b_build_ops;
 	snd_ac97_update_bits(ac97, AC97_AD_MISC, AC97_AD198X_MSPLT, AC97_AD198X_MSPLT);
 	ac97->flags |= AC97_STEREO_MUTES;
+#if 0
 	snd_ac97_update_bits(ac97, AC97_AD_JACK_SPDIF, 1<<11, 1<<11); /* HP jack sense */
+#endif
 	return 0;
 }
 

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt

author
#4 lore raw
Quoted 2 lines · Takashi Iwai

Hmm, I didn't know this hits so many people. At least, didn't get complains on ALSA bugtracks.

I got several (mostly from IBM thinkpad owners) and a similar pattern occurred in Red Hat bugzilla when it hit fedora testing (again mostly Thinkpad)

Alan

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt

#5 lore raw

At Thu, 13 Jan 2005 17:21:45 +0000,

Quoted 8 lines · Alan Cox
Quoted 2 lines · Takashi Iwai

Hmm, I didn't know this hits so many people. At least, didn't get complains on ALSA bugtracks.

I got several (mostly from IBM thinkpad owners) and a similar pattern occurred in Red Hat bugzilla when it hit fedora testing (again mostly Thinkpad)

OK, so it'd be nice to sort out which macines need the bit on and which need off. IIRC, HP laptops (nx9105, etc) need this bit.

Takashi

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt

#6 lore raw

At Thu, 13 Jan 2005 19:32:32 +0100,

Quoted 8 lines · I wrote:

At Thu, 13 Jan 2005 17:21:45 +0000,

Quoted 5 lines · Alan Cox
Quoted 2 lines · Takashi Iwai

Hmm, I didn't know this hits so many people. At least, didn't get complains on ALSA bugtracks.

Quoted 6 lines
Quoted 3 lines

I got several (mostly from IBM thinkpad owners) and a similar pattern occurred in Red Hat bugzilla when it hit fedora testing (again mostly Thinkpad)

OK, so it'd be nice to sort out which macines need the bit on and which need off. IIRC, HP laptops (nx9105, etc) need this bit.

Additional note: the codec on HP laptop is AD1981B.
Is the one on Thinkpads also AD1981B or AD1981A?
This can be found in /proc/asound/card0/codec97#0/ac97#0-0 file.

If the problematic codec is only AD1981A, we can keep bit on AD1981B only.

Takashi

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt