alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] ASoC: Intel: set dpcm_capture for amps
@ 2023-01-19 16:34 Kai Vehmanen
  2023-01-19 16:34 ` [PATCH 1/4] ASoC: Intel: sof_rt5682: always set dpcm_capture for amplifiers Kai Vehmanen
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Kai Vehmanen @ 2023-01-19 16:34 UTC (permalink / raw)
  To: alsa-devel, broonie
  Cc: kai.vehmanen, yung-chuan.liao, lgirdwood, peter.ujfalusi,
	pierre-louis.bossart, ranjani.sridharan, daniel.baluta

This series addresses problems with echo reference devices
reported in:
"[BUG][ADL-N] Kernel panic when echo reference stream is opened"
https://github.com/thesofproject/linux/issues/4083

Pierre-Louis Bossart (4):
  ASoC: Intel: sof_rt5682: always set dpcm_capture for amplifiers
  ASoC: Intel: sof_cs42l42: always set dpcm_capture for amplifiers
  ASoC: Intel: sof_nau8825: always set dpcm_capture for amplifiers
  ASoC: Intel: sof_ssp_amp: always set dpcm_capture for amplifiers

 sound/soc/intel/boards/sof_cs42l42.c | 3 +++
 sound/soc/intel/boards/sof_nau8825.c | 5 +++--
 sound/soc/intel/boards/sof_rt5682.c  | 5 +++--
 sound/soc/intel/boards/sof_ssp_amp.c | 5 ++---
 4 files changed, 11 insertions(+), 7 deletions(-)


base-commit: 8dc08c82afbf00e3cbe8944f7e33fa133c01858f
-- 
2.39.0


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

* [PATCH 1/4] ASoC: Intel: sof_rt5682: always set dpcm_capture for amplifiers
  2023-01-19 16:34 [PATCH 0/4] ASoC: Intel: set dpcm_capture for amps Kai Vehmanen
@ 2023-01-19 16:34 ` Kai Vehmanen
  2023-01-19 16:34 ` [PATCH 2/4] ASoC: Intel: sof_cs42l42: " Kai Vehmanen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kai Vehmanen @ 2023-01-19 16:34 UTC (permalink / raw)
  To: alsa-devel, broonie
  Cc: kai.vehmanen, yung-chuan.liao, lgirdwood, peter.ujfalusi,
	pierre-louis.bossart, ranjani.sridharan, daniel.baluta

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

The amplifier may provide hardware support for I/V feedback, or
alternatively the firmware may generate an echo reference attached to
the SSP and dailink used for the amplifier.

To avoid any issues with invalid/NULL substreams in the latter case,
always unconditionally set dpcm_capture.

Link: https://github.com/thesofproject/linux/issues/4083
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/soc/intel/boards/sof_rt5682.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c
index 2eabc4b0fafa..71a11d747622 100644
--- a/sound/soc/intel/boards/sof_rt5682.c
+++ b/sound/soc/intel/boards/sof_rt5682.c
@@ -761,8 +761,6 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
 			links[id].num_codecs = ARRAY_SIZE(max_98373_components);
 			links[id].init = max_98373_spk_codec_init;
 			links[id].ops = &max_98373_ops;
-			/* feedback stream */
-			links[id].dpcm_capture = 1;
 		} else if (sof_rt5682_quirk &
 				SOF_MAX98360A_SPEAKER_AMP_PRESENT) {
 			max_98360a_dai_link(&links[id]);
@@ -789,6 +787,9 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
 		links[id].platforms = platform_component;
 		links[id].num_platforms = ARRAY_SIZE(platform_component);
 		links[id].dpcm_playback = 1;
+		/* feedback stream or firmware-generated echo reference */
+		links[id].dpcm_capture = 1;
+
 		links[id].no_pcm = 1;
 		links[id].cpus = &cpus[id];
 		links[id].num_cpus = 1;
-- 
2.39.0


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

* [PATCH 2/4] ASoC: Intel: sof_cs42l42: always set dpcm_capture for amplifiers
  2023-01-19 16:34 [PATCH 0/4] ASoC: Intel: set dpcm_capture for amps Kai Vehmanen
  2023-01-19 16:34 ` [PATCH 1/4] ASoC: Intel: sof_rt5682: always set dpcm_capture for amplifiers Kai Vehmanen
@ 2023-01-19 16:34 ` Kai Vehmanen
  2023-01-19 16:34 ` [PATCH 3/4] ASoC: Intel: sof_nau8825: " Kai Vehmanen
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kai Vehmanen @ 2023-01-19 16:34 UTC (permalink / raw)
  To: alsa-devel, broonie
  Cc: kai.vehmanen, yung-chuan.liao, lgirdwood, peter.ujfalusi,
	pierre-louis.bossart, ranjani.sridharan, daniel.baluta

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

