Bug 214931

Summary: sound on VIA audio controller often repeating
Product: [openSUSE] openSUSE 10.2 Reporter: Berthold Gunreben <bg>
Component: SoundAssignee: Jean Delvare <jdelvare>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: al4321, jdelvare, tiwai
Version: Beta 1   
Target Milestone: ---   
Hardware: i686   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: hwinfo of this machine
boot.msg of the system
This patch breaks some VIA system
VIA IRQ quirk debugging patch
Fix VIA quirks breakage
Fix VIA quirks breakage (v2)
Fix VIA quirks breakage (v3)

Description Berthold Gunreben 2006-10-25 13:21:26 UTC
When I try to play sound files with Beta1, the sound often repeats, and progresses only very slowly. In the system messages, many messages appear like:

ALSA sound/pci/via82xx.c:810: invalid via82xx_cur_ptr (2), using last valid pointer

The initialization of the sound card gives the following message:
via82xx: Assuming DXS channels with 48k fixed sample rate.
         Please try dxs_support=5 option
         and report if it works on your machine.
         For more details, read ALSA-Configuration.txt.
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11
ACPI: PCI Interrupt 0000:00:11.5[C] -> Link [LNKC] -> GSI 11 (level, low) -> IRQ 11
PCI: Setting latency timer of device 0000:00:11.5 to 64

On IRQ 11, several other devices are also present:
 11:      81228          XT-PIC  acpi, uhci_hcd:usb1, uhci_hcd:usb2, uhci_hcd:usb3, eth0, VIA8233

Attaching hwinfo output.
Comment 1 Berthold Gunreben 2006-10-25 13:22:10 UTC
Created attachment 102582 [details]
hwinfo of this machine
Comment 2 Takashi Iwai 2006-10-25 13:41:31 UTC
This looks like a regression of VIA irq quirk
    http://bugzilla.kernel.org/show_bug.cgi?id=6419

Could you try the patch there?  Also, please attach the whole kernel boot log.

[Added Greg to Cc since he already committed it to 2.6.19-rc.]
Comment 3 Berthold Gunreben 2006-10-25 14:00:54 UTC
Created attachment 102588 [details]
boot.msg of the system

I don't want to build kernels right now ... this is nothing i regularly do, and would not tell anything about the problem in the end.
Comment 6 Takashi Iwai 2006-10-27 10:40:21 UTC
OK, then I reassign this bug to Greg.
Comment 7 Greg Kroah-Hartman 2007-01-08 18:43:12 UTC
I'm confused.  Takashi, which patch did you apply to the kernel?  I don't see a patch in that bugreport on bugzilla.kernel.org
Comment 8 Takashi Iwai 2007-01-16 11:38:38 UTC
The fixes are already in 2.6.20:

09d6029f43ebbe7307854abdae204c25d711ff94:
   PCI: VIA IRQ quirk behaviour change

1597cacbe39802d86656d1f2e6329895bd2ef531:
   PCI: Fix multiple problems with VIA hardware

So, I guess updating to the STABLE/FACTORY kernel based on 2.6.20 should fix these problems.  Berthold, could you try the latest STABLE kernel?
Comment 9 Berthold Gunreben 2007-01-16 15:09:45 UTC
I just tried 2.6.20-rc4-git6-2-default, and the behavior is broken again. I admit, that this should be different when looking at the comments above, but it is broken right now.
Comment 10 Greg Kroah-Hartman 2007-01-20 00:25:54 UTC
Takashi, reassigning back to you :)
Comment 11 Takashi Iwai 2007-01-23 17:29:08 UTC
I revert the relevent patch from 2.6.20 and built kernel packages.  Please try the one at mbuild/bari-tiwai-62 (for STABLE).  bari-tiwai-63 is kernel-source.rpm.

If this works, it's a regression by the patch...
Comment 12 Berthold Gunreben 2007-01-24 12:44:07 UTC
that one works flawlessly.
Comment 13 Takashi Iwai 2007-01-24 13:40:06 UTC
Ok, then it's a breakage by the patch:

1597cacbe39802d86656d1f2e6329895bd2ef531:
   PCI: Fix multiple problems with VIA hardware

I give you this bug back to you, Greg :)

(Added Jean to Cc since he appears in the patch, too.)
Comment 14 Takashi Iwai 2007-01-24 13:41:49 UTC
Created attachment 114657 [details]
This patch breaks some VIA system
Comment 15 Jean Delvare 2007-01-24 16:10:48 UTC
I'm a bit confused, what kernels were tested exactly, which one worked, which one failed?

Berthold, can you please provide the boot log from a working kernel on the same machine, for comparison?
Comment 16 Berthold Gunreben 2007-01-24 16:35:37 UTC
well, the kernel that is broken was from STABLE. I just took that directly from dist.

Takashi built a working kernel for me, which can be found at the internal mbuild directory. Unfortunately, the boot.log will not help you, because I just have a SLES machine where I installed that kernel, and normally, alsa is not configured on there. However, a rcalsa restart makes the sound system working.

The working kernel is 2.6.20-rc5-git1-2-default. Obviously, in addition to removing the via patch, there has been an update to rc5-git1 in this kerenl:

* Tue Jan 23 2007 - olh@suse.de
- update to 2.6.20-rc5-git1
  scsi, usb, powerpc, ocfs fixes

* Mon Jan 22 2007 - jblunck@suse.de
- rpm/kernel-binary.spec.in: fix "Requires:" and config-subst call.

When doing the rcalsa restart, dmesg tells me:

