Commit 2c92e2fb authored by Joris Verhaegen's avatar Joris Verhaegen Committed by Takashi Iwai
Browse files

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: default avatarMiller Liang <millerliang@google.com>
Tested-by: default avatarJoris Verhaegen <verhaegen@google.com>
Signed-off-by: default avatarJoris Verhaegen <verhaegen@google.com>
Reviewed-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Reviewed-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Acked-by: default avatarVinod Koul <vkoul@kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250905091301.2711705-2-verhaegen@google.com
parent cbd67687
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment