Bug 42655 - [ALC892] Random pops, clicks and short pauses caused by git commit e9bfcbffb7b26065a2b467e29bb6c7ec83d17646
Summary: [ALC892] Random pops, clicks and short pauses caused by git commit e9bfcbffb7...
Status: RESOLVED WILL_NOT_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-25 17:26 UTC by Artem S. Tashkinov
Modified: 2012-04-04 14:53 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.0.5 and newer
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
alsa-info.txt (35.31 KB, text/plain)
2012-01-25 17:26 UTC, Artem S. Tashkinov
Details

Description Artem S. Tashkinov 2012-01-25 17:26:47 UTC
Created attachment 72191 [details]
alsa-info.txt

Since kernel 3.0.11 I have quite terrible sound artifacts - random pops, clicks and short pauses (~500ms - even video output stutters when I watch e.g. movies). Linux kernel 3.0.0 is *bug free*. So, some some of patches in kernel *3.0.11* broke the driver, the bug is, of course, present in kernels 3.1 and 3.2.

This problem is also mentioned here: https://bbs.archlinux.org/viewtopic.php?id=130948

 00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
        Subsystem: ASUSTeK Computer Inc. Device 8469
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 60
        Region 0: Memory at fb520000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [50] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
                Address: 00000000fee0200c  Data: 415a
        Capabilities: [70] Express (v1) Root Complex Integrated Endpoint, MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
                        ExtTag- RBE- FLReset+
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
                        MaxPayload 128 bytes, MaxReadReq 128 bytes
                DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
                LnkCap: Port #0, Speed unknown, Width x0, ASPM unknown, Latency L0 <64ns, L1 <1us
                        ClockPM- Surprise- LLActRep- BwNot-
                LnkCtl: ASPM Disabled; Disabled- Retrain- CommClk-
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed unknown, Width x0, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
        Capabilities: [100 v1] Virtual Channel
                Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1
                Arb:    Fixed- WRR32- WRR64- WRR128-
                Ctrl:   ArbSelect=Fixed
                Status: InProgress-
                VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
                        Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
                        Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=01
                        Status: NegoPending- InProgress-
                VC1:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
                        Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
                        Ctrl:   Enable+ ID=1 ArbSelect=Fixed TC/VC=22
                        Status: NegoPending- InProgress-
        Capabilities: [130 v1] Root Complex Link
                Desc:   PortNumber=0f ComponentID=00 EltType=Config
                Link0:  Desc:   TargetPort=00 TargetComponent=00 AssocRCRB- LinkType=MemMapped LinkValid+
                        Addr:   00000000fed1c000
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd-hda-intel


Here's the relevant section of my .config:

CONFIG_SOUND=y
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_HWDEP=m
CONFIG_SND_RAWMIDI=m
CONFIG_SND_JACK=y
CONFIG_SND_SEQUENCER=m
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=m
CONFIG_SND_PCM_OSS=m
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_HRTIMER=m
CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
CONFIG_SND_DYNAMIC_MINORS=y
CONFIG_SND_VMASTER=y
CONFIG_SND_DMA_SGBUF=y
CONFIG_SND_RAWMIDI_SEQ=m
CONFIG_SND_EMU10K1_SEQ=m
CONFIG_SND_AC97_CODEC=m
CONFIG_SND_DRIVERS=y
CONFIG_SND_AC97_POWER_SAVE=y
CONFIG_SND_AC97_POWER_SAVE_DEFAULT=300
CONFIG_SND_PCI=y
CONFIG_SND_EMU10K1=m
CONFIG_SND_HDA_INTEL=m
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_BEEP_MODE=1
CONFIG_SND_HDA_INPUT_JACK=y
CONFIG_SND_HDA_CODEC_REALTEK=y
CONFIG_SND_HDA_CODEC_HDMI=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_POWER_SAVE=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=300
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=m

My .config can be downloaded here: http://ompldr.org/vYzJteg/config

I have a four core Intel Core i5 2500 CPU with an external NVIDIA GPU. MSI are enabled:

$ grep -i msi /proc/interrupts

 40:          0          0          0          0   PCI-MSI-edge      PCIe PME
 41:          0          0          0          0   PCI-MSI-edge      PCIe PME
 42:          0          0          0          0   PCI-MSI-edge      PCIe PME
 43:          0          0          0          0   PCI-MSI-edge      PCIe PME
 44:          0          0          0          0   PCI-MSI-edge      PCIe PME
 45:          0          0          0          0   PCI-MSI-edge      PCIe PME
 46:          0          0          0          0   PCI-MSI-edge      PCIe PME
 47:      98749          0          0          0   PCI-MSI-edge      ahci
 48:          0          0          0          0   PCI-MSI-edge      ahci
 49:          1          0          0          0   PCI-MSI-edge      xhci_hcd
 50:          0          0          0          0   PCI-MSI-edge      xhci_hcd
 51:          0          0          0          0   PCI-MSI-edge      xhci_hcd
 52:          0          0          0          0   PCI-MSI-edge      xhci_hcd
 53:          0          0          0          0   PCI-MSI-edge      xhci_hcd
 54:    6247643          0          0          0   PCI-MSI-edge      eth0
 55:          1          0          0          0   PCI-MSI-edge      xhci_hcd
 56:          0          0          0          0   PCI-MSI-edge      xhci_hcd
 57:          0          0          0          0   PCI-MSI-edge      xhci_hcd
 58:          0          0          0          0   PCI-MSI-edge      xhci_hcd
 59:          0          0          0          0   PCI-MSI-edge      xhci_hcd
 60:        775    1274821          0          0   PCI-MSI-edge      snd_hda_intel
 61:      72875          0          0          0   PCI-MSI-edge      nvidia

