linux-stable/sound/soc/xilinx
Robert Hancock e958b58847
ASoC: xilinx: xlnx_formatter_pcm: Make buffer bytes multiple of period bytes
This patch is based on one in the Xilinx kernel tree, "ASoc: xlnx: Make
buffer bytes multiple of period bytes" by Devarsh Thakkar. The same
issue exists in the mainline version of the driver. The original
patch description is as follows:

"The Xilinx Audio Formatter IP has a constraint on period
bytes to be multiple of 64. This leads to driver changing
the period size to suitable frames such that period bytes
are multiple of 64.

Now since period bytes and period size are updated but not
the buffer bytes, this may make the buffer bytes unaligned
and not multiple of period bytes.

When this happens we hear popping noise as while DMA is being
done the buffer bytes are not enough to complete DMA access
for last period of frame within the application buffer boundary.

To avoid this, align buffer bytes too as multiple of 64, and
set another constraint to always enforce number of periods as
integer. Now since, there is already a rule in alsa core
to enforce Buffer size = Number of Periods * Period Size
this automatically aligns buffer bytes as multiple of period
bytes."

Fixes: 6f6c3c36f0 ("ASoC: xlnx: add pcm formatter platform driver")
Cc: Devarsh Thakkar <devarsh.thakkar@xilinx.com>
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Link: https://lore.kernel.org/r/20220107214711.1100162-2-robert.hancock@calian.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-10 15:16:29 +00:00
..
Kconfig sound: remove duplicate "the the" phrase in Kconfig text 2020-08-18 14:52:43 +01:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
xlnx_formatter_pcm.c ASoC: xilinx: xlnx_formatter_pcm: Make buffer bytes multiple of period bytes 2022-01-10 15:16:29 +00:00
xlnx_i2s.c ASoC: xlnx: use devm_platform_ioremap_resource() to simplify code 2019-07-31 12:08:43 +01:00
xlnx_spdif.c ASoC: xlnx: Use platform_get_irq() to get the interrupt 2021-12-21 18:05:42 +00:00