linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: George Verhaegen <verhaegen@google.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Charles Keepax <ckeepax@opensource.cirrus.com>,
	Richard Fitzgerald <rf@opensource.cirrus.com>,
	David Rhodes <david.rhodes@cirrus.com>,
	Cezary Rojewski <cezary.rojewski@intel.com>,
	Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	Srinivas Kandagatla <srini@kernel.org>,
	Daniel Baluta <daniel.baluta@nxp.com>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Kunihiko Hayashi <hayashi.kunihiko@socionext.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	kernel-team@android.com, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org, patches@opensource.cirrus.com,
	linux-arm-msm@vger.kernel.org,
	sound-open-firmware@alsa-project.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v1 0/4] ALSA: compress_offload: Add 64-bit safe timestamp API
Date: Fri, 11 Jul 2025 18:04:03 +0530	[thread overview]
Message-ID: <aHEEu1eSSGRhITmW@vaman> (raw)
In-Reply-To: <20250711082441.4193295-1-verhaegen@google.com>

On 11-07-25, 09:24, George Verhaegen wrote:
> From: Joris Verhaegen <verhaegen@google.com>
> 
> 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.

In your testing when did you observe the overflow condition?

> This patch series introduces a parallel, 64-bit safe API to solve
> this problem while maintaining perfect backward compatibility with the
> existing UAPI. A new pointer64 operation and corresponding ioctls
> are added to allow the kernel to track counters using u64 and expose
> these full-width values to user-space.

Please share patches for tinycompress support too, we need those to test
this

> The series is structured as follows:
> 
> Patch 1: Introduces the new internal pointer64 op, refactors the
> core logic 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.
> 
> Patch 4: Implements the new .pointer64 operation in various ASoC
> drivers that support compress offload.
> 
> 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, and no regressions were observed
> when using the legacy API.
> 
> Thanks,
> George (Joris) Verhaegen
> 
> Signed-off-by: Joris Verhaegen <verhaegen@google.com>
> 
> ---
> 
> Joris Verhaegen (4):
>   ALSA: compress_offload: Add 64-bit safe timestamp infrastructure
>   ALSA: compress_offload: Add SNDRV_COMPRESS_TSTAMP64 ioctl
>   ALSA: compress_offload: Add SNDRV_COMPRESS_AVAIL64 ioctl
>   ASoC: codecs: Implement 64-bit pointer operation
> 
>  include/sound/compress_driver.h               |   3 +
>  include/sound/soc-component.h                 |   5 +
>  include/sound/soc-dai.h                       |   6 +
>  include/uapi/sound/compress_offload.h         |  32 +++
>  sound/core/compress_offload.c                 | 210 ++++++++++++++----
>  sound/soc/codecs/cs47l15.c                    |   1 +
>  sound/soc/codecs/cs47l24.c                    |   1 +
>  sound/soc/codecs/cs47l35.c                    |   1 +
>  sound/soc/codecs/cs47l85.c                    |   1 +
>  sound/soc/codecs/cs47l90.c                    |   1 +
>  sound/soc/codecs/cs47l92.c                    |   1 +
>  sound/soc/codecs/wm5102.c                     |   1 +
>  sound/soc/codecs/wm5110.c                     |   1 +
>  sound/soc/codecs/wm_adsp.c                    |  53 ++++-
>  sound/soc/codecs/wm_adsp.h                    |   3 +
>  .../intel/atom/sst-mfld-platform-compress.c   |  17 +-
>  sound/soc/intel/atom/sst-mfld-platform.h      |   2 +
>  sound/soc/intel/atom/sst/sst_drv_interface.c  |  43 +++-
>  sound/soc/qcom/qdsp6/q6asm-dai.c              |  41 +++-
>  sound/soc/soc-component.c                     |  20 ++
>  sound/soc/soc-compress.c                      |  21 ++
>  sound/soc/soc-dai.c                           |  14 ++
>  sound/soc/sof/compress.c                      |  44 +++-
>  sound/soc/sprd/sprd-pcm-compress.c            |  28 ++-
>  sound/soc/sprd/sprd-pcm-dma.h                 |   2 +-
>  sound/soc/uniphier/aio-compress.c             |  40 +++-
>  26 files changed, 503 insertions(+), 89 deletions(-)
> 
> -- 
> 2.50.0.727.gbf7dc18ff4-goog

-- 
~Vinod

  parent reply	other threads:[~2025-07-11 12:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-11  8:24 [PATCH v1 0/4] ALSA: compress_offload: Add 64-bit safe timestamp API George Verhaegen
2025-07-11  8:24 ` [PATCH v1 1/4] ALSA: compress_offload: Add 64-bit safe timestamp infrastructure George Verhaegen
2025-07-11  8:24 ` [PATCH v1 2/4] ALSA: compress_offload: Add SNDRV_COMPRESS_TSTAMP64 ioctl George Verhaegen
2025-07-11  8:24 ` [PATCH v1 3/4] ALSA: compress_offload: Add SNDRV_COMPRESS_AVAIL64 ioctl George Verhaegen
2025-07-11  8:24 ` [PATCH v1 4/4] ASoC: codecs: Implement 64-bit pointer operation George Verhaegen
2025-07-11  8:42   ` Mark Brown
2025-07-11 12:34 ` Vinod Koul [this message]
2025-07-11 13:58   ` [PATCH v1 0/4] ALSA: compress_offload: Add 64-bit safe timestamp API George Verhaegen
2025-07-15 12:38     ` Vinod Koul
2025-07-25 11:52       ` George Verhaegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aHEEu1eSSGRhITmW@vaman \
    --to=vkoul@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=daniel.baluta@nxp.com \
    --cc=david.rhodes@cirrus.com \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=kernel-team@android.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=rf@opensource.cirrus.com \
    --cc=sound-open-firmware@alsa-project.org \
    --cc=srini@kernel.org \
    --cc=tiwai@suse.com \
    --cc=verhaegen@google.com \
    --cc=yung-chuan.liao@linux.intel.com \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).