linux/sound/soc/mediatek
Chen-Yu Tsai 32c9c06adb
ASoC: mediatek: disable buffer pre-allocation
On Chromebooks based on Mediatek MT8195 or MT8188, the audio frontend
(AFE) is limited to accessing a very small window (1 MiB) of memory,
which is described as a reserved memory region in the device tree.

On these two platforms, the maximum buffer size is given as 512 KiB.
The MediaTek common code uses the same value for preallocations. This
means that only the first two PCM substreams get preallocations, and
then the whole space is exhausted, barring any other substreams from
working. Since the substreams used are not always the first two, this
means audio won't work correctly.

This is observed on the MT8188 Geralt Chromebooks, on which the
"mediatek,dai-link" property was dropped when it was upstreamed. That
property causes the driver to only register the PCM substreams listed
in the property, and in the order given.

Instead of trying to compute an optimal value and figuring out which
streams are used, simply disable preallocation. The PCM buffers are
managed by the core and are allocated and released on the fly. There
should be no impact to any of the other MediaTek platforms.

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20241219105303.548437-1-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-19 11:15:09 +00:00
..
common ASoC: mediatek: disable buffer pre-allocation 2024-12-19 11:15:09 +00:00
mt2701 ASoC: mediatek: remove dpcm_xxx flags 2024-10-23 13:01:59 +01:00
mt6797 ASoC: mediatek: remove dpcm_xxx flags 2024-10-23 13:01:59 +01:00
mt7986 ASoC: mediatek: remove dpcm_xxx flags 2024-10-23 13:01:59 +01:00
mt8173 ASoC: mediatek: remove dpcm_xxx flags 2024-10-23 13:01:59 +01:00
mt8183 ASoC: mediatek: mt8183: Remove unnecessary variable assignments 2024-11-08 13:33:06 +00:00
mt8186 ASoC: mediatek: remove dpcm_xxx flags 2024-10-23 13:01:59 +01:00
mt8188 ASoC: mediatek: mt8188-mt6359: Remove hardcoded dmic codec 2024-12-05 13:39:58 +00:00
mt8192 ASoC: mediatek: Check num_codecs is not zero to avoid panic during probe 2024-11-27 11:28:25 +00:00
mt8195 ASoC: mediatek: Check num_codecs is not zero to avoid panic during probe 2024-11-27 11:28:25 +00:00
mt8365 ASoC: add symmetric_ prefix for dai->rate/channels/sample_bits 2024-11-11 14:45:41 +00:00
Kconfig ASoC: mt8365: Allow build coverage 2024-09-09 16:58:18 +01:00
Makefile ASoC: mediatek: Add MT8365 support 2024-09-05 12:31:04 +01:00