Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932572AbdCUI7t (ORCPT ); Tue, 21 Mar 2017 04:59:49 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:48456 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932523AbdCUI7r (ORCPT ); Tue, 21 Mar 2017 04:59:47 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.56 with qID v2L8xQhk031275, This message is accepted by code: ctloc85258 From: Bard Liao To: Kai-Heng Feng CC: "broonie@kernel.org" , "lgirdwood@gmail.com" , Oder Chiou , "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v3] ASoC: rt286: fix headphone click/crack noise on Dell XPS 9343 I2S mode Thread-Topic: [PATCH v3] ASoC: rt286: fix headphone click/crack noise on Dell XPS 9343 I2S mode Thread-Index: AQHSoS5G+S9N2Bimuk2IJBa89nnBeaGekiiQ//+wO4CAALJ0oA== Date: Tue, 21 Mar 2017 08:59:27 +0000 Message-ID: References: <20170320035831.10762-1-kai.heng.feng@canonical.com> In-Reply-To: Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.85.154] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v2L8xw3O007739 Content-Length: 2739 Lines: 81 > -----Original Message----- > From: Kai-Heng Feng [mailto:kai.heng.feng@canonical.com] > Sent: Tuesday, March 21, 2017 1:39 PM > To: Bard Liao > Cc: broonie@kernel.org; lgirdwood@gmail.com; Oder Chiou; > alsa-devel@alsa-project.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH v3] ASoC: rt286: fix headphone click/crack noise on Dell > XPS 9343 I2S mode > >> > >> + switch (event) { > >> + case SND_SOC_DAPM_PRE_PMD: > >> + case SND_SOC_DAPM_POST_PMD: > >> + case SND_SOC_DAPM_POST_PMU: > >> + snd_soc_write(codec, RT286_SET_AMP_GAIN_HPO, > >> AMP_OUT_MUTE); > >> + break; > >> + case SND_SOC_DAPM_PRE_PMU: > >> + snd_soc_write(codec, RT286_SET_AMP_GAIN_HPO, > >> AMP_OUT_UNMUTE); > >> + break; > > > > Besides Mark's comment, I have question here. It seems you want to mute > > HPO before "HP Power" is powered up and after "HP Power" is powered > down. > > But "HPO L" and "HPO R" are autodisable. And "HP Power" is only connect to > > What I really want to do is something rt5670's rt5670_hp_event(), > maybe autodisable is not enough sometimes? It is different. rt5670_hp_event() is doing depop sequence for headphone. And there is no other mute/unmute controls on other dapm widgets. For me, what you do here is not different from "HPO L" and "HPO R" do. > > > "HPO L" and "HPO R". From my understanding, HPO will mute if "HP Power" > > is powered down. Any specific reason for muting HPO again before "HP > Power" > > is powered up? > > You are right. Either one of them should be sufficient. My point is that you seem to do things that driver is already done. But why and how it can reduce the click noise? > > > Will HPO be unmuted before "HP Power" is powered up on your system? > > Yes. > I am no audio expert here - but from what I read from HDA, there's > actually no AMP unmute counterpart to AMP mute. I didn't get it. How did you check if HPO is muted? > > > Or should the event be associated with "LDO1"? Which power will > > cause the click noise? > > I found that the effect is most noticeable if the mute callback is > associated with "LDO2" and "HP Power". > But again, this is just what I observed. Could you try only associated with "LDO2"? It makes sense that will reduce the noise if a jack is plugged in/out when HPO is already powered up. I have question about the code below + /* Fix headphone click noise */ + if (dmi_check_system(dmi_dell_dino)) + regmap_write(rt286->regmap, + RT286_MIC1_DET_CTRL, 0x0020); + What does this for? How did you get the value 0x0020? I just checked with Kailang, but he have no idea about that. > > > > > > > ------Please consider the environment before printing this e-mail.