Skip to contentSkip to conversation

ASoC: Intel: set dpcm_capture for amps

PATCH In review Kai Vehmanen 2 participants 6 messages Jan 19, 2023 – Jan 20, 2023

Subsystems (3)
lore
Share & tools
lore

Kai Vehmanen

author maintainer
#0 lore raw

cover ASoC: Intel: set dpcm_capture for amps

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

Signature · 1 line
2.39.0
author maintainer
#1 lore raw

PATCH 1/4 ASoC: Intel: sof_rt5682: always set dpcm_capture for amplifiers

From: Pierre-Louis Bossart <[email protected]>

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.

---
 sound/soc/intel/boards/sof_rt5682.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/intel/boards/sof_rt5682.c +3 -2
index 2eabc4b0fafa..71a11d747622 100644
@@ -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;
Signature · 1 line
2.39.0
author maintainer
#2 lore raw

PATCH 2/4 ASoC: Intel: sof_cs42l42: always set dpcm_capture for amplifiers

In reply to Kai Vehmanen

From: Pierre-Louis Bossart <[email protected]>

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.

---
 sound/soc/intel/boards/sof_cs42l42.c | 3 +++
 1 file changed, 3 insertions(+)
sound/soc/intel/boards/sof_cs42l42.c +3 -0
index e38bd2831e6a..e9d190cb13b0 100644
@@ -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;
Signature · 1 line
2.39.0
author maintainer
#3 lore raw

PATCH 3/4 ASoC: Intel: sof_nau8825: always set dpcm_capture for amplifiers

In reply to Kai Vehmanen

From: Pierre-Louis Bossart <[email protected]>

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.

---
 sound/soc/intel/boards/sof_nau8825.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/intel/boards/sof_nau8825.c +3 -2
index a800854c2831..6794a0249a9a 100644
@@ -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;
Signature · 1 line
2.39.0
author maintainer
#4 lore raw

PATCH 4/4 ASoC: Intel: sof_ssp_amp: always set dpcm_capture for amplifiers

In reply to Kai Vehmanen

From: Pierre-Louis Bossart <[email protected]>

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.

---
 sound/soc/intel/boards/sof_ssp_amp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
sound/soc/intel/boards/sof_ssp_amp.c +2 -3
index f75800d9d6de..ffd9c583dab1 100644
@@ -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;
Signature · 1 line
2.39.0
maintainer
#5 lore raw
In reply to Kai Vehmanen
Quoted 5 lines · Kai Vehmanen

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

Quoted 7 lines

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