Skip to content

Commit aa7e9ea

Browse files
Srinivas-Kandagatlagregkh
authored andcommitted
ASoC: qdsp6: q6apm-dai: set 10 ms period and buffer alignment.
commit 3107019 upstream. DSP expects the periods to be aligned to fragment sizes, currently setting up to hw constriants on periods bytes is not going to work correctly as we can endup with periods sizes aligned to 32 bytes however not aligned to fragment size. Update the constriants to use fragment size, and also set at step of 10ms for period size to accommodate DSP requirements of 10ms latency. Fixes: 9b4fe0f ("ASoC: qdsp6: audioreach: add q6apm-dai support") Cc: stable@vger.kernel.org Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Johan Hovold <johan+linaro@kernel.org> Link: https://patch.msgid.link/20250314174800.10142-5-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a28217b commit aa7e9ea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sound/soc/qcom/qdsp6/q6apm-dai.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,14 @@ static int q6apm_dai_open(struct snd_soc_component *component,
385385
}
386386
}
387387

388-
ret = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 32);
388+
/* setup 10ms latency to accommodate DSP restrictions */
389+
ret = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 480);
389390
if (ret < 0) {
390391
dev_err(dev, "constraint for period bytes step ret = %d\n", ret);
391392
goto err;
392393
}
393394

394-
ret = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 32);
395+
ret = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 480);
395396
if (ret < 0) {
396397
dev_err(dev, "constraint for buffer bytes step ret = %d\n", ret);
397398
goto err;

0 commit comments

Comments
 (0)