[PATCH v5 1/3] ALSA: compress_offload: Add 64-bit safe timestamp infrastructure
Srinivas Kandagatla
srinivas.kandagatla at oss.qualcomm.com
Mon Sep 8 00:30:54 PDT 2025
On 9/5/25 10:12 AM, Joris Verhaegen wrote:
> 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 at google.com>
> Tested-by: Joris Verhaegen <verhaegen at google.com>
> Signed-off-by: Joris Verhaegen <verhaegen at google.com>
> ---
> include/sound/compress_driver.h | 2 +-
> include/sound/soc-component.h | 4 +-
> include/sound/soc-dai.h | 7 +--
> include/uapi/sound/compress_offload.h | 19 +++++++
> sound/core/compress_offload.c | 52 +++++++++++++------
> sound/soc/codecs/wm_adsp.c | 4 +-
> sound/soc/codecs/wm_adsp.h | 2 +-
> .../intel/atom/sst-mfld-platform-compress.c | 12 +++--
> sound/soc/intel/atom/sst-mfld-platform.h | 2 +-
> sound/soc/intel/atom/sst/sst_drv_interface.c | 9 ++--
> sound/soc/intel/avs/probes.c | 2 +-
> sound/soc/qcom/qdsp6/q6apm-dai.c | 26 ++++++----
> sound/soc/qcom/qdsp6/q6asm-dai.c | 26 ++++++----for qcom parts
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla at oss.qualcomm.com>
--srini
More information about the linux-arm-kernel
mailing list