mirror-linux/sound/soc/sprd
Joris Verhaegen 2c92e2fbe9 ALSA: compress_offload: Add 64-bit safe timestamp infrastructure
The copied_total field in struct snd_compr_tstamp is a 32-bit
value that can overflow on long-running high-bitrate streams,
leading to incorrect calculations for buffer availablility.

This patch adds a 64-bit safe timestamping mechanism.
A new UAPI struct, snd_compr_tstamp64, is added which uses 64-bit
types for byte counters. The relevant ops structures across the
ASoC and core compress code are updated to use this new struct.
ASoC drivers are updated to use u64 counters.

Internal timestamps being u64 now, a compatibility function is added
to convert the 64-bit timestamp back to the 32-bit format for legacy
ioctl callers.

Reviewed-by: Miller Liang <millerliang@google.com>
Tested-by: Joris Verhaegen <verhaegen@google.com>
Signed-off-by: Joris Verhaegen <verhaegen@google.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250905091301.2711705-2-verhaegen@google.com
2025-09-08 09:33:24 +02:00
..
Kconfig ASoC: sprd: Standardize ASoC menu 2025-06-24 01:01:21 +01:00
Makefile ASoC: sprd: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:32 +09:00
sprd-mcdt.c ASoC: Switch back to struct platform_driver::remove() 2024-09-09 18:26:49 +01:00
sprd-mcdt.h
sprd-pcm-compress.c ALSA: compress_offload: Add 64-bit safe timestamp infrastructure 2025-09-08 09:33:24 +02:00
sprd-pcm-dma.c ASoC: sprd: convert not to use asoc_xxx() 2023-09-25 14:16:26 +02:00
sprd-pcm-dma.h ALSA: compress_offload: Add 64-bit safe timestamp infrastructure 2025-09-08 09:33:24 +02:00