From: Jaroslav Kysela <perex@perex.cz>
To: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
"Takashi Iwai" <tiwai@suse.com>,
"Mark Brown" <broonie@kernel.org>,
"Liam Girdwood" <liam.r.girdwood@linux.intel.com>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
"linux-sound@vger.kernel.org" <linux-sound@vger.kernel.org>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
arun@asymptotic.io, wim.taymans@gmail.com
Subject: Re: (re)use and (re)definition of snd_pcm_hw_params->fifo_size for 'jumpy DMA'
Date: Wed, 25 Mar 2026 15:08:04 +0100 [thread overview]
Message-ID: <1ca0acb2-18fb-449e-9a52-e73d9eebfb62@perex.cz> (raw)
In-Reply-To: <420a8205-6a95-4e8a-852e-f3094200e5b1@linux.intel.com>
On 3/25/26 14:28, Péter Ujfalusi wrote:
> Looking at the PW code (spa/plugins/alsa/alsa-pcm.c) and I sort of
> started to appreciate the 'headroom' term.
>
> I disagree that this is not about DMA or about burst since it is
> precisely about that. It can be viewed as 'latency' but the latency is
> reported via the delay and the delay fluctuates over time based on how
> the DSP FIFO drains and fills.
My point was that we should not use those terms for the structure members,
because it's standard prefill / data fetch (put) granularity issue. DMA is
just the concrete use. Describing both parameters seem like the best idea.
> PW then probably can use these:
> state->start_delay = hw_buffer_size;
> state->headroom = hw_buffer_refill_step_size
We don't use head/tail in the buffer variables for ALSA API. The headroom can
be named just 'update_granularity' or 'update_step' or so. Also, start delay
is not correct, too. Maybe 'prefill' or 'init_fill' says all. Or we can
eventually try to be more consistent and use 'init_chunk' and 'step_chunk' to
notify applications about the data transfer characteristics from the other
(hw) side of the audio buffer. The chunk word is not used actually in the ALSA
API, so developers should not mix that with other things like fifo or period.
> and on start/xrun it might need to provide
> state->start_delay + max(state->start_delay, state->headroom)
> or to the distance that it is planning to wake up.
It will end with 2 * prefill for your examples, because start_delay >
headroom. It should be just prefill + step.
Also, it seems that in SOF case, the queued "prefill" sample block is
mandatory for internal processing, otherwise xrun will happen, or no ?
Jaroslav
--
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
next prev parent reply other threads:[~2026-03-25 14:08 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 13:34 (re)use and (re)definition of snd_pcm_hw_params->fifo_size for 'jumpy DMA' Péter Ujfalusi
2026-03-23 14:54 ` Jaroslav Kysela
2026-03-23 16:16 ` Péter Ujfalusi
2026-03-24 8:58 ` Jaroslav Kysela
2026-03-24 10:51 ` Péter Ujfalusi
2026-03-24 13:25 ` Péter Ujfalusi
2026-03-24 15:48 ` Jaroslav Kysela
2026-03-25 13:28 ` Péter Ujfalusi
2026-03-25 14:08 ` Jaroslav Kysela [this message]
2026-03-26 12:04 ` Péter Ujfalusi
2026-03-24 7:12 ` Péter Ujfalusi
2026-03-30 14:27 ` Takashi Iwai
2026-03-30 15:15 ` Péter Ujfalusi
2026-03-30 16:39 ` Takashi Iwai
2026-03-31 6:00 ` Péter Ujfalusi
2026-03-31 6:36 ` Takashi Iwai
2026-03-31 9:29 ` Jaroslav Kysela
2026-03-31 10:42 ` Kai Vehmanen
2026-03-31 10:56 ` Péter Ujfalusi
2026-03-31 12:00 ` Jaroslav Kysela
2026-03-31 14:09 ` Péter Ujfalusi
2026-04-02 12:01 ` Jaroslav Kysela
2026-04-07 11:59 ` Péter Ujfalusi
2026-04-07 13:50 ` Jaroslav Kysela
2026-03-31 11:19 ` Péter Ujfalusi
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=1ca0acb2-18fb-449e-9a52-e73d9eebfb62@perex.cz \
--to=perex@perex.cz \
--cc=alsa-devel@alsa-project.org \
--cc=arun@asymptotic.io \
--cc=broonie@kernel.org \
--cc=kai.vehmanen@linux.intel.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=linux-sound@vger.kernel.org \
--cc=peter.ujfalusi@linux.intel.com \
--cc=tiwai@suse.com \
--cc=wim.taymans@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