via82xx: Assuming DXS channels with 48k fixed sample rate.
         Please try dxs_support=5 option
         and report if it works on your machine.
         For more details, read ALSA-Configuration.txt.
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11
ACPI: PCI Interrupt 0000:00:11.5[C] -> Link [LNKC] -> GSI 11 (level, low) -> IRQ 11
PCI: VIA IRQ fixup for 0000:00:11.5, from 9 to 11
PCI: Setting latency timer of device 0000:00:11.5 to 64
ACPI: PCI interrupt for device 0000:00:11.5 disabled
pnp: Device 00:0e disabled.
via82xx: Assuming DXS channels with 48k fixed sample rate.
         Please try dxs_support=5 option
         and report if it works on your machine.
         For more details, read ALSA-Configuration.txt.
ACPI: PCI Interrupt 0000:00:11.5[C] -> Link [LNKC] -> GSI 11 (level, low) -> IRQ 11
PCI: Setting latency timer of device 0000:00:11.5 to 64

Comment 17 Jean Delvare 2007-01-24 18:06:14 UTC
The faulty patch is a mess, it should have been two or three separate patches. Shame on Andrew and Alan :( That being said, I can't see any obvious problem with it. All I can offer is to build a kernel with additional debugging messages, and see what shows in the logs when running it.
Comment 18 Jean Delvare 2007-01-24 19:07:57 UTC
Please set the Hardware field to the right value.
Comment 19 Jean Delvare 2007-01-24 19:43:26 UTC
Created attachment 114809 [details]
VIA IRQ quirk debugging patch
Comment 21 Berthold Gunreben 2007-01-29 09:10:14 UTC
With the latest kernel, I get the following messages. This kernel also does not play the sound correctly:

via82xx: Assuming DXS channels with 48k fixed sample rate.
         Please try dxs_support=5 option
         and report if it works on your machine.
         For more details, read ALSA-Configuration.txt.
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11
ACPI: PCI Interrupt 0000:00:11.5[C] -> Link [LNKC] -> GSI 11 (level, low) -> IRQ 11
PCI: Setting latency timer of device 0000:00:11.5 to 64
irq 9: nobody cared (try booting with the "irqpoll" option)
 [<c0148f5a>] __report_bad_irq+0x36/0x7d
 [<c0149146>] note_interrupt+0x1a5/0x1e3
 [<c01e9d72>] acpi_irq+0xb/0x14
 [<c01486a9>] handle_IRQ_event+0x1a/0x3f
 [<c0149a05>] handle_level_irq+0xa3/0xda
 [<c010638e>] do_IRQ+0x82/0x9c
 [<c0104d13>] common_interrupt+0x23/0x30
 [<c01258f4>] __do_softirq+0x54/0xba
 [<c012598c>] do_softirq+0x32/0x36
 [<c0106393>] do_IRQ+0x87/0x9c
 [<c0104d13>] common_interrupt+0x23/0x30
 [<c0102c2e>] default_idle+0x0/0x3e
 [<c0102c5a>] default_idle+0x2c/0x3e
 [<c010238f>] cpu_idle+0x9d/0xb6
 [<c036870e>] start_kernel+0x35e/0x366
 [<c03681ae>] unknown_bootoption+0x0/0x202
 =======================
handlers:
[<c01e9d67>] (acpi_irq+0x0/0x14)
Disabling IRQ #9
Comment 22 Jean Delvare 2007-01-29 09:27:43 UTC
No "VIA quirk" messages in the logs at all?
Comment 23 Berthold Gunreben 2007-01-29 09:35:50 UTC
I just rechecked. The previous output was all I got in dmesg, but also in syslog there are no further messages.
Comment 24 Jean Delvare 2007-01-29 09:54:44 UTC
I logged into the machine to take a look. Earlier in the logs I see the following:
VIA quirk 0000:00:01.0: No supported south bridge found
At this point the VIA quirk is disabled and will not be attempted anymore.

Good news is that I didn't expect that, so at least I have something new to investigate ;)
Comment 25 Jean Delvare 2007-01-29 10:33:48 UTC
Nick, it looks like you've been bitten by this on too?
http://lkml.org/lkml/2007/1/23/254

Your patch looks totally weird to me and probably only works by accident. I suspect that the root cause of the problem is that pci_find_present() does not work yet at the time the PCI quirks are run.
Comment 26 Jean Delvare 2007-01-29 14:48:29 UTC
Created attachment 115902 [details]
Fix VIA quirks breakage

Fix VIA quirks that were recently broken by Alan Cox in the upstream kernel (commit 1597cacbe39802d86656d1f2e6329895bd2ef531).

My understanding is that pci_find_present() doesn't work yet at the time the quirks are run. So I used a two-step quirk as is done for some other quirks already. First we detect the VIA south bridges and set the right low and high device limits, then we are ready to actually run the quirks on the affected devices.
Comment 27 Jean Delvare 2007-01-29 14:50:11 UTC
I will submit this patch upstream for comments now.
Comment 28 Jean Delvare 2007-01-30 10:10:53 UTC
Created attachment 116115 [details]
Fix VIA quirks breakage (v2)

My first patch didn't fix Nick's system, because the quirkable device range wasn't correct for his old VT82C686 south bridge. This second version of the patch works; I've submitted it upstream as well.
Comment 29 Jean Delvare 2007-01-30 12:27:42 UTC
Created attachment 116184 [details]
Fix VIA quirks breakage (v3)

One more iteration, after Sergey Vlasov exlained to me that the VT82C686 device number is different from one system to the next.
Comment 30 Jean Delvare 2007-02-02 08:46:40 UTC
Fixed upstream in 2.6.20-rc7, and fixed in our HEAD tree as a result.
Comment 31 Takashi Iwai 2007-02-16 11:54:24 UTC
*** Bug 216398 has been marked as a duplicate of this bug. ***