All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
	Artur Kloniecki <arturx.kloniecki@linux.intel.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	tiwai@suse.de,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	broonie@kernel.org
Subject: [PATCH 15/24] ASoC: SOF: Add XRUN flags field to struct sof_ipc_buffer.
Date: Wed, 15 Apr 2020 15:28:07 -0500	[thread overview]
Message-ID: <20200415202816.934-16-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20200415202816.934-1-pierre-louis.bossart@linux.intel.com>

From: Artur Kloniecki <arturx.kloniecki@linux.intel.com>

Currently if a component source buffer underruns or a component sink
buffer overruns the pipeline will enter an XRUN status and attempt
recovery. This is desired in most pipelines but some topologies need to
support use cases where we expect buffers to underrun or overrun.

Host ---> Proc----> Selector0 --> Buf0 ---- > DAI Playback
                      |
                      v
                     Buf1
                      |
                      v
Host <---------------Selector1 <----- Buf2 <----- Echo Ref DAI

In the example above we two host PCMs that can be independently
started/stopped thereby causing buf1 to either underrun or overrun
(and stop the pipelines). Buf1 should be permitted to underrun or overrun
without invoking pipeline XRUN logic and should over write oldest data
(for overrun) and readback 0s (for underrun).

2 flags have been added for use during buffer instantiation:
SOF_BUF_OVERRUN_PERMITTED and SOF_BUF_UNDERRUN_PERMITTED,
along with struct sof_ipc_buffer member fields: flags and reserved.
Flags field is supposed to hold the above-mentioned flags to allow
some control over XRUN behaviour.
Also added reserved field to the structure in case it comes in handy
some time in the future.

This is an incremental ABI change as the new fields are ignored by older
versions of the firmware.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 include/sound/sof/topology.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/sound/sof/topology.h b/include/sound/sof/topology.h
index 6a6b4791eaf6..08267d284edc 100644
--- a/include/sound/sof/topology.h
+++ b/include/sound/sof/topology.h
@@ -76,11 +76,23 @@ struct sof_ipc_comp {
 #define SOF_MEM_CAPS_CACHE			(1 << 6) /**< cacheable */
 #define SOF_MEM_CAPS_EXEC			(1 << 7) /**< executable */
 
+/*
+ * overrun will cause ring buffer overwrite, instead of XRUN.
+ */
+#define SOF_BUF_OVERRUN_PERMITTED	BIT(0)
+
+/*
+ * underrun will cause readback of 0s, instead of XRUN.
+ */
+#define SOF_BUF_UNDERRUN_PERMITTED	BIT(1)
+
 /* create new component buffer - SOF_IPC_TPLG_BUFFER_NEW */
 struct sof_ipc_buffer {
 	struct sof_ipc_comp comp;
 	uint32_t size;		/**< buffer size in bytes */
 	uint32_t caps;		/**< SOF_MEM_CAPS_ */
+	uint32_t flags;		/**< SOF_BUF_ flags defined above */
+	uint32_t reserved;	/**< reserved for future use */
 } __packed;
 
 /* generic component config data - must always be after struct sof_ipc_comp */
-- 
2.20.1


  parent reply	other threads:[~2020-04-15 20:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 20:27 [PATCH 00/24] ASoC: SOF: topology and firmware IPC updates for 5.8 Pierre-Louis Bossart
2020-04-15 20:27 ` [PATCH 01/24] ASoC: SOF: topology: fix: handle DAI widget connections properly with multiple CPU DAI's Pierre-Louis Bossart
2020-04-15 20:27 ` [PATCH 02/24] ASoC: SOF: Mark get_ext* function ext_hdr arguments as const Pierre-Louis Bossart
2020-04-15 20:27 ` [PATCH 03/24] ASoC: SOF: Introduce offset in firmware data Pierre-Louis Bossart
2020-04-15 20:27 ` [PATCH 04/24] ASoC: SOF: Introduce extended manifest Pierre-Louis Bossart
2020-04-15 20:27 ` [PATCH 05/24] ASoC: SOF: ext_manifest: parse firmware version Pierre-Louis Bossart
2020-04-15 20:27 ` [PATCH 06/24] ASoC: SOF: ext_manifest: parse windows Pierre-Louis Bossart
2020-04-15 20:27 ` [PATCH 07/24] ASoC: SOF: ext_manifest: parse compiler version Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 08/24] ASoC: SOF: topology: Add support for DC Blocker Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 09/24] ASoC: SOF: add probe support extend data Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 10/24] ASoC: SOF: add debug ABI version Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 11/24] ASoC: SOF: change type char to uint8_t in info.h Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 12/24] ASoC: SOF: change type char to uint8_t in trace.h Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 13/24] ASoC: SOF: change type char to uint8_t in topology.h Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 14/24] ASoC: SOF: make sof_ipc_cc_version to fixed length Pierre-Louis Bossart
2020-04-15 20:28 ` Pierre-Louis Bossart [this message]
2020-04-15 20:28 ` [PATCH 16/24] ASoC: SOF: Intel: Fix typo in header file comment text Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 17/24] ASoC: SOF: Intel: Change DMIC load IPC to fixed length Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 18/24] ASoC: SOF: Intel: Rename deprecated DMIC IPC struct field Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 19/24] ASoC: SOF: align sof_ipc_dai_alh_params with FW Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 20/24] ASoC: SOF: topology: Get ALH rate amd channels from topology Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 21/24] ASoC: SOF: topology: fix: parse hda_tokens to &config->hda Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 22/24] ASoC: SOF: topology: Get HDA rate and channels from topology Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 23/24] ASoC: SOF: topology: stop parsing when all tokens have been found Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 24/24] ASoC: SOF: topology: handle multiple sets of tuple arrays Pierre-Louis Bossart
2020-04-15 23:36 ` [PATCH 00/24] ASoC: SOF: topology and firmware IPC updates for 5.8 Mark Brown

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=20200415202816.934-16-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=arturx.kloniecki@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=guennadi.liakhovetski@linux.intel.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=tiwai@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.