All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: rt5682: fix the random recording noise of headset
@ 2020-03-17  7:33 shumingf
  2020-03-18  2:31 ` Keyon Jie
  2020-03-18 18:51 ` Applied "ASoC: rt5682: fix the random recording noise of headset" to the asoc tree Mark Brown
  0 siblings, 2 replies; 7+ messages in thread
From: shumingf @ 2020-03-17  7:33 UTC (permalink / raw)
  To: broonie, lgirdwood
  Cc: oder_chiou, jack.yu, alsa-devel, lars, Shuming Fan, albertchen,
	derek.fang, sathya.prakash.m.r, flove

From: Shuming Fan <shumingf@realtek.com>

The cycle time of FIFO clock should increase 2 times to avoid
the random recording noise issue.
This setting could apply to all known situations in i2s mode.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
---
 sound/soc/codecs/rt5682.c | 2 ++
 sound/soc/codecs/rt5682.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index 7ca02a5e52e9..023bc672274b 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -3643,6 +3643,8 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
 			RT5682_CP_CLK_HP_MASK, RT5682_CP_CLK_HP_300KHZ);
 	regmap_update_bits(rt5682->regmap, RT5682_HP_CHARGE_PUMP_1,
 			RT5682_PM_HP_MASK, RT5682_PM_HP_HV);
+	regmap_update_bits(rt5682->regmap, RT5682_DMIC_CTRL_1,
+			RT5682_FIFO_CLK_DIV_MASK, RT5682_FIFO_CLK_DIV_2);
 
 	INIT_DELAYED_WORK(&rt5682->jack_detect_work,
 				rt5682_jack_detect_handler);
diff --git a/sound/soc/codecs/rt5682.h b/sound/soc/codecs/rt5682.h
index 43de6e802309..0baeece84ec4 100644
--- a/sound/soc/codecs/rt5682.h
+++ b/sound/soc/codecs/rt5682.h
@@ -657,6 +657,8 @@
 #define RT5682_DMIC_1_EN_SFT			15
 #define RT5682_DMIC_1_DIS			(0x0 << 15)
 #define RT5682_DMIC_1_EN			(0x1 << 15)
+#define RT5682_FIFO_CLK_DIV_MASK		(0x7 << 12)
+#define RT5682_FIFO_CLK_DIV_2			(0x1 << 12)
 #define RT5682_DMIC_1_DP_MASK			(0x3 << 4)
 #define RT5682_DMIC_1_DP_SFT			4
 #define RT5682_DMIC_1_DP_GPIO2			(0x0 << 4)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] ASoC: rt5682: fix the random recording noise of headset
  2020-03-17  7:33 [PATCH 1/2] ASoC: rt5682: fix the random recording noise of headset shumingf
