mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 0/2] Fix couple of bugs reported by Canonical
@ 2021-04-24 14:32 Vitaly Rodionov
  2021-04-24 14:32 ` [PATCH v1 1/2] ALSA: hda/cirrus: Set Initial DMIC volume for Bullseye to 16% Vitaly Rodionov
  2021-04-24 14:32 ` [PATCH v1 2/2] ALSA: hda/cirrus: Use CS8409 Equalizer to fix abnormal sounds on Bullseye Vitaly Rodionov
  0 siblings, 2 replies; 5+ messages in thread
From: Vitaly Rodionov @ 2021-04-24 14:32 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai; +Cc: alsa-devel, patches, linux-kernel

CirrusLogic: Cracking noises appears in built-in speaker when output 
volume is set >80%
BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1923557i

CirrusLogic: The default input volume is "0%" 
BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1924997

Stefan Binding (2):
  ALSA: hda/cirrus: Set Initial DMIC volume for Bullseye to 16%
  ALSA: hda/cirrus: Use CS8409 Equalizer to fix abnormal sounds on
    Bullseye

 sound/pci/hda/patch_cirrus.c | 37 ++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

-- 
2.25.1


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

* [PATCH v1 1/2] ALSA: hda/cirrus: Set Initial DMIC volume for Bullseye to 16%
  2021-04-24 14:32 [PATCH v1 0/2] Fix couple of bugs reported by Canonical Vitaly Rodionov
@ 2021-04-24 14:32 ` Vitaly Rodionov
  2021-04-25  8:19   ` Takashi Iwai
  2021-04-24 14:32 ` [PATCH v1 2/2] ALSA: hda/cirrus: Use CS8409 Equalizer to fix abnormal sounds on Bullseye Vitaly Rodionov
  1 sibling, 1 reply; 5+ messages in thread
From: Vitaly Rodionov @ 2021-04-24 14:32 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, patches, linux-kernel, Stefan Binding, You-Sheng Yang

From: Stefan Binding <sbinding@opensource.cirrus.com>

Tested on DELL Inspiron-3505, DELL Inspiron-3501, DELL Inspiron-3500

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1923557
Reported-and-tested-by: You-Sheng Yang <vicamo.yang@canonical.com>
---
 sound/pci/hda/patch_cirrus.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index 5d57096b3a95..d6cf93b7483c 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -2172,6 +2172,10 @@ static void cs8409_cs42l42_fixups(struct hda_codec *codec,
 			(get_wcaps(codec, CS8409_CS42L42_AMIC_PIN_NID) | AC_WCAP_UNSOL_CAP));
 		break;
 	case HDA_FIXUP_ACT_PROBE:
+
+		if (codec->fixup_id == CS8409_BULLSEYE)
+			snd_hda_codec_amp_init_stereo(codec, CS8409_CS42L42_DMIC_ADC_PIN_NID,
+					HDA_INPUT, 0, 0xff, 0x19);
 		snd_hda_gen_add_kctl(&spec->gen,
 			NULL, &cs8409_cs42l42_hp_volume_mixer);
 		snd_hda_gen_add_kctl(&spec->gen,
-- 
2.25.1


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

* [PATCH v1 2/2] ALSA: hda/cirrus: Use CS8409 Equalizer to fix abnormal sounds on Bullseye
  2021-04-24 14:32 [PATCH v1 0/2] Fix couple of bugs reported by Canonical Vitaly Rodionov
  2021-04-24 14:32 ` [PATCH v1 1/2] ALSA: hda/cirrus: Set Initial DMIC volume for Bullseye to 16% Vitaly Rodionov
@ 2021-04-24 14:32 ` Vitaly Rodionov
  2021-04-25  8:21   ` Takashi Iwai
  1 sibling, 1 reply; 5+ messages in thread
From: Vitaly Rodionov @ 2021-04-24 14:32 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, patches, linux-kernel, Stefan Binding, You-Sheng Yang

From: Stefan Binding <sbinding@opensource.cirrus.com>

Tested on DELL Inspiron-3505, DELL Inspiron-3501, DELL Inspiron-3500

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1924997
Reported-and-tested-by: You-Sheng Yang <vicamo.yang@canonical.com>
---
 sound/pci/hda/patch_cirrus.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index d6cf93b7483c..82c5f0869684 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -1481,6 +1481,34 @@ static const struct cs8409_cir_param cs8409_cs42l42_hw_cfg[] = {
 	{} /* Terminator */
 };
 
