Re: [alsa-devel] Realtek ALC889: HDA Intel and kernel 3.0 gives choppy sound
At Tue, 26 Jul 2011 23:14:47 +0200, Colomban Wendling wrote:
Hi,
Following a bug report started in Debian BTS, in bug 635362 [1], I was asked to post here after testing upstream kernels and reproducing the bug.
So, here's the problem: my HDA audio chip [2] started to output very choppy sound with Linux kernel 3.0, while it worked perfectly well in previous versions -- latest two I used being 2.6.38 and 2.6.39 from Debian. Please note that simply booting on 2.6.39 works as usual, so it's IMHO definitely a driver regression.
Do you have 2.6.39 kernel messages? I see the warnings in your dmesg below in 3.0* kernels. Did you get it with the working kernel as well?
[ 0.000000] ------------[ cut here ]------------ [ 0.000000] WARNING: at drivers/pci/dmar.c:634 warn_invalid_dmar+0x77/0x85() [ 0.000000] Hardware name: MS-7636 [ 0.000000] Your BIOS is broken; DMAR reported at address fed93000 returns all ones! [ 0.000000] BIOS vendor: American Megatrends Inc.; Ver: V1.1; Product Version: 1.0 [ 0.000000] Modules linked in: [ 0.000000] Pid: 0, comm: swapper Not tainted 3.0.0 #4 [ 0.000000] Call Trace: [ 0.000000] [<ffffffff81043359>] ? warn_slowpath_common+0x78/0x8c [ 0.000000] [<ffffffff810433bb>] ? warn_slowpath_fmt_taint+0x3d/0x42 [ 0.000000] [<ffffffff81318a7e>] ? __pte+0x7/0x8 [ 0.000000] [<ffffffff816b2a2d>] ? __early_set_fixmap+0x89/0x8d [ 0.000000] [<ffffffff81318a7e>] ? __pte+0x7/0x8 [ 0.000000] [<ffffffff816b2a2d>] ? __early_set_fixmap+0x89/0x8d [ 0.000000] [<ffffffff81318a7e>] ? __pte+0x7/0x8 [ 0.000000] [<ffffffff811b72c9>] ? warn_invalid_dmar+0x77/0x85 [ 0.000000] [<ffffffff816b2e3a>] ? early_iounmap+0xc5/0x114 [ 0.000000] [<ffffffff816c6f13>] ? check_zero_address+0xb0/0xeb [ 0.000000] [<ffffffff81327736>] ? bad_to_user+0x620/0x620 [ 0.000000] [<ffffffff816c6f5f>] ? detect_intel_iommu+0x11/0xa6 [ 0.000000] [<ffffffff816a5b29>] ? pci_iommu_alloc+0x3f/0x67 [ 0.000000] [<ffffffff816b280c>] ? mem_init+0x14/0xe5 [ 0.000000] [<ffffffff8169f94e>] ? start_kernel+0x1d0/0x3c8 [ 0.000000] [<ffffffff8169f140>] ? early_idt_handlers+0x140/0x140 [ 0.000000] [<ffffffff8169f3c4>] ? x86_64_start_kernel+0x104/0x111 [ 0.000000] ---[ end trace a7919e7f17c0a725 ]---
Also, you can replace the files in sound/pci/hda/* from 2.6.39 kernel tree. If this fixes the problem, it's a sound driver bug. If not, it's anything else, e.g. the problem in more core side, e.g. IOMMU like above or the timer change, etc.
Takashi
Le 27/07/2011 07:37, Takashi Iwai a écrit :
Do you have 2.6.39 kernel messages? I see the warnings in your dmesg below in 3.0* kernels. Did you get it with the working kernel as well?
Yes, and this one appears in all logs (as said in Debian bug). See http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=15;filename=dmesg-2.6.39-2-... for the full dmesg of Debian's 2.6.39.
[...]
Also, you can replace the files in sound/pci/hda/* from 2.6.39 kernel tree. If this fixes the problem, it's a sound driver bug. If not, it's anything else, e.g. the problem in more core side, e.g. IOMMU like above or the timer change, etc.
Hey, that was a great idea! I reverse-patched sound/pci/hda of 3.0 with 2.6.39.3, and it fixes the problem! :) I attach the dmesg of that version (3.0 with 2.6.39.3's sound/pci/hda) if it is of any use for you.
Regards, Colomban
At Wed, 27 Jul 2011 13:14:41 +0200, Colomban Wendling wrote:
Also, you can replace the files in sound/pci/hda/* from 2.6.39 kernel tree. If this fixes the problem, it's a sound driver bug. If not, it's anything else, e.g. the problem in more core side, e.g. IOMMU like above or the timer change, etc.
Hey, that was a great idea! I reverse-patched sound/pci/hda of 3.0 with 2.6.39.3, and it fixes the problem! :)
OK, then try to replace only sound/pci/hda/hda_intel.c and keep the rest. What happens?
Takashi
Le 27/07/2011 13:20, Takashi Iwai a écrit :
At Wed, 27 Jul 2011 13:14:41 +0200, Colomban Wendling wrote:
Also, you can replace the files in sound/pci/hda/* from 2.6.39 kernel tree. If this fixes the problem, it's a sound driver bug. If not, it's anything else, e.g. the problem in more core side, e.g. IOMMU like above or the timer change, etc.
Hey, that was a great idea! I reverse-patched sound/pci/hda of 3.0 with 2.6.39.3, and it fixes the problem! :)
OK, then try to replace only sound/pci/hda/hda_intel.c and keep the rest. What happens?
Doesn't work, that sound is choppy again.
Regards, Colomban
At Wed, 27 Jul 2011 14:53:55 +0200, Colomban Wendling wrote:
Le 27/07/2011 13:20, Takashi Iwai a écrit :
At Wed, 27 Jul 2011 13:14:41 +0200, Colomban Wendling wrote:
Also, you can replace the files in sound/pci/hda/* from 2.6.39 kernel tree. If this fixes the problem, it's a sound driver bug. If not, it's anything else, e.g. the problem in more core side, e.g. IOMMU like above or the timer change, etc.
Hey, that was a great idea! I reverse-patched sound/pci/hda of 3.0 with 2.6.39.3, and it fixes the problem! :)
OK, then try to replace only sound/pci/hda/hda_intel.c and keep the rest. What happens?
Doesn't work, that sound is choppy again.
OK, then keep hda_intel.c as 3.0 and replace the rest. If this works, please give alsa-info.sh output (run with --no-upload option).
thanks,
Takashi
Le 27/07/2011 15:07, Takashi Iwai a écrit :
At Wed, 27 Jul 2011 14:53:55 +0200, Colomban Wendling wrote:
Le 27/07/2011 13:20, Takashi Iwai a écrit :
At Wed, 27 Jul 2011 13:14:41 +0200, Colomban Wendling wrote:
Also, you can replace the files in sound/pci/hda/* from 2.6.39 kernel tree. If this fixes the problem, it's a sound driver bug. If not, it's anything else, e.g. the problem in more core side, e.g. IOMMU like above or the timer change, etc.
Hey, that was a great idea! I reverse-patched sound/pci/hda of 3.0 with 2.6.39.3, and it fixes the problem! :)
OK, then try to replace only sound/pci/hda/hda_intel.c and keep the rest. What happens?
Doesn't work, that sound is choppy again.
OK, then keep hda_intel.c as 3.0 and replace the rest. If this works, please give alsa-info.sh output (run with --no-upload option).
It works! Attached is the alsa-info.sh output on this working version: 3.0 with 2.6.39.3 sound/pci/hda, but with 3.0's sound/pci/hda/hda_intel.c
Regards, Colomban
At Wed, 27 Jul 2011 16:09:50 +0200, Colomban Wendling wrote:
Le 27/07/2011 15:07, Takashi Iwai a écrit :
At Wed, 27 Jul 2011 14:53:55 +0200, Colomban Wendling wrote:
Le 27/07/2011 13:20, Takashi Iwai a écrit :
At Wed, 27 Jul 2011 13:14:41 +0200, Colomban Wendling wrote:
Also, you can replace the files in sound/pci/hda/* from 2.6.39 kernel tree. If this fixes the problem, it's a sound driver bug. If not, it's anything else, e.g. the problem in more core side, e.g. IOMMU like above or the timer change, etc.
Hey, that was a great idea! I reverse-patched sound/pci/hda of 3.0 with 2.6.39.3, and it fixes the problem! :)
OK, then try to replace only sound/pci/hda/hda_intel.c and keep the rest. What happens?
Doesn't work, that sound is choppy again.
OK, then keep hda_intel.c as 3.0 and replace the rest. If this works, please give alsa-info.sh output (run with --no-upload option).
It works! Attached is the alsa-info.sh output on this working version: 3.0 with 2.6.39.3 sound/pci/hda, but with 3.0's sound/pci/hda/hda_intel.c
Thanks. Could you try the patch below against 3.0 tree?
Takashi
--- From: Takashi Iwai tiwai@suse.de Subject: [PATCH] ALSA: hda - Fix duplicated DAC assignments for Realtek
Copying hp_pins and speaker_pins from line_out_pins may confuse the parser, and it can lead to duplicated initializations for the same pin with a wrong DAC assignment. The problem appears in 3.0 kernel code.
Signed-off-by: Takashi Iwai tiwai@suse.de --- sound/pci/hda/patch_realtek.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 0383dd8..e125c60 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -895,13 +895,15 @@ static void alc_init_auto_hp(struct hda_codec *codec) if (present == 3) spec->automute_hp_lo = 1; /* both HP and LO automute */
- if (!cfg->speaker_pins[0]) { + if (!cfg->speaker_pins[0] && + cfg->line_out_type == AUTO_PIN_SPEAKER_OUT) { memcpy(cfg->speaker_pins, cfg->line_out_pins, sizeof(cfg->speaker_pins)); cfg->speaker_outs = cfg->line_outs; }
- if (!cfg->hp_pins[0]) { + if (!cfg->hp_pins[0] && + cfg->line_out_type == AUTO_PIN_HP_OUT) { memcpy(cfg->hp_pins, cfg->line_out_pins, sizeof(cfg->hp_pins)); cfg->hp_outs = cfg->line_outs; @@ -920,6 +922,7 @@ static void alc_init_auto_hp(struct hda_codec *codec) spec->automute_mode = ALC_AUTOMUTE_PIN; } if (spec->automute && cfg->line_out_pins[0] && + cfg->speaker_pins[0] && cfg->line_out_pins[0] != cfg->hp_pins[0] && cfg->line_out_pins[0] != cfg->speaker_pins[0]) { for (i = 0; i < cfg->line_outs; i++) {
Le 27/07/2011 16:50, Takashi Iwai a écrit :
[...]
Thanks. Could you try the patch below against 3.0 tree?
[...]
It works just fine, now waiting forward Debian to patch their tree :) Thanks a lot for all the good work!
Regards, Colomban
At Thu, 28 Jul 2011 15:03:43 +0200, Colomban Wendling wrote:
Le 27/07/2011 16:50, Takashi Iwai a écrit :
[...]
Thanks. Could you try the patch below against 3.0 tree?
[...]
It works just fine, now waiting forward Debian to patch their tree :) Thanks a lot for all the good work!
Good to hear. The patch was tagged to stable-kernel, so it'll be likely included in 3.0.1 kernel.
thanks,
Takashi
participants (2)
-
Colomban Wendling
-
Takashi Iwai