Skip to content

Commit 0f71866

Browse files
kv2019ibroonie
authored andcommitted
ASoC: SOF: Intel: hda: modify period size constraints for ACE4
Intel ACE4 based products set more strict constraints on HDA BDLE start address and length alignment. Add a constraint to align period size to 128 bytes. The commit removes the "minimum as per HDA spec" comment. This comment was misleading as spec actually does allow a 2 byte BDLE length, and more importantly, period size also directly impacts how the BDLE start addresses are aligned, so it is not sufficient just to consider allowed buffer length. Fixes: d3df422 ("ASoC: SOF: Intel: add initial support for NVL-S") Cc: stable@vger.kernel.org Reported-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Link: https://patch.msgid.link/20260408084514.24325-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent f4c90fb commit 0f71866

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

sound/soc/sof/intel/hda-pcm.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ EXPORT_SYMBOL_NS(hda_dsp_pcm_pointer, "SND_SOC_SOF_INTEL_HDA_COMMON");
219219
int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
220220
struct snd_pcm_substream *substream)
221221
{
222+
const struct sof_intel_dsp_desc *chip_info = get_chip_info(sdev->pdata);
222223
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
223224
struct snd_pcm_runtime *runtime = substream->runtime;
224225
struct snd_soc_component *scomp = sdev->component;
@@ -268,8 +269,17 @@ int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
268269
return -ENODEV;
269270
}
270271

271-
/* minimum as per HDA spec */
272-
snd_pcm_hw_constraint_step(substream->runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
272+
/*
273+
* Set period size constraint to ensure BDLE buffer length and
274+
* start address alignment requirements are met. Align to 128
275+
* bytes for newer Intel platforms, with older ones using 4 byte alignment.
276+
*/
277+
if (chip_info->hw_ip_version >= SOF_INTEL_ACE_4_0)
278+
snd_pcm_hw_constraint_step(substream->runtime, 0,
279+
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 128);
280+
else
281+
snd_pcm_hw_constraint_step(substream->runtime, 0,
282+
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
273283

274284
/* avoid circular buffer wrap in middle of period */
275285
snd_pcm_hw_constraint_integer(substream->runtime,

0 commit comments

Comments
 (0)