+static const struct cs8409_cir_param cs8409_cs42l42_bullseye_atn[] = {
+	{ 0x47, 0x65, 0x4000 }, /* EQ_SEL=1, EQ1/2_EN=0 */
+	{ 0x47, 0x64, 0x4000 }, /* +EQ_ACC */
+	{ 0x47, 0x65, 0x4010 }, /* +EQ2_EN */
+	{ 0x47, 0x63, 0x0647 }, /* EQ_DATA_HI=0x0647 */
+	{ 0x47, 0x64, 0xc0c7 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=0, EQ_DATA_LO=0x67 */
+	{ 0x47, 0x63, 0x0647 }, /* EQ_DATA_HI=0x0647 */
+	{ 0x47, 0x64, 0xc1c7 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=1, EQ_DATA_LO=0x67 */
+	{ 0x47, 0x63, 0xf370 }, /* EQ_DATA_HI=0xf370 */
+	{ 0x47, 0x64, 0xc271 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=2, EQ_DATA_LO=0x71 */
+	{ 0x47, 0x63, 0x1ef8 }, /* EQ_DATA_HI=0x1ef8 */
+	{ 0x47, 0x64, 0xc348 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=3, EQ_DATA_LO=0x48 */
+	{ 0x47, 0x63, 0xc110 }, /* EQ_DATA_HI=0xc110 */
+	{ 0x47, 0x64, 0xc45a }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=4, EQ_DATA_LO=0x5a */
+	{ 0x47, 0x63, 0x1f29 }, /* EQ_DATA_HI=0x1f29 */
+	{ 0x47, 0x64, 0xc574 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=5, EQ_DATA_LO=0x74 */
+	{ 0x47, 0x63, 0x1d7a }, /* EQ_DATA_HI=0x1d7a */
+	{ 0x47, 0x64, 0xc653 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=6, EQ_DATA_LO=0x53 */
+	{ 0x47, 0x63, 0xc38c }, /* EQ_DATA_HI=0xc38c */
+	{ 0x47, 0x64, 0xc714 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=7, EQ_DATA_LO=0x14 */
+	{ 0x47, 0x63, 0x1ca3 }, /* EQ_DATA_HI=0x1ca3 */
+	{ 0x47, 0x64, 0xc8c7 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=8, EQ_DATA_LO=0xc7 */
+	{ 0x47, 0x63, 0xc38c }, /* EQ_DATA_HI=0xc38c */
+	{ 0x47, 0x64, 0xc914 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=9, EQ_DATA_LO=0x14 */
+	{ 0x47, 0x64, 0x0000 }, /* -EQ_ACC, -EQ_WRT */
+	{} /* Terminator */
+};
+
 /**
  * cs8409_enable_i2c_clock - Enable I2C clocks
  * @codec: the codec instance
@@ -2029,6 +2057,7 @@ static void cs8409_enable_ur(struct hda_codec *codec, int flag)
 static void cs8409_cs42l42_hw_init(struct hda_codec *codec)
 {
 	const struct cs8409_cir_param *seq = cs8409_cs42l42_hw_cfg;
+	const struct cs8409_cir_param *seq_bullseye = cs8409_cs42l42_bullseye_atn;
 	struct cs_spec *spec = codec->spec;
 
 	if (spec->gpio_mask) {
@@ -2043,6 +2072,10 @@ static void cs8409_cs42l42_hw_init(struct hda_codec *codec)
 	for (; seq->nid; seq++)
 		cs_vendor_coef_set(codec, seq->cir, seq->coeff);
 
+	if (codec->fixup_id == CS8409_BULLSEYE)
+		for (; seq_bullseye->nid; seq_bullseye++)
+			cs_vendor_coef_set(codec, seq_bullseye->cir, seq_bullseye->coeff);
+
 	/* Disable Unsolicited Response during boot */
 	cs8409_enable_ur(codec, 0);
 
-- 
2.25.1


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

* Re: [PATCH v1 1/2] ALSA: hda/cirrus: Set Initial DMIC volume for Bullseye to 16%
  2021-04-24 14:32 ` [PATCH v1 1/2] ALSA: hda/cirrus: Set Initial DMIC volume for Bullseye to 16% Vitaly Rodionov
@ 2021-04-25  8:19   ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2021-04-25  8:19 UTC (permalink / raw)
  To: Vitaly Rodionov
  Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel, patches, linux-kernel,
	Stefan Binding, You-Sheng Yang

On Sat, 24 Apr 2021 16:32:43 +0200,
Vitaly Rodionov wrote:
> 
> From: Stefan Binding <sbinding@opensource.cirrus.com>
> 
> Tested on DELL Inspiron-3505, DELL Inspiron-3501, DELL Inspiron-3500

Could you give a bit more descriptions why this patch is needed?
And what do you mean 16%?  The only meaningful measure is dB in the
h/w spec.  Last but not least, why this value was chosen?


thanks,

Takashi

> 
> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
> Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1923557
> Reported-and-tested-by: You-Sheng Yang <vicamo.yang@canonical.com>
> ---
>  sound/pci/hda/patch_cirrus.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
> index 5d57096b3a95..d6cf93b7483c 100644
> --- a/sound/pci/hda/patch_cirrus.c
> +++ b/sound/pci/hda/patch_cirrus.c
> @@ -2172,6 +2172,10 @@ static void cs8409_cs42l42_fixups(struct hda_codec *codec,
>  			(get_wcaps(codec, CS8409_CS42L42_AMIC_PIN_NID) | AC_WCAP_UNSOL_CAP));
>  		break;
>  	case HDA_FIXUP_ACT_PROBE:
> +
> +		if (codec->fixup_id == CS8409_BULLSEYE)
> +			snd_hda_codec_amp_init_stereo(codec, CS8409_CS42L42_DMIC_ADC_PIN_NID,
> +					HDA_INPUT, 0, 0xff, 0x19);
>  		snd_hda_gen_add_kctl(&spec->gen,
>  			NULL, &cs8409_cs42l42_hp_volume_mixer);
>  		snd_hda_gen_add_kctl(&spec->gen,
> -- 
> 2.25.1
> 

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

* Re: [PATCH v1 2/2] ALSA: hda/cirrus: Use CS8409 Equalizer to fix abnormal sounds on Bullseye
  2021-04-24 14:32 ` [PATCH v1 2/2] ALSA: hda/cirrus: Use CS8409 Equalizer to fix abnormal sounds on Bullseye Vitaly Rodionov
@ 2021-04-25  8:21   ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2021-04-25  8:21 UTC (permalink / raw)
  To: Vitaly Rodionov
  Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel, patches, linux-kernel,
	Stefan Binding, You-Sheng Yang

On Sat, 24 Apr 2021 16:32:44 +0200,
Vitaly Rodionov wrote:
> 
> From: Stefan Binding <sbinding@opensource.cirrus.com>
> 
> Tested on DELL Inspiron-3505, DELL Inspiron-3501, DELL Inspiron-3500

Similarly like the previous patch, the description about the problem
itself is missing, so I cannot judge whether to take this or not.
Please clarify at first.

Also, it needs clarification whether applying this EQ to all hardware
models with this codec chip is really safe or not; i.e. it's mandatory
for the codec.


thanks,

Takashi

> 
> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
> Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1924997
> Reported-and-tested-by: You-Sheng Yang <vicamo.yang@canonical.com>
> ---
>  sound/pci/hda/patch_cirrus.c | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
> index d6cf93b7483c..82c5f0869684 100644
> --- a/sound/pci/hda/patch_cirrus.c
> +++ b/sound/pci/hda/patch_cirrus.c
> @@ -1481,6 +1481,34 @@ static const struct cs8409_cir_param cs8409_cs42l42_hw_cfg[] = {
>  	{} /* Terminator */
>  };
>  
> +static const struct cs8409_cir_param cs8409_cs42l42_bullseye_atn[] = {
> +	{ 0x47, 0x65, 0x4000 }, /* EQ_SEL=1, EQ1/2_EN=0 */
> +	{ 0x47, 0x64, 0x4000 }, /* +EQ_ACC */
> +	{ 0x47, 0x65, 0x4010 }, /* +EQ2_EN */
> +	{ 0x47, 0x63, 0x0647 }, /* EQ_DATA_HI=0x0647 */
> +	{ 0x47, 0x64, 0xc0c7 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=0, EQ_DATA_LO=0x67 */
> +	{ 0x47, 0x63, 0x0647 }, /* EQ_DATA_HI=0x0647 */
> +	{ 0x47, 0x64, 0xc1c7 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=1, EQ_DATA_LO=0x67 */
> +	{ 0x47, 0x63, 0xf370 }, /* EQ_DATA_HI=0xf370 */
> +	{ 0x47, 0x64, 0xc271 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=2, EQ_DATA_LO=0x71 */
> +	{ 0x47, 0x63, 0x1ef8 }, /* EQ_DATA_HI=0x1ef8 */
> +	{ 0x47, 0x64, 0xc348 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=3, EQ_DATA_LO=0x48 */
> +	{ 0x47, 0x63, 0xc110 }, /* EQ_DATA_HI=0xc110 */
> +	{ 0x47, 0x64, 0xc45a }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=4, EQ_DATA_LO=0x5a */
> +	{ 0x47, 0x63, 0x1f29 }, /* EQ_DATA_HI=0x1f29 */
> +	{ 0x47, 0x64, 0xc574 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=5, EQ_DATA_LO=0x74 */
> +	{ 0x47, 0x63, 0x1d7a }, /* EQ_DATA_HI=0x1d7a */
> +	{ 0x47, 0x64, 0xc653 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=6, EQ_DATA_LO=0x53 */
> +	{ 0x47, 0x63, 0xc38c }, /* EQ_DATA_HI=0xc38c */
> +	{ 0x47, 0x64, 0xc714 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=7, EQ_DATA_LO=0x14 */
> +	{ 0x47, 0x63, 0x1ca3 }, /* EQ_DATA_HI=0x1ca3 */
> +	{ 0x47, 0x64, 0xc8c7 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=8, EQ_DATA_LO=0xc7 */
> +	{ 0x47, 0x63, 0xc38c }, /* EQ_DATA_HI=0xc38c */
> +	{ 0x47, 0x64, 0xc914 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=9, EQ_DATA_LO=0x14 */
> +	{ 0x47, 0x64, 0x0000 }, /* -EQ_ACC, -EQ_WRT */
> +	{} /* Terminator */
> +};
> +
>  /**
>   * cs8409_enable_i2c_clock - Enable I2C clocks
>   * @codec: the codec instance
> @@ -2029,6 +2057,7 @@ static void cs8409_enable_ur(struct hda_codec *codec, int flag)
>  static void cs8409_cs42l42_hw_init(struct hda_codec *codec)
>  {
>  	const struct cs8409_cir_param *seq = cs8409_cs42l42_hw_cfg;
> +	const struct cs8409_cir_param *seq_bullseye = cs8409_cs42l42_bullseye_atn;
>  	struct cs_spec *spec = codec->spec;
>  
>  	if (spec->gpio_mask) {
> @@ -2043,6 +2072,10 @@ static void cs8409_cs42l42_hw_init(struct hda_codec *codec)
>  	for (; seq->nid; seq++)
>  		cs_vendor_coef_set(codec, seq->cir, seq->coeff);
>  
> +	if (codec->fixup_id == CS8409_BULLSEYE)
> +		for (; seq_bullseye->nid; seq_bullseye++)
> +			cs_vendor_coef_set(codec, seq_bullseye->cir, seq_bullseye->coeff);
> +
>  	/* Disable Unsolicited Response during boot */
>  	cs8409_enable_ur(codec, 0);
>  
> -- 
> 2.25.1
> 

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

end of thread, other threads:[~2021-04-25  8:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-24 14:32 [PATCH v1 0/2] Fix couple of bugs reported by Canonical Vitaly Rodionov
2021-04-24 14:32 ` [PATCH v1 1/2] ALSA: hda/cirrus: Set Initial DMIC volume for Bullseye to 16% Vitaly Rodionov
2021-04-25  8:19   ` Takashi Iwai
2021-04-24 14:32 ` [PATCH v1 2/2] ALSA: hda/cirrus: Use CS8409 Equalizer to fix abnormal sounds on Bullseye Vitaly Rodionov
2021-04-25  8:21   ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®