@ 2020-03-18  2:31 ` Keyon Jie
  2020-03-18  3:06   ` Albert Chen
  2020-03-18 18:51 ` Applied "ASoC: rt5682: fix the random recording noise of headset" to the asoc tree Mark Brown
  1 sibling, 1 reply; 7+ messages in thread
From: Keyon Jie @ 2020-03-18  2:31 UTC (permalink / raw)
  To: shumingf, broonie, lgirdwood
  Cc: oder_chiou, jack.yu, alsa-devel, lars, albertchen, derek.fang,
	sathya.prakash.m.r, flove



On 3/17/20 3:33 PM, shumingf@realtek.com wrote:
> From: Shuming Fan <shumingf@realtek.com>
> 
> The cycle time of FIFO clock should increase 2 times to avoid
> the random recording noise issue.
> This setting could apply to all known situations in i2s mode.

Thanks for fixing this Shuming.

Just try to understand what has happened.

Can you help share more details about it, e.g.
1. the recording noise happened on headset mic or dmic?
2. will this change impact the microphone sampling clock, or the BCLK 
that of the I2S bclk pin?
3. without this change, why the clk is wrong, some example?

Thanks,
~Keyon

> 
> Signed-off-by: Shuming Fan <shumingf@realtek.com>
> ---
>   sound/soc/codecs/rt5682.c | 2 ++
>   sound/soc/codecs/rt5682.h | 2 ++
>   2 files changed, 4 insertions(+)
> 
> diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
> index 7ca02a5e52e9..023bc672274b 100644
> --- a/sound/soc/codecs/rt5682.c
> +++ b/sound/soc/codecs/rt5682.c
> @@ -3643,6 +3643,8 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
>   			RT5682_CP_CLK_HP_MASK, RT5682_CP_CLK_HP_300KHZ);
>   	regmap_update_bits(rt5682->regmap, RT5682_HP_CHARGE_PUMP_1,
>   			RT5682_PM_HP_MASK, RT5682_PM_HP_HV);
> +	regmap_update_bits(rt5682->regmap, RT5682_DMIC_CTRL_1,
> +			RT5682_FIFO_CLK_DIV_MASK, RT5682_FIFO_CLK_DIV_2);
>   
>   	INIT_DELAYED_WORK(&rt5682->jack_detect_work,
>   				rt5682_jack_detect_handler);
> diff --git a/sound/soc/codecs/rt5682.h b/sound/soc/codecs/rt5682.h
> index 43de6e802309..0baeece84ec4 100644
> --- a/sound/soc/codecs/rt5682.h
> +++ b/sound/soc/codecs/rt5682.h
> @@ -657,6 +657,8 @@
>   #define RT5682_DMIC_1_EN_SFT			15
>   #define RT5682_DMIC_1_DIS			(0x0 << 15)
>   #define RT5682_DMIC_1_EN			(0x1 << 15)
> +#define RT5682_FIFO_CLK_DIV_MASK		(0x7 << 12)
> +#define RT5682_FIFO_CLK_DIV_2			(0x1 << 12)
>   #define RT5682_DMIC_1_DP_MASK			(0x3 << 4)
>   #define RT5682_DMIC_1_DP_SFT			4
>   #define RT5682_DMIC_1_DP_GPIO2			(0x0 << 4)
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH 1/2] ASoC: rt5682: fix the random recording noise of headset
  2020-03-18  2:31 ` Keyon Jie
@ 2020-03-18  3:06   ` Albert Chen
  2020-03-18  3:31     ` Keyon Jie
  0 siblings, 1 reply; 7+ messages in thread
From: Albert Chen @ 2020-03-18  3:06 UTC (permalink / raw)
  To: Keyon Jie, Shuming [范書銘], broonie, lgirdwood
  Cc: Oder Chiou, Jack Yu, alsa-devel, lars,
	Derek [方德義],
	sathya.prakash.m.r, Flove(HsinFu)

Dear Sir,

Inline.

Thanks,
Albert

-----Original Message-----
From: Keyon Jie <yang.jie@linux.intel.com> 
Sent: Wednesday, March 18, 2020 10:32 AM
To: Shuming [范書銘] <shumingf@realtek.com>; broonie@kernel.org; lgirdwood@gmail.com
Cc: Oder Chiou <oder_chiou@realtek.com>; Jack Yu <jack.yu@realtek.com>; alsa-devel@alsa-project.org; lars@metafoo.de; Albert Chen <albertchen@realtek.com>; Derek [方德義] <derek.fang@realtek.com>; sathya.prakash.m.r@intel.com; Flove(HsinFu) <flove@realtek.com>
Subject: Re: [PATCH 1/2] ASoC: rt5682: fix the random recording noise of headset

On 3/17/20 3:33 PM, shumingf@realtek.com wrote:
> From: Shuming Fan <shumingf@realtek.com>
> 
> The cycle time of FIFO clock should increase 2 times to avoid the 
> random recording noise issue.
> This setting could apply to all known situations in i2s mode.

Thanks for fixing this Shuming.

Just try to understand what has happened.

Can you help share more details about it, e.g.
1. the recording noise happened on headset mic or dmic?
<Albert> Headset Mic
2. will this change impact the microphone sampling clock, or the BCLK that of the I2S bclk pin?
<Albert> No.
3. without this change, why the clk is wrong, some example?
<Albert> Only adjust FIFO buffer setting. 

Thanks,
~Keyon

