From patchwork Tue Jun 3 09:08:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 4286091 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B7E4B9F1D6 for ; Tue, 3 Jun 2014 09:08:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 012C52028D for ; Tue, 3 Jun 2014 09:08:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 487FE20204 for ; Tue, 3 Jun 2014 09:08:48 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 84897261718; Tue, 3 Jun 2014 11:08:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 0776A26109E; Tue, 3 Jun 2014 11:08:36 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id F06652610A0; Tue, 3 Jun 2014 11:08:33 +0200 (CEST) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id C647F26109C for ; Tue, 3 Jun 2014 11:08:26 +0200 (CEST) Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 715BAAC34; Tue, 3 Jun 2014 09:08:26 +0000 (UTC) Date: Tue, 03 Jun 2014 11:08:26 +0200 Message-ID: From: Takashi Iwai To: Alex Fedora In-Reply-To: <538D7C3C.3040301@gmail.com> References: <538ACE22.9020306@gmail.com> <538C3BF4.2000706@gmail.com> <538C489C.1030508@gmail.com> <538D7C3C.3040301@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] PROBLEM: [Lenovo ThinkPad X61s] Speaker volume mutes itself in random intervals after upgrading from 3.11 to 3.15. X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP At Tue, 03 Jun 2014 00:41:48 -0700, Alex Fedora wrote: > > On 06/02/2014 05:05 AM, Takashi Iwai wrote: > > At Mon, 02 Jun 2014 02:49:16 -0700, > > Alex Fedora wrote: > >> On 06/02/2014 02:15 AM, Takashi Iwai wrote: > >>> At Mon, 02 Jun 2014 01:55:16 -0700, > >>> Alex Fedora wrote: > >>>> On 06/02/2014 01:03 AM, Takashi Iwai wrote: > >>>>> At Sat, 31 May 2014 23:54:26 -0700, > >>>>> Alex Fedora wrote: > >>>>>> Hi, > >>>>>> > >>>>>> Please see problem description below. I've captured alsa info output for > >>>>>> the latest kernel. Kernel just before the regression. And info from the > >>>>>> kernel with the offending commit. But I had to calculate diff from first > >>>>>> one to fit to 100K limit. If you want, I can send all 3 files as an > >>>>>> attachments. Also the latest version of the kernel was took from > >>>>>> http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/current/linux-image-3.15.0-999-generic_3.15.0-999.201405310205_amd64.deb > >>>>>> . > >>>>>> > >>>>>> Thank you, > >>>>>> Alex > >>>>>> > >>>>>> [1.] One line summary of the problem: [Lenovo ThinkPad X61s] Speaker > >>>>>> volume mutes itself in random intervals after upgrade to latest kernel > >>>>>> [2.] Full description of the problem/report: > >>>>>> > >>>>>> Speaker mutes itself in random intervals. Headphones are working fine at > >>>>>> that moment. I can see what volume of the Speaker drops to 0% and then > >>>>>> back to 100% using alsamixer. It seems like Internal Mic Boost also > >>>>>> jumps from 100% to 0% and back. It is regression from > >>>>>> 5ccc618fee67f0f0b2122dd4b32a02fd2b6a1569 (ALSA: hda - Remove static > >>>>>> quirks for AD1884/1984 & variants). I've tested previous commit > >>>>>> aa95d61b43e0fcb0b2ce68e5efa37174fd9e5cd3 (ALSA: hda - Remove static > >>>>>> quirks for AD1882) and audio works as expected. > >>>>>> > >>>>>> New kernel shows two controls "Headphone Playback Volume" and "Speaker > >>>>>> Playback Volume". But old one shows single control "PCM Playback > >>>>>> Volume". "Speaker Playback Volume" is the one which gets muted randomly. > >>>>> Are you using PulseAudio? If yes, does the problem happen without PA? > >>>>> This kind of random mute/unmute tends to be an issue of bogus > >>>>> headphone or mic jack detection. > >>>>> > >>>>> > >>>>> Takashi > >>>>> > >>>> Hi Takashi, > >>>> > >>>> Yes, I'm using PulseAudio. I've removed it and issue gone away. It > >>>> returned back after reinstalling it. This is still driver bug, right? > >>> Yes. So PA seems confused by some bogus information by the driver. > >>> > >>> Try to run "alsactl monitor 0", maybe better without PA at first. > >>> Do you see occasional events about the jack detection even if you > >>> don't plug/unplug? And, try it also with PA. > >>> > >>> > >>> Takashi > >>> > >> Yes, I can see a lot of events even if I don't plug/unplug anything. > >> Even more if I'm using PA. > >> > >> No pulseaudio: > >> > >> card 0, #22 (0,0,0,Mic Jack,0) VALUE > >> card 0, #23 (0,0,0,Headphone Jack,0) VALUE > >> card 0, #23 (0,0,0,Headphone Jack,0) VALUE > > Thanks. These are definitely bogus events. No wonder that PA gets > > screwed up. > > > > Could you try the patch below? > > > > > > Takashi > > > > --- > > diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c > > index 06275f8807a8..fa626648d746 100644 > > --- a/sound/pci/hda/patch_analog.c > > +++ b/sound/pci/hda/patch_analog.c > > @@ -191,7 +191,6 @@ static int ad198x_parse_auto_config(struct hda_codec *codec, bool indep_hp) > > int err; > > > > codec->spdif_status_reset = 1; > > - codec->no_trigger_sense = 1; > > codec->no_sticky_stream = 1; > > > > spec->gen.indep_hp = indep_hp; > > @@ -377,6 +376,8 @@ static int patch_ad1986a(struct hda_codec *codec) > > /* AD1986A has the inverted EAPD implementation */ > > codec->inv_eapd = 1; > > > > + codec->no_trigger_sense = 1; > > + > > spec->gen.mixer_nid = 0x07; > > spec->gen.beep_nid = 0x19; > > set_beep_amp(spec, 0x18, 0, HDA_OUTPUT); > > @@ -500,6 +501,8 @@ static int patch_ad1983(struct hda_codec *codec) > > return err; > > spec = codec->spec; > > > > + codec->no_trigger_sense = 1; > > + > > spec->gen.mixer_nid = 0x0e; > > spec->gen.beep_nid = 0x10; > > set_beep_amp(spec, 0x10, 0, HDA_OUTPUT); > > @@ -588,6 +591,8 @@ static int patch_ad1981(struct hda_codec *codec) > > return -ENOMEM; > > spec = codec->spec; > > > > + codec->no_trigger_sense = 1; > > + > > spec->gen.mixer_nid = 0x0e; > > spec->gen.beep_nid = 0x10; > > set_beep_amp(spec, 0x0d, 0, HDA_OUTPUT); > > @@ -913,6 +918,8 @@ static int patch_ad1988(struct hda_codec *codec) > > return err; > > spec = codec->spec; > > > > + codec->no_trigger_sense = 1; > > + > > spec->gen.mixer_nid = 0x20; > > spec->gen.mixer_merge_nid = 0x21; > > spec->gen.beep_nid = 0x10; > > @@ -1140,6 +1147,8 @@ static int patch_ad1882(struct hda_codec *codec) > > return err; > > spec = codec->spec; > > > > + codec->no_trigger_sense = 1; > > + > > spec->gen.mixer_nid = 0x20; > > spec->gen.mixer_merge_nid = 0x21; > > spec->gen.beep_nid = 0x10; > > . > > > > I've applied the patch and rebuild the kernel. But it didn't solve the > problem. I have applied the patch to kernel 3.13.11.2. Does it matter? > Should I try to download latest kernel and try to apply patch to it? It should be OK with 3.13.x as long as the patch is cleanly applied, but better to test with the very latest kernel, I'd say. > Here is the output of the monitor with PA enabled: At this moment, let's concentrate on non-PA case. Then there should be any events reported. Especially "XXX Jack" ones shouldn't be reported unless plugged/unplugged. Is the power-saving mode disabled? Check /sys/module/snd_hda_intel/parameters/power_save. Echo 0 to that file for disabling it. Maybe the surest way (and equivalent with the previous for your device) is a oneliner like below. If it doesn't work either (you still see the spurious jack events), the problem isn't about the trigger sense setup. Takashi diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 06275f8807a8..fcbda351e340 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -191,7 +191,7 @@ static int ad198x_parse_auto_config(struct hda_codec *codec, bool indep_hp) int err; codec->spdif_status_reset = 1; - codec->no_trigger_sense = 1; + //codec->no_trigger_sense = 1; codec->no_sticky_stream = 1; spec->gen.indep_hp = indep_hp;