!!PCI Soundcards installed in the system
!!--------------------------------------

00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
Comment 1 Takashi Iwai 2012-01-25 17:36:29 UTC
Could you bisect, or at least find out which 3.0.x kernel starts showing the problem?
Comment 2 Artem S. Tashkinov 2012-01-25 18:02:09 UTC
(In reply to comment #1)
> Could you bisect, or at least find out which 3.0.x kernel starts showing the
> problem?

I will, but I've got a question - what's the stable tree GIT url?
Comment 3 Takashi Iwai 2012-01-26 09:09:11 UTC
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

You can find a branch for each kernel version (e.g. linux-3.0.y).
Comment 4 Artem S. Tashkinov 2012-01-30 09:20:54 UTC
(In reply to comment #3)
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
> 
> You can find a branch for each kernel version (e.g. linux-3.0.y).

My findings so far.

$ git bisect log

git bisect start
# good: [02f8c6aee8df3cdc935e9bdd4f2d020306035dbe] Linux 3.0
git bisect good 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe
# bad: [7a576d2dcd5807a7310032b380442eeba8c1c293] Linux 3.0.11
git bisect bad 7a576d2dcd5807a7310032b380442eeba8c1c293
# bad: [9185560808a0dc0432b130ca9d9965cb7ce052a6] isci: fix event-get pointer increment
git bisect bad 9185560808a0dc0432b130ca9d9965cb7ce052a6
# good: [b3ff2fd377a0b593678af0082b6a2e4ecc3eec84] possible memory corruption on mount
git bisect good b3ff2fd377a0b593678af0082b6a2e4ecc3eec84
# good: [a0be78ef93e0656339bf14feddc0e8afb2a86894] fs/9p: Fid is not valid after a failed clunk.
git bisect good a0be78ef93e0656339bf14feddc0e8afb2a86894

Now quite randomly I hear quiet cracks so I'm not sure where to go from now, with the previous git session I didn't have them, but the original bug symptoms are worse then what I'm having right now.

I guess it'll be `git bisect good/bad`? But how can I limit it to ALSA - there are just too many commits pending in `bisect`? - it can take ages to try the remaining ones.
Comment 5 Takashi Iwai 2012-01-30 09:28:08 UTC
You can limit the commits by specifying the paths.  Start git-bisect with sound and include/sound paths.
    % git bisect start v3.0.11 v3.0 -- sound include/sound

See git-bsect man page for details.
Comment 6 Artem S. Tashkinov 2012-01-30 09:36:58 UTC
I considered that option, but there's one caveat I mentally bump into - what if some other changes in other kernel subsystems could cause these symptoms?
Comment 7 Takashi Iwai 2012-01-30 10:03:25 UTC
Then you'll lose ;)  It might not be the exact cause.  It can be a help to narrow down the area, though.

With bisect, usually there aren't so many differences whether you specify the paths or not.  Even without specifying paths, it'll up to 9 steps.  So, not too many commits.  The bisection in the stable tree is far much easier than the bisection during rc phase.
Comment 8 Artem S. Tashkinov 2012-02-01 22:14:51 UTC
Damn, I arrive at the wrong commit:

git bisect log
git bisect start
# good: [02f8c6aee8df3cdc935e9bdd4f2d020306035dbe] Linux 3.0
git bisect good 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe

# bad: [7a576d2dcd5807a7310032b380442eeba8c1c293] Linux 3.0.11
git bisect bad 7a576d2dcd5807a7310032b380442eeba8c1c293

# bad: [9185560808a0dc0432b130ca9d9965cb7ce052a6] isci: fix event-get pointer increment
git bisect bad 9185560808a0dc0432b130ca9d9965cb7ce052a6

# good: [b3ff2fd377a0b593678af0082b6a2e4ecc3eec84] possible memory corruption on mount
git bisect good b3ff2fd377a0b593678af0082b6a2e4ecc3eec84

# good: [a0be78ef93e0656339bf14feddc0e8afb2a86894] fs/9p: Fid is not valid after a failed clunk.
git bisect good a0be78ef93e0656339bf14feddc0e8afb2a86894

# bad: [b73077a5fce232f3e95099f3bd9c084ab320aa85] ixgbe: fix possible null buffer error
git bisect bad b73077a5fce232f3e95099f3bd9c084ab320aa85

# good: [7edcab441920647c6ffec304451e11bc18ff1b11] mfd: Fix value of WM8994_CONFIGURE_GPIO
git bisect good 7edcab441920647c6ffec304451e11bc18ff1b11

# good: [d5b1a08d0d0a73c716766275eb0c5648e143ca85] workqueue: lock cwq access in drain_workqueue
git bisect good d5b1a08d0d0a73c716766275eb0c5648e143ca85

# good: [c3c24ca5a0a6bf57b2685c159e5c9c01df76dddb] USB: xhci: Set change bit when warm reset change is set.
git bisect good c3c24ca5a0a6bf57b2685c159e5c9c01df76dddb

# bad: [562960c731b9ffba8cd200be8d38f5f793b23d74] Fix the conflict between rwpidforward and rw mount options
git bisect bad 562960c731b9ffba8cd200be8d38f5f793b23d74

from now on - everything is bad.

# bad: [e9bfcbffb7b26065a2b467e29bb6c7ec83d17646] ALSA: hda/realtek - Fix auto-mute with HP+LO configuration
git bisect bad e9bfcbffb7b26065a2b467e29bb6c7ec83d17646

# bad: [bdba777a08cfe193f8c4a5cbb8382549db932171] iwlagn: fix command queue timeout
git bisect bad bdba777a08cfe193f8c4a5cbb8382549db932171

which gives me:

git bisect bad
bdba777a08cfe193f8c4a5cbb8382549db932171 is the first bad commit
commit bdba777a08cfe193f8c4a5cbb8382549db932171
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Mon Sep 12 12:09:10 2011 -0700

    iwlagn: fix command queue timeout

At this point I don't know what to do :(

I bet you can check what commits are included in the last three "bads" by following the same git bisect procedure.
Comment 9 Takashi Iwai 2012-02-02 09:14:10 UTC
Are you using the headphone/line-out auto-mute feature?
The commit [e9bfcbffb: ALSA: hda/realtek - Fix auto-mute with HP+LO configuration] fixes the line-out auto-mute, but when the machine has a bad jack-detection mechanism in hardware, it can lead to the bogus auto-mute behavior.

Try to turn off "Auto-Mute Mode".
Comment 10 Artem S. Tashkinov 2012-02-03 10:51:42 UTC
(In reply to comment #9)
> Are you using the headphone/line-out auto-mute feature?
> The commit [e9bfcbffb: ALSA: hda/realtek - Fix auto-mute with HP+LO
> configuration] fixes the line-out auto-mute, but when the machine has a bad
> jack-detection mechanism in hardware, it can lead to the bogus auto-mute
> behavior.
> 
> Try to turn off "Auto-Mute Mode".

You were right, this option is enabled here (but I never enabled it manually so it looks like it's driver's defaults) but I have usual speakers connected to the green audio output of my motherboard so I'm kinda surprised that this bug affects me.

Besides those clicks, pops and pauses occur _during_ playback, so I cannot understand what the point of this (mis)feature is if it interferes with things it shouldn't affect in the first place.

This bug report can be safely closed, even though the corresponding feature (auto mute) wreaks havoc with audio playback on my sound card.

Now what about bug 42654?
Comment 11 Takashi Iwai 2012-02-03 12:55:48 UTC
The auto-mute feature is useful on most of machines (especially laptops) where the jack-detection unsolicited events are properly sent and handled.  But some machines have bad hardware implementations, unfortunately, resulting in the flickering outputs due to frequent bogus jack-detection events.

The bug 42654 can't be resolved unless you get Windows source code :)
You don't know whether the volume attenuation is done in software or not.
There might be some special vendor-specific verbs, but it's vendor's secret and never published.

The current Linux driver provides what the codec gives generically.  If it has to be more, blame the codec chip vendor not to provide the hardware attributes correctly.
Comment 12 Takashi Iwai 2012-02-13 11:11:24 UTC
FWIW, I fixed the upstream code (for 3.4 kernel) not to create this superfluous auto-mute switch for your device.
Comment 13 Artem S. Tashkinov 2012-02-13 12:01:28 UTC
(In reply to comment #12)
> FWIW, I fixed the upstream code (for 3.4 kernel) not to create this
> superfluous
> auto-mute switch for your device.

Thank you! Even though I've fixed this problem for myself by turning off the auto-mute switch, other people with similar configurations will be relieved when their audio playback gets automagically fixed. ))
Comment 14 Florian Mickler 2012-04-04 14:53:50 UTC
A patch referencing this bug report has been merged in Linux v3.4-rc1:

commit 1565cc358585be40608b46f18f7ac431a1aae2bc
Author: Takashi Iwai <tiwai@suse.de>
Date:   Mon Feb 13 12:03:25 2012 +0100

    ALSA: hda - Add another jack-detection suppression for ASUS ALC892

Note You need to log in before you can comment on or make changes to this bug.