> 
> Signed-off-by: Shuming Fan <shumingf@realtek.com>
> ---
>   sound/soc/codecs/rt5682.c | 2 ++
>   sound/soc/codecs/rt5682.h | 2 ++
>   2 files changed, 4 insertions(+)
> 
> diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c 
> index 7ca02a5e52e9..023bc672274b 100644
> --- a/sound/soc/codecs/rt5682.c
> +++ b/sound/soc/codecs/rt5682.c
> @@ -3643,6 +3643,8 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
>   			RT5682_CP_CLK_HP_MASK, RT5682_CP_CLK_HP_300KHZ);
>   	regmap_update_bits(rt5682->regmap, RT5682_HP_CHARGE_PUMP_1,
>   			RT5682_PM_HP_MASK, RT5682_PM_HP_HV);
> +	regmap_update_bits(rt5682->regmap, RT5682_DMIC_CTRL_1,
> +			RT5682_FIFO_CLK_DIV_MASK, RT5682_FIFO_CLK_DIV_2);
>   
>   	INIT_DELAYED_WORK(&rt5682->jack_detect_work,
>   				rt5682_jack_detect_handler);
> diff --git a/sound/soc/codecs/rt5682.h b/sound/soc/codecs/rt5682.h 
> index 43de6e802309..0baeece84ec4 100644
> --- a/sound/soc/codecs/rt5682.h
> +++ b/sound/soc/codecs/rt5682.h
> @@ -657,6 +657,8 @@
>   #define RT5682_DMIC_1_EN_SFT			15
>   #define RT5682_DMIC_1_DIS			(0x0 << 15)
>   #define RT5682_DMIC_1_EN			(0x1 << 15)
> +#define RT5682_FIFO_CLK_DIV_MASK		(0x7 << 12)
> +#define RT5682_FIFO_CLK_DIV_2			(0x1 << 12)
>   #define RT5682_DMIC_1_DP_MASK			(0x3 << 4)
>   #define RT5682_DMIC_1_DP_SFT			4
>   #define RT5682_DMIC_1_DP_GPIO2			(0x0 << 4)
> 

------Please consider the environment before printing this e-mail.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] ASoC: rt5682: fix the random recording noise of headset
  2020-03-18  3:06   ` Albert Chen
@ 2020-03-18  3:31     ` Keyon Jie
  2020-03-18  6:07       ` Albert Chen
  0 siblings, 1 reply; 7+ messages in thread
From: Keyon Jie @ 2020-03-18  3:31 UTC (permalink / raw)
  To: Albert Chen, Shuming [范書銘], broonie, lgirdwood
  Cc: Oder Chiou, Jack Yu, alsa-devel, lars,
	Derek [方德義],
	sathya.prakash.m.r, Flove(HsinFu)


On 3/18/20 11:06 AM, Albert Chen wrote:
> Dear Sir,
> 
> Inline.
> 
> Thanks,
> Albert
> 
> -----Original Message-----
> From: Keyon Jie <yang.jie@linux.intel.com>
> Sent: Wednesday, March 18, 2020 10:32 AM
> To: Shuming [范書銘] <shumingf@realtek.com>; broonie@kernel.org; lgirdwood@gmail.com
> Cc: Oder Chiou <oder_chiou@realtek.com>; Jack Yu <jack.yu@realtek.com>; alsa-devel@alsa-project.org; lars@metafoo.de; Albert Chen <albertchen@realtek.com>; Derek [方德義] <derek.fang@realtek.com>; sathya.prakash.m.r@intel.com; Flove(HsinFu) <flove@realtek.com>
> Subject: Re: [PATCH 1/2] ASoC: rt5682: fix the random recording noise of headset
> 
> On 3/17/20 3:33 PM, shumingf@realtek.com wrote:
>> From: Shuming Fan <shumingf@realtek.com>
>>
>> The cycle time of FIFO clock should increase 2 times to avoid the
>> random recording noise issue.
>> This setting could apply to all known situations in i2s mode.
> 
> Thanks for fixing this Shuming.
> 
> Just try to understand what has happened.
> 
> Can you help share more details about it, e.g.
> 1. the recording noise happened on headset mic or dmic?
> <Albert> Headset Mic
> 2. will this change impact the microphone sampling clock, or the BCLK that of the I2S bclk pin?
> <Albert> No.
> 3. without this change, why the clk is wrong, some example?
> <Albert> Only adjust FIFO buffer setting.

Where is the FIFO buffer you mentioned located? Is it included in the 
path "headset mic ADC--(loopback)-->ADC headphone"?

The issue was reported to Intel also, that's why I am querying this here.

 From previous feedback, Shuming shared that the loopback path mentioned 
above don't have this random noise issue.

Thanks,
~Keyon

> 
> Thanks,
> ~Keyon
> 
>>
>> Signed-off-by: Shuming Fan <shumingf@realtek.com>
>> ---
>>    sound/soc/codecs/rt5682.c | 2 ++
>>    sound/soc/codecs/rt5682.h | 2 ++
>>    2 files changed, 4 insertions(+)
>>
>> diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
>> index 7ca02a5e52e9..023bc672274b 100644
>> --- a/sound/soc/codecs/rt5682.c
>> +++ b/sound/soc/codecs/rt5682.c
>> @@ -3643,6 +3643,8 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
>>    			RT5682_CP_CLK_HP_MASK, RT5682_CP_CLK_HP_300KHZ);
>>    	regmap_update_bits(rt5682->regmap, RT5682_HP_CHARGE_PUMP_1,
>>    			RT5682_PM_HP_MASK, RT5682_PM_HP_HV);
>> +	regmap_update_bits(rt5682->regmap, RT5682_DMIC_CTRL_1,
>> +			RT5682_FIFO_CLK_DIV_MASK, RT5682_FIFO_CLK_DIV_2);
>>    
>>    	INIT_DELAYED_WORK(&rt5682->jack_detect_work,
>>    				rt5682_jack_detect_handler);
>> diff --git a/sound/soc/codecs/rt5682.h b/sound/soc/codecs/rt5682.h
>> index 43de6e802309..0baeece84ec4 100644
>> --- a/sound/soc/codecs/rt5682.h
>> +++ b/sound/soc/codecs/rt5682.h
>> @@ -657,6 +657,8 @@
>>    #define RT5682_DMIC_1_EN_SFT			15
>>    #define RT5682_DMIC_1_DIS			(0x0 << 15)
>>    #define RT5682_DMIC_1_EN			(0x1 << 15)
>> +#define RT5682_FIFO_CLK_DIV_MASK		(0x7 << 12)
>> +#define RT5682_FIFO_CLK_DIV_2			(0x1 << 12)
>>    #define RT5682_DMIC_1_DP_MASK			(0x3 << 4)
>>    #define RT5682_DMIC_1_DP_SFT			4
>>    #define RT5682_DMIC_1_DP_GPIO2			(0x0 << 4)
>>
> 
> ------Please consider the environment before printing this e-mail.
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH 1/2] ASoC: rt5682: fix the random recording noise of headset
  2020-03-18  3:31     ` Keyon Jie
