[PATCH v5 0/3] ALSA: compress_offload: Add 64-bit safe timestamp API
Vinod Koul
vkoul at kernel.org
Sun Sep 7 22:47:11 PDT 2025
On 05-09-25, 10:12, Joris Verhaegen wrote:
> The current compress offload timestamping API relies on struct
> snd_compr_tstamp, whose cumulative counters like copied_total are
> defined as __u32. On long-running high-resolution audio streams, these
> 32-bit counters can overflow, causing incorrect availability
> calculations.
>
> This patch series transitions to a 64-bit safe API to solve the problem
> while maintaining perfect backward compatibility with the existing UAPI.
> The pointer operation is reworked to use a new timestamp struct with
> 64-bit fields for the cumulative counters, named snd_compr_tstamp64.
> ASoC drivers are updated to use the 64-bit structures. Corresponding
> ioctls are added to expose them to user-space.
>
> The series is structured as follows:
>
> Patch 1: Updates the pointer op, refactors the core logic and ASoC
> drivers to use it, and defines the new UAPI structs.
>
> Patch 2: Exposes the SNDRV_COMPRESS_TSTAMP64 ioctl.
>
> Patch 3: Exposes the corresponding SNDRV_COMPRESS_AVAIL64 ioctl.
>
> This series has been tested on a Pixel 9 device. All compress offload
> use cases, including long-running playback, were verified to work
> correctly with the new 64-bit API.
Acked-by: Vinod Koul <vkoul at kernel.org>
Please updated tinycompress changes with this once this is picked up by
Takashi-san
--
~Vinod
More information about the linux-arm-kernel
mailing list