The amplifier may provide hardware support for I/V feedback, or
alternatively the firmware may generate an echo reference attached to
the SSP and dailink used for the amplifier.

To avoid any issues with invalid/NULL substreams in the latter case,
always unconditionally set dpcm_capture.

Link: https://github.com/thesofproject/linux/issues/4083
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/soc/intel/boards/sof_cs42l42.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/intel/boards/sof_cs42l42.c b/sound/soc/intel/boards/sof_cs42l42.c
index e38bd2831e6a..e9d190cb13b0 100644
--- a/sound/soc/intel/boards/sof_cs42l42.c
+++ b/sound/soc/intel/boards/sof_cs42l42.c
@@ -336,6 +336,9 @@ static int create_spk_amp_dai_links(struct device *dev,
 	links[*id].platforms = platform_component;
 	links[*id].num_platforms = ARRAY_SIZE(platform_component);
 	links[*id].dpcm_playback = 1;
+	/* firmware-generated echo reference */
+	links[*id].dpcm_capture = 1;
+
 	links[*id].no_pcm = 1;
 	links[*id].cpus = &cpus[*id];
 	links[*id].num_cpus = 1;
-- 
2.39.0


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

* [PATCH 3/4] ASoC: Intel: sof_nau8825: always set dpcm_capture for amplifiers
  2023-01-19 16:34 [PATCH 0/4] ASoC: Intel: set dpcm_capture for amps Kai Vehmanen
  2023-01-19 16:34 ` [PATCH 1/4] ASoC: Intel: sof_rt5682: always set dpcm_capture for amplifiers Kai Vehmanen
  2023-01-19 16:34 ` [PATCH 2/4] ASoC: Intel: sof_cs42l42: " Kai Vehmanen
@ 2023-01-19 16:34 ` Kai Vehmanen
  2023-01-19 16:34 ` [PATCH 4/4] ASoC: Intel: sof_ssp_amp: " Kai Vehmanen
  2023-01-20 14:21 ` [PATCH 0/4] ASoC: Intel: set dpcm_capture for amps Mark Brown
  4 siblings, 0 replies; 6+ messages in thread
From: Kai Vehmanen @ 2023-01-19 16:34 UTC (permalink / raw)
  To: alsa-devel, broonie
  Cc: kai.vehmanen, yung-chuan.liao, lgirdwood, peter.ujfalusi,
	pierre-louis.bossart, ranjani.sridharan, daniel.baluta

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

The amplifier may provide hardware support for I/V feedback, or
alternatively the firmware may generate an echo reference attached to
the SSP and dailink used for the amplifier.

To avoid any issues with invalid/NULL substreams in the latter case,
always unconditionally set dpcm_capture.

Link: https://github.com/thesofproject/linux/issues/4083
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/soc/intel/boards/sof_nau8825.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/boards/sof_nau8825.c b/sound/soc/intel/boards/sof_nau8825.c
index a800854c2831..6794a0249a9a 100644
--- a/sound/soc/intel/boards/sof_nau8825.c
+++ b/sound/soc/intel/boards/sof_nau8825.c
@@ -487,8 +487,6 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
 			links[id].num_codecs = ARRAY_SIZE(max_98373_components);
 			links[id].init = max_98373_spk_codec_init;
 			links[id].ops = &max_98373_ops;
-			/* feedback stream */
-			links[id].dpcm_capture = 1;
 		} else if (sof_nau8825_quirk &
 				SOF_MAX98360A_SPEAKER_AMP_PRESENT) {
 			max_98360a_dai_link(&links[id]);
@@ -506,6 +504,9 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
 		links[id].platforms = platform_component;
 		links[id].num_platforms = ARRAY_SIZE(platform_component);
 		links[id].dpcm_playback = 1;
+		/* feedback stream or firmware-generated echo reference */
+		links[id].dpcm_capture = 1;
+
 		links[id].no_pcm = 1;
 		links[id].cpus = &cpus[id];
 		links[id].num_cpus = 1;
-- 
2.39.0


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

* [PATCH 4/4] ASoC: Intel: sof_ssp_amp: always set dpcm_capture for amplifiers
  2023-01-19 16:34 [PATCH 0/4] ASoC: Intel: set dpcm_capture for amps Kai Vehmanen
                   ` (2 preceding siblings ...)
  2023-01-19 16:34 ` [PATCH 3/4] ASoC: Intel: sof_nau8825: " Kai Vehmanen
@ 2023-01-19 16:34 ` Kai Vehmanen
  2023-01-20 14:21 ` [PATCH 0/4] ASoC: Intel: set dpcm_capture for amps Mark Brown
  4 siblings, 0 replies; 6+ messages in thread
From: Kai Vehmanen @ 2023-01-19 16:34 UTC (permalink / raw)
  To: alsa-devel, broonie
  Cc: kai.vehmanen, yung-chuan.liao, lgirdwood, peter.ujfalusi,
	pierre-louis.bossart, ranjani.sridharan, daniel.baluta

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

The amplifier may provide hardware support for I/V feedback, or
alternatively the firmware may generate an echo reference attached to
the SSP and dailink used for the amplifier.

To avoid any issues with invalid/NULL substreams in the latter case,
always unconditionally set dpcm_capture.

Link: https://github.com/thesofproject/linux/issues/4083
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/soc/intel/boards/sof_ssp_amp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/intel/boards/sof_ssp_amp.c b/sound/soc/intel/boards/sof_ssp_amp.c
index f75800d9d6de..ffd9c583dab1 100644
--- a/sound/soc/intel/boards/sof_ssp_amp.c
+++ b/sound/soc/intel/boards/sof_ssp_amp.c
@@ -254,13 +254,12 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
 		sof_rt1308_dai_link(&links[id]);
 	} else if (sof_ssp_amp_quirk & SOF_CS35L41_SPEAKER_AMP_PRESENT) {
 		cs35l41_set_dai_link(&links[id]);
-
-		/* feedback from amplifier */
-		links[id].dpcm_capture = 1;
 	}
 	links[id].platforms = platform_component;
 	links[id].num_platforms = ARRAY_SIZE(platform_component);
 	links[id].dpcm_playback = 1;
+	/* feedback from amplifier or firmware-generated echo reference */
+	links[id].dpcm_capture = 1;
 	links[id].no_pcm = 1;
 	links[id].cpus = &cpus[id];
 	links[id].num_cpus = 1;
-- 
2.39.0


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

* Re: [PATCH 0/4] ASoC: Intel: set dpcm_capture for amps
  2023-01-19 16:34 [PATCH 0/4] ASoC: Intel: set dpcm_capture for amps Kai Vehmanen
                   ` (3 preceding siblings ...)
  2023-01-19 16:34 ` [PATCH 4/4] ASoC: Intel: sof_ssp_amp: " Kai Vehmanen
@ 2023-01-20 14:21 ` Mark Brown
  4 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2023-01-20 14:21 UTC (permalink / raw)
  To: alsa-devel, Kai Vehmanen
  Cc: pierre-louis.bossart, yung-chuan.liao, peter.ujfalusi,
	ranjani.sridharan, lgirdwood, daniel.baluta

On Thu, 19 Jan 2023 18:34:55 +0200, Kai Vehmanen wrote:
> This series addresses problems with echo reference devices
> reported in:
> "[BUG][ADL-N] Kernel panic when echo reference stream is opened"
> https://github.com/thesofproject/linux/issues/4083
> 
> Pierre-Louis Bossart (4):
>   ASoC: Intel: sof_rt5682: always set dpcm_capture for amplifiers
>   ASoC: Intel: sof_cs42l42: always set dpcm_capture for amplifiers
>   ASoC: Intel: sof_nau8825: always set dpcm_capture for amplifiers
>   ASoC: Intel: sof_ssp_amp: always set dpcm_capture for amplifiers
> 
> [...]

Applied to

   broonie/sound.git for-next

Thanks!

[1/4] ASoC: Intel: sof_rt5682: always set dpcm_capture for amplifiers
      commit: 324f065cdbaba1b879a63bf07e61ca156b789537
[2/4] ASoC: Intel: sof_cs42l42: always set dpcm_capture for amplifiers
      commit: e0a52220344ab7defe25b9cdd58fe1dc1122e67c
[3/4] ASoC: Intel: sof_nau8825: always set dpcm_capture for amplifiers
      commit: 36a71a0eb7cdb5ccf4b0214dbd41ab00dff18c7f
[4/4] ASoC: Intel: sof_ssp_amp: always set dpcm_capture for amplifiers
      commit: b3c00316a2f847791bae395ea6dd91aa7a221471

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


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

end of thread, other threads:[~2023-01-20 14:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-19 16:34 [PATCH 0/4] ASoC: Intel: set dpcm_capture for amps Kai Vehmanen
2023-01-19 16:34 ` [PATCH 1/4] ASoC: Intel: sof_rt5682: always set dpcm_capture for amplifiers Kai Vehmanen
2023-01-19 16:34 ` [PATCH 2/4] ASoC: Intel: sof_cs42l42: " Kai Vehmanen
2023-01-19 16:34 ` [PATCH 3/4] ASoC: Intel: sof_nau8825: " Kai Vehmanen
2023-01-19 16:34 ` [PATCH 4/4] ASoC: Intel: sof_ssp_amp: " Kai Vehmanen
2023-01-20 14:21 ` [PATCH 0/4] ASoC: Intel: set dpcm_capture for amps Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).