diff mbox

[v2,1/3] ASoC: Intel: Fix cracking noise in rt5663 headphones for kabylake platform

Message ID 1501102065-11083-2-git-send-email-harshapriya.n@intel.com (mailing list archive)
State Accepted
Commit 349d63c33a34e39b205cf116d2406e096a029f8b
Headers show

Commit Message

Harsha Priya July 26, 2017, 8:47 p.m. UTC
This patch fixes the cracking noise in rt5663 headphones for kabylake platform
by calling the rt5663_sel_asrc_clk_src() for RT5663_AD_STEREO_FILTER as well.

The ASRC function is for asynchronous MCLK and LRCK. For RT5663 ASRC should be
enabled to  support special i2s clock format like Intel's 100fs. ASRC function
will track i2s clock and generate a corresponding system clock for codec.
Calling this function helps select the clock source for both
RT5663_AD_STEREO_FILTER and RT5663_DA_STEREO_FILTER filters which fixes the
crackling sound.

Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
---
 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Vinod Koul July 27, 2017, 2:40 a.m. UTC | #1
On Wed, Jul 26, 2017 at 01:47:43PM -0700, Harsha Priya wrote:
> This patch fixes the cracking noise in rt5663 headphones for kabylake platform
> by calling the rt5663_sel_asrc_clk_src() for RT5663_AD_STEREO_FILTER as well.

and it sets ASRC..?

> 
> The ASRC function is for asynchronous MCLK and LRCK. For RT5663 ASRC should be
> enabled to  support special i2s clock format like Intel's 100fs. ASRC function
	   ^^^^
double space

> will track i2s clock and generate a corresponding system clock for codec.
> Calling this function helps select the clock source for both
> RT5663_AD_STEREO_FILTER and RT5663_DA_STEREO_FILTER filters which fixes the
> crackling sound.
> 
> Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
> ---
>  sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
> index 3fe4a08..cfde894 100644
> --- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
> +++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
> @@ -319,7 +319,9 @@ static int kabylake_rt5663_hw_params(struct snd_pcm_substream *substream,
>  	int ret;
>  
>  	/* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */
> -	rt5663_sel_asrc_clk_src(codec_dai->codec, RT5663_DA_STEREO_FILTER, 1);
> +	rt5663_sel_asrc_clk_src(codec_dai->codec,
> +			RT5663_DA_STEREO_FILTER | RT5663_AD_STEREO_FILTER,
> +			RT5663_CLK_SEL_I2S1_ASRC);
>  
>  	ret = snd_soc_dai_set_sysclk(codec_dai,
>  			RT5663_SCLK_S_MCLK, 24576000, SND_SOC_CLOCK_IN);
> -- 
> 1.9.1
>
Harsha Priya July 28, 2017, 12:42 a.m. UTC | #2
> -----Original Message-----
> From: Koul, Vinod
> Sent: Wednesday, July 26, 2017 7:41 PM
> To: N, Harshapriya <harshapriya.n@intel.com>
> Cc: tiwai@suse.de; broonie@kernel.org; alsa-devel@alsa-project.org
> Subject: Re: [v2 1/3] ASoC: Intel: Fix cracking noise in rt5663 headphones for
> kabylake platform
> 
> On Wed, Jul 26, 2017 at 01:47:43PM -0700, Harsha Priya wrote:
> > This patch fixes the cracking noise in rt5663 headphones for kabylake
> > platform by calling the rt5663_sel_asrc_clk_src() for
> RT5663_AD_STEREO_FILTER as well.
> 
> and it sets ASRC..?
Yes. I changed the commit message in my next patch series.
> 
> >
> > The ASRC function is for asynchronous MCLK and LRCK. For RT5663 ASRC
> > should be enabled to  support special i2s clock format like Intel's
> > 100fs. ASRC function
> 	   ^^^^
> double space
> 
> > will track i2s clock and generate a corresponding system clock for codec.
> > Calling this function helps select the clock source for both
> > RT5663_AD_STEREO_FILTER and RT5663_DA_STEREO_FILTER filters which
> > fixes the crackling sound.
> >
> > Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
> > ---
> >  sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
> > b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
> > index 3fe4a08..cfde894 100644
> > --- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
> > +++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
> > @@ -319,7 +319,9 @@ static int kabylake_rt5663_hw_params(struct
> snd_pcm_substream *substream,
> >  	int ret;
> >
> >  	/* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */
> > -	rt5663_sel_asrc_clk_src(codec_dai->codec,
> RT5663_DA_STEREO_FILTER, 1);
> > +	rt5663_sel_asrc_clk_src(codec_dai->codec,
> > +			RT5663_DA_STEREO_FILTER |
> RT5663_AD_STEREO_FILTER,
> > +			RT5663_CLK_SEL_I2S1_ASRC);
> >
> >  	ret = snd_soc_dai_set_sysclk(codec_dai,
> >  			RT5663_SCLK_S_MCLK, 24576000,
> SND_SOC_CLOCK_IN);
> > --
> > 1.9.1
> >
> 
> --
> ~Vinod
diff mbox

Patch

diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
index 3fe4a08..cfde894 100644
--- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
+++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
@@ -319,7 +319,9 @@  static int kabylake_rt5663_hw_params(struct snd_pcm_substream *substream,
 	int ret;
 
 	/* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */
-	rt5663_sel_asrc_clk_src(codec_dai->codec, RT5663_DA_STEREO_FILTER, 1);
+	rt5663_sel_asrc_clk_src(codec_dai->codec,
+			RT5663_DA_STEREO_FILTER | RT5663_AD_STEREO_FILTER,
+			RT5663_CLK_SEL_I2S1_ASRC);
 
 	ret = snd_soc_dai_set_sysclk(codec_dai,
 			RT5663_SCLK_S_MCLK, 24576000, SND_SOC_CLOCK_IN);