ASoC: SOF: imx: Add SNDRV_PCM_INFO_BATCH flag
PATCH 1/1 ASoC: SOF: imx: Add SNDRV_PCM_INFO_BATCH flag
The sof imx pcm device is a device which should support double buffering.
Found this issue with pipewire. When there is no SNDRV_PCM_INFO_BATCH flag in driver, the pipewire will set headroom to be zero, and because sof pcm device don't support residue report, when the latency setting is small, the "delay" always larger than "target" in alsa-pcm.c, that reading next period data is not scheduled on time.
With SNDRV_PCM_INFO_BATCH flag in driver, the pipewire will select a smaller period size for device, then the task of reading next period data will be scheduled on time.
--- sound/soc/sof/imx/imx8.c | 1 + sound/soc/sof/imx/imx8m.c | 1 + sound/soc/sof/imx/imx8ulp.c | 1 + 3 files changed, 3 insertions(+)
sound/soc/sof/imx/imx8.c +1 -0
@@ -603,6 +603,7 @@ static struct snd_sof_dsp_ops sof_imx8x_ops = {SNDRV_PCM_INFO_MMAP_VALID |SNDRV_PCM_INFO_INTERLEAVED |SNDRV_PCM_INFO_PAUSE | +SNDRV_PCM_INFO_BATCH | SNDRV_PCM_INFO_NO_PERIOD_WAKEUP };
sound/soc/sof/imx/imx8m.c +1 -0
@@ -472,6 +472,7 @@ static struct snd_sof_dsp_ops sof_imx8m_ops = {SNDRV_PCM_INFO_MMAP_VALID |SNDRV_PCM_INFO_INTERLEAVED |SNDRV_PCM_INFO_PAUSE | +SNDRV_PCM_INFO_BATCH | SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, };
sound/soc/sof/imx/imx8ulp.c +1 -0
@@ -463,6 +463,7 @@ static struct snd_sof_dsp_ops sof_imx8ulp_ops = {SNDRV_PCM_INFO_MMAP_VALID |SNDRV_PCM_INFO_INTERLEAVED |SNDRV_PCM_INFO_PAUSE | +SNDRV_PCM_INFO_BATCH | SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,/* PM */
Signature · 1 line
2.34.1
Mark Brown
maintainerQuoted 11 lines · Shengjiu Wang
The sof imx pcm device is a device which should support double buffering.
Found this issue with pipewire. When there is no
SNDRV_PCM_INFO_BATCHflag in driver, the pipewire will set headroom to be zero, and because sof pcm device don't support residue report, when the latency setting is small, the "delay" always larger than "target" inalsa-pcm.c, that reading next period data is not scheduled on time.
Quoted 1 line
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: SOF: imx: Add SNDRV_PCM_INFO_BATCH flag
commit: b6190c452a2264ccd88c849b91990fe854a7ec72
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