@ 2020-03-18  6:07       ` Albert Chen
  2020-03-18  9:36         ` Keyon Jie
  0 siblings, 1 reply; 7+ messages in thread
From: Albert Chen @ 2020-03-18  6:07 UTC (permalink / raw)
  To: Keyon Jie, Shuming [范書銘], broonie, lgirdwood
  Cc: Oder Chiou, Jack Yu, alsa-devel, lars,
	Derek [方德義],
	sathya.prakash.m.r, Flove(HsinFu)



-----Original Message-----
From: Keyon Jie <yang.jie@linux.intel.com> 
Sent: Wednesday, March 18, 2020 11:31 AM
To: Albert Chen <albertchen@realtek.com>; Shuming [范書銘] <shumingf@realtek.com>; broonie@kernel.org; lgirdwood@gmail.com
Cc: Oder Chiou <oder_chiou@realtek.com>; Jack Yu <jack.yu@realtek.com>; alsa-devel@alsa-project.org; lars@metafoo.de; Derek [方德義] <derek.fang@realtek.com>; sathya.prakash.m.r@intel.com; Flove(HsinFu) <flove@realtek.com>
Subject: Re: [PATCH 1/2] ASoC: rt5682: fix the random recording noise of headset


On 3/18/20 11:06 AM, Albert Chen wrote:
> Dear Sir,
> 
> Inline.
> 
> Thanks,
> Albert
> 
> -----Original Message-----
> From: Keyon Jie <yang.jie@linux.intel.com>
> Sent: Wednesday, March 18, 2020 10:32 AM
> To: Shuming [范書銘] <shumingf@realtek.com>; broonie@kernel.org; 
> lgirdwood@gmail.com
> Cc: Oder Chiou <oder_chiou@realtek.com>; Jack Yu 
> <jack.yu@realtek.com>; alsa-devel@alsa-project.org; lars@metafoo.de; 
> Albert Chen <albertchen@realtek.com>; Derek [方德義] 
> <derek.fang@realtek.com>; sathya.prakash.m.r@intel.com; Flove(HsinFu) 
> <flove@realtek.com>
> Subject: Re: [PATCH 1/2] ASoC: rt5682: fix the random recording noise 
> of headset
> 
> On 3/17/20 3:33 PM, shumingf@realtek.com wrote:
>> From: Shuming Fan <shumingf@realtek.com>
>>
>> The cycle time of FIFO clock should increase 2 times to avoid the 
>> random recording noise issue.
>> This setting could apply to all known situations in i2s mode.
> 
> Thanks for fixing this Shuming.
> 
> Just try to understand what has happened.
> 
> Can you help share more details about it, e.g.
> 1. the recording noise happened on headset mic or dmic?
> <Albert> Headset Mic
> 2. will this change impact the microphone sampling clock, or the BCLK that of the I2S bclk pin?
> <Albert> No.
> 3. without this change, why the clk is wrong, some example?
> <Albert> Only adjust FIFO buffer setting.

Where is the FIFO buffer you mentioned located? Is it included in the path "headset mic ADC--(loopback)-->ADC headphone"?
<Albert> I2S interface.

The issue was reported to Intel also, that's why I am querying this here.

From previous feedback, Shuming shared that the loopback path mentioned above don't have this random noise issue.

<Albert>These are have total two recording random noise issues, one is the PCB trace design and another is Codec setting, Our previous reported is PCB trace cause noise. 

Thanks,
~Keyon

> 
> Thanks,
> ~Keyon
> 
>>
>> Signed-off-by: Shuming Fan <shumingf@realtek.com>
>> ---
>>    sound/soc/codecs/rt5682.c | 2 ++
>>    sound/soc/codecs/rt5682.h | 2 ++
>>    2 files changed, 4 insertions(+)
>>
>> diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c 
>> index 7ca02a5e52e9..023bc672274b 100644
>> --- a/sound/soc/codecs/rt5682.c
>> +++ b/sound/soc/codecs/rt5682.c
>> @@ -3643,6 +3643,8 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
>>    			RT5682_CP_CLK_HP_MASK, RT5682_CP_CLK_HP_300KHZ);
>>    	regmap_update_bits(rt5682->regmap, RT5682_HP_CHARGE_PUMP_1,
>>    			RT5682_PM_HP_MASK, RT5682_PM_HP_HV);
>> +	regmap_update_bits(rt5682->regmap, RT5682_DMIC_CTRL_1,
>> +			RT5682_FIFO_CLK_DIV_MASK, RT5682_FIFO_CLK_DIV_2);
>>    
>>    	INIT_DELAYED_WORK(&rt5682->jack_detect_work,
>>    				rt5682_jack_detect_handler);
>> diff --git a/sound/soc/codecs/rt5682.h b/sound/soc/codecs/rt5682.h 
>> index 43de6e802309..0baeece84ec4 100644
>> --- a/sound/soc/codecs/rt5682.h
>> +++ b/sound/soc/codecs/rt5682.h
>> @@ -657,6 +657,8 @@
>>    #define RT5682_DMIC_1_EN_SFT			15
>>    #define RT5682_DMIC_1_DIS			(0x0 << 15)
>>    #define RT5682_DMIC_1_EN			(0x1 << 15)
>> +#define RT5682_FIFO_CLK_DIV_MASK		(0x7 << 12)
>> +#define RT5682_FIFO_CLK_DIV_2			(0x1 << 12)
>>    #define RT5682_DMIC_1_DP_MASK			(0x3 << 4)
>>    #define RT5682_DMIC_1_DP_SFT			4
>>    #define RT5682_DMIC_1_DP_GPIO2			(0x0 << 4)
>>
> 
> ------Please consider the environment before printing this e-mail.
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] ASoC: rt5682: fix the random recording noise of headset
  2020-03-18  6:07       ` Albert Chen
@ 2020-03-18  9:36         ` Keyon Jie
  0 siblings, 0 replies; 7+ messages in thread
From: Keyon Jie @ 2020-03-18  9:36 UTC (permalink / raw)
  To: Albert Chen, Shuming [范書銘], broonie, lgirdwood
  Cc: Oder Chiou, Jack Yu, alsa-devel, lars,
	Derek [方德義],
	sathya.prakash.m.r, Flove(HsinFu)



On 3/18/20 2:07 PM, Albert Chen wrote:
> 
> 
> -----Original Message-----
> From: Keyon Jie <yang.jie@linux.intel.com>
> Sent: Wednesday, March 18, 2020 11:31 AM
> To: Albert Chen <albertchen@realtek.com>; Shuming [范書銘] <shumingf@realtek.com>; broonie@kernel.org; lgirdwood@gmail.com
> Cc: Oder Chiou <oder_chiou@realtek.com>; Jack Yu <jack.yu@realtek.com>; alsa-devel@alsa-project.org; lars@metafoo.de; Derek [方德義] <derek.fang@realtek.com>; sathya.prakash.m.r@intel.com; Flove(HsinFu) <flove@realtek.com>
> Subject: Re: [PATCH 1/2] ASoC: rt5682: fix the random recording noise of headset
> 
> 
> On 3/18/20 11:06 AM, Albert Chen wrote:
>> Dear Sir,
>>
>> Inline.
>>
>> Thanks,
>> Albert
>>
>> -----Original Message-----
>> From: Keyon Jie <yang.jie@linux.intel.com>
>> Sent: Wednesday, March 18, 2020 10:32 AM
>> To: Shuming [范書銘] <shumingf@realtek.com>; broonie@kernel.org;
>> lgirdwood@gmail.com
>> Cc: Oder Chiou <oder_chiou@realtek.com>; Jack Yu
>> <jack.yu@realtek.com>; alsa-devel@alsa-project.org; lars@metafoo.de;
>> Albert Chen <albertchen@realtek.com>; Derek [方德義]
>> <derek.fang@realtek.com>; sathya.prakash.m.r@intel.com; Flove(HsinFu)
>> <flove@realtek.com>
>> Subject: Re: [PATCH 1/2] ASoC: rt5682: fix the random recording noise
>> of headset
>>
>> On 3/17/20 3:33 PM, shumingf@realtek.com wrote:
>>> From: Shuming Fan <shumingf@realtek.com>
>>>
>>> The cycle time of FIFO clock should increase 2 times to avoid the
>>> random recording noise issue.
>>> This setting could apply to all known situations in i2s mode.
>>
>> Thanks for fixing this Shuming.
>>
>> Just try to understand what has happened.
>>
>> Can you help share more details about it, e.g.
>> 1. the recording noise happened on headset mic or dmic?
>> <Albert> Headset Mic
>> 2. will this change impact the microphone sampling clock, or the BCLK that of the I2S bclk pin?
>> <Albert> No.
>> 3. without this change, why the clk is wrong, some example?
>> <Albert> Only adjust FIFO buffer setting.
> 
> Where is the FIFO buffer you mentioned located? Is it included in the path "headset mic ADC--(loopback)-->ADC headphone"?
> <Albert> I2S interface.
> 
> The issue was reported to Intel also, that's why I am querying this here.
> 
>  From previous feedback, Shuming shared that the loopback path mentioned above don't have this random noise issue.
> 
> <Albert>These are have total two recording random noise issues, one is the PCB trace design and another is Codec setting, Our previous reported is PCB trace cause noise.

Okay, thanks for explaining. Looks good to me now. :)

Thanks,
~Keyon

> 
> Thanks,
> ~Keyon
> 
>>
>> Thanks,
>> ~Keyon
>>
>>>
>>> Signed-off-by: Shuming Fan <shumingf@realtek.com>
>>> ---
>>>     sound/soc/codecs/rt5682.c | 2 ++
>>>     sound/soc/codecs/rt5682.h | 2 ++
>>>     2 files changed, 4 insertions(+)
>>>
>>> diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
>>> index 7ca02a5e52e9..023bc672274b 100644
>>> --- a/sound/soc/codecs/rt5682.c
>>> +++ b/sound/soc/codecs/rt5682.c
>>> @@ -3643,6 +3643,8 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
>>>     			RT5682_CP_CLK_HP_MASK, RT5682_CP_CLK_HP_300KHZ);
>>>     	regmap_update_bits(rt5682->regmap, RT5682_HP_CHARGE_PUMP_1,
>>>     			RT5682_PM_HP_MASK, RT5682_PM_HP_HV);
>>> +	regmap_update_bits(rt5682->regmap, RT5682_DMIC_CTRL_1,
>>> +			RT5682_FIFO_CLK_DIV_MASK, RT5682_FIFO_CLK_DIV_2);
>>>     
>>>     	INIT_DELAYED_WORK(&rt5682->jack_detect_work,
>>>     				rt5682_jack_detect_handler);
>>> diff --git a/sound/soc/codecs/rt5682.h b/sound/soc/codecs/rt5682.h
>>> index 43de6e802309..0baeece84ec4 100644
>>> --- a/sound/soc/codecs/rt5682.h
>>> +++ b/sound/soc/codecs/rt5682.h
>>> @@ -657,6 +657,8 @@
>>>     #define RT5682_DMIC_1_EN_SFT			15
>>>     #define RT5682_DMIC_1_DIS			(0x0 << 15)
>>>     #define RT5682_DMIC_1_EN			(0x1 << 15)
>>> +#define RT5682_FIFO_CLK_DIV_MASK		(0x7 << 12)
>>> +#define RT5682_FIFO_CLK_DIV_2			(0x1 << 12)
>>>     #define RT5682_DMIC_1_DP_MASK			(0x3 << 4)
>>>     #define RT5682_DMIC_1_DP_SFT			4
>>>     #define RT5682_DMIC_1_DP_GPIO2			(0x0 << 4)
>>>
>>
>> ------Please consider the environment before printing this e-mail.
>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Applied "ASoC: rt5682: fix the random recording noise of headset" to the asoc tree
  2020-03-17  7:33 [PATCH 1/2] ASoC: rt5682: fix the random recording noise of headset shumingf
  2020-03-18  2:31 ` Keyon Jie
@ 2020-03-18 18:51 ` Mark Brown
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Brown @ 2020-03-18 18:51 UTC (permalink / raw)
  To: Shuming Fan
  Cc: oder_chiou, jack.yu, alsa-devel, lars, lgirdwood, albertchen,
	Mark Brown, derek.fang, sathya.prakash.m.r, flove

The patch

   ASoC: rt5682: fix the random recording noise of headset

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 557270e8dc79f66a1db8907eb3079ade60241fe7 Mon Sep 17 00:00:00 2001
From: Shuming Fan <shumingf@realtek.com>
Date: Tue, 17 Mar 2020 15:33:08 +0800
Subject: [PATCH] ASoC: rt5682: fix the random recording noise of headset

The cycle time of FIFO clock should increase 2 times to avoid
the random recording noise issue.
This setting could apply to all known situations in i2s mode.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20200317073308.11572-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt5682.c | 2 ++
 sound/soc/codecs/rt5682.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index 063dd338539d..3e0b5c43ece8 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -2651,6 +2651,8 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
 			RT5682_CP_CLK_HP_MASK, RT5682_CP_CLK_HP_300KHZ);
 	regmap_update_bits(rt5682->regmap, RT5682_HP_CHARGE_PUMP_1,
 			RT5682_PM_HP_MASK, RT5682_PM_HP_HV);
+	regmap_update_bits(rt5682->regmap, RT5682_DMIC_CTRL_1,
+			RT5682_FIFO_CLK_DIV_MASK, RT5682_FIFO_CLK_DIV_2);
 
 	INIT_DELAYED_WORK(&rt5682->jack_detect_work,
 				rt5682_jack_detect_handler);
diff --git a/sound/soc/codecs/rt5682.h b/sound/soc/codecs/rt5682.h
index 18faaa2a49a0..fc99e7484283 100644
--- a/sound/soc/codecs/rt5682.h
+++ b/sound/soc/codecs/rt5682.h
@@ -651,6 +651,8 @@
 #define RT5682_DMIC_1_EN_SFT			15
 #define RT5682_DMIC_1_DIS			(0x0 << 15)
 #define RT5682_DMIC_1_EN			(0x1 << 15)
+#define RT5682_FIFO_CLK_DIV_MASK		(0x7 << 12)
+#define RT5682_FIFO_CLK_DIV_2			(0x1 << 12)
 #define RT5682_DMIC_1_DP_MASK			(0x3 << 4)
 #define RT5682_DMIC_1_DP_SFT			4
 #define RT5682_DMIC_1_DP_GPIO2			(0x0 << 4)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-03-18 18:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-17  7:33 [PATCH 1/2] ASoC: rt5682: fix the random recording noise of headset shumingf
2020-03-18  2:31 ` Keyon Jie
2020-03-18  3:06   ` Albert Chen
2020-03-18  3:31     ` Keyon Jie
2020-03-18  6:07       ` Albert Chen
2020-03-18  9:36         ` Keyon Jie
2020-03-18 18:51 ` Applied "ASoC: rt5682: fix the random recording noise of headset" to the asoc tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.