* [PATCH 0/2] ASoC: SOF: core/Intel: Handle pause supported token from topology
@ 2024-12-13 10:11 Peter Ujfalusi
2024-12-13 10:11 ` [PATCH 1/2] ASoC: SOF: Add support for pause supported tokens " Peter Ujfalusi
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2024-12-13 10:11 UTC (permalink / raw)
To: lgirdwood, broonie
Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
pierre-louis.bossart, liam.r.girdwood
Hi,
A new set of tokens have been added to SOF topology to indicate that the pause
operation is supported or not on the given PCM device.
Pause is an optional feature that depends on pipeline, topology and modules
used by the PCM.
Add a pause_supported flag to snd_sof_pcm_stream and use this flag in Intel
platform code to keep the pause support enabled or to disable it.
Regards,
Peter
---
Peter Ujfalusi (2):
ASoC: SOF: Add support for pause supported tokens from topology
ASoC: SOF: Intel: hda-pcm: Follow the pause_supported flag to drop
PAUSE support
include/uapi/sound/sof/tokens.h | 2 ++
sound/soc/sof/intel/hda-pcm.c | 15 +++++++++++++++
sound/soc/sof/sof-audio.h | 1 +
sound/soc/sof/topology.c | 4 ++++
4 files changed, 22 insertions(+)
--
2.47.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] ASoC: SOF: Add support for pause supported tokens from topology
2024-12-13 10:11 [PATCH 0/2] ASoC: SOF: core/Intel: Handle pause supported token from topology Peter Ujfalusi
@ 2024-12-13 10:11 ` Peter Ujfalusi
2024-12-13 10:11 ` [PATCH 2/2] ASoC: SOF: Intel: hda-pcm: Follow the pause_supported flag to drop PAUSE support Peter Ujfalusi
2024-12-13 18:26 ` [PATCH 0/2] ASoC: SOF: core/Intel: Handle pause supported token from topology Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2024-12-13 10:11 UTC (permalink / raw)
To: lgirdwood, broonie
Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
pierre-louis.bossart, liam.r.girdwood
New tokens are added to topology:
1202: SOF_TKN_STREAM_PLAYBACK_PAUSE_SUPPORTED
1203: SOF_TKN_STREAM_CAPTURE_PAUSE_SUPPORTED
The new tokens are used to advertise support for PAUSE/RESUME operation on
a PCM device depending on firmware product, use case, pipeline topology.
The snd_sof_pcm_stream.pause_supported is updated to reflect the advertised
value for the PCM device.
If the token does not exist then the pause_supported is set to false.
Note: it is up to the platform code to use this flag to decide to advertise
the PAUSE support for user space or not.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
---
include/uapi/sound/sof/tokens.h | 2 ++
sound/soc/sof/sof-audio.h | 1 +
sound/soc/sof/topology.c | 4 ++++
3 files changed, 7 insertions(+)
diff --git a/include/uapi/sound/sof/tokens.h b/include/uapi/sound/sof/tokens.h
index 0a246bc218d3..c28c766270de 100644
--- a/include/uapi/sound/sof/tokens.h
+++ b/include/uapi/sound/sof/tokens.h
@@ -153,6 +153,8 @@
/* Stream */
#define SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3 1200
#define SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3 1201
+#define SOF_TKN_STREAM_PLAYBACK_PAUSE_SUPPORTED 1202
+#define SOF_TKN_STREAM_CAPTURE_PAUSE_SUPPORTED 1203
/* Led control for mute switches */
#define SOF_TKN_MUTE_LED_USE 1300
diff --git a/sound/soc/sof/sof-audio.h b/sound/soc/sof/sof-audio.h
index 01b819dd8498..62f3c11a9216 100644
--- a/sound/soc/sof/sof-audio.h
+++ b/sound/soc/sof/sof-audio.h
@@ -332,6 +332,7 @@ struct snd_sof_pcm_stream {
struct work_struct period_elapsed_work;
struct snd_soc_dapm_widget_list *list; /* list of connected DAPM widgets */
bool d0i3_compatible; /* DSP can be in D0I3 when this pcm is opened */
+ bool pause_supported; /* PCM device supports PAUSE operation */
unsigned int dsp_max_burst_size_in_ms; /* The maximum size of the host DMA burst in ms */
/*
* flag to indicate that the DSP pipelines should be kept
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index b3fca5fd87d6..688cc7ac1714 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -407,6 +407,10 @@ static const struct sof_topology_token stream_tokens[] = {
offsetof(struct snd_sof_pcm, stream[0].d0i3_compatible)},
{SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16,
offsetof(struct snd_sof_pcm, stream[1].d0i3_compatible)},
+ {SOF_TKN_STREAM_PLAYBACK_PAUSE_SUPPORTED, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16,
+ offsetof(struct snd_sof_pcm, stream[0].pause_supported)},
+ {SOF_TKN_STREAM_CAPTURE_PAUSE_SUPPORTED, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16,
+ offsetof(struct snd_sof_pcm, stream[1].pause_supported)},
};
/* Leds */
--
2.47.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ASoC: SOF: Intel: hda-pcm: Follow the pause_supported flag to drop PAUSE support
2024-12-13 10:11 [PATCH 0/2] ASoC: SOF: core/Intel: Handle pause supported token from topology Peter Ujfalusi
2024-12-13 10:11 ` [PATCH 1/2] ASoC: SOF: Add support for pause supported tokens " Peter Ujfalusi
@ 2024-12-13 10:11 ` Peter Ujfalusi
2024-12-13 18:26 ` [PATCH 0/2] ASoC: SOF: core/Intel: Handle pause supported token from topology Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2024-12-13 10:11 UTC (permalink / raw)
To: lgirdwood, broonie
Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
pierre-louis.bossart, liam.r.girdwood
If the stream's pause_supported flag is false then mask out the PAUSE
support, so user space will be prevented to use it.
Introduce a module parameter to ignore the pause_supported flag, named as
force_pause_support to allow testing of the PAUSE feature.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
---
sound/soc/sof/intel/hda-pcm.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/sound/soc/sof/intel/hda-pcm.c b/sound/soc/sof/intel/hda-pcm.c
index 5b5e484f9acf..1dd8d2092c3b 100644
--- a/sound/soc/sof/intel/hda-pcm.c
+++ b/sound/soc/sof/intel/hda-pcm.c
@@ -37,6 +37,11 @@ static bool hda_disable_rewinds;
module_param_named(disable_rewinds, hda_disable_rewinds, bool, 0444);
MODULE_PARM_DESC(disable_rewinds, "SOF HDA disable rewinds");
+static int hda_force_pause_support = -1;
+module_param_named(force_pause_support, hda_force_pause_support, int, 0444);
+MODULE_PARM_DESC(force_pause_support,
+ "Pause support: -1: Use default, 0: Disable, 1: Enable (default -1)");
+
u32 hda_dsp_get_mult_div(struct snd_sof_dev *sdev, int rate)
{
switch (rate) {
@@ -240,6 +245,16 @@ int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
if (hda_always_enable_dmi_l1 && direction == SNDRV_PCM_STREAM_CAPTURE)
runtime->hw.info &= ~SNDRV_PCM_INFO_PAUSE;
+ /*
+ * Do not advertise the PAUSE support if it is forced to be disabled via
+ * module parameter or if the pause_supported is false for the PCM
+ * device
+ */
+ if (hda_force_pause_support == 0 ||
+ (hda_force_pause_support == -1 &&
+ !spcm->stream[substream->stream].pause_supported))
+ runtime->hw.info &= ~SNDRV_PCM_INFO_PAUSE;
+
if (hda_always_enable_dmi_l1 ||
direction == SNDRV_PCM_STREAM_PLAYBACK ||
spcm->stream[substream->stream].d0i3_compatible)
--
2.47.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] ASoC: SOF: core/Intel: Handle pause supported token from topology
2024-12-13 10:11 [PATCH 0/2] ASoC: SOF: core/Intel: Handle pause supported token from topology Peter Ujfalusi
2024-12-13 10:11 ` [PATCH 1/2] ASoC: SOF: Add support for pause supported tokens " Peter Ujfalusi
2024-12-13 10:11 ` [PATCH 2/2] ASoC: SOF: Intel: hda-pcm: Follow the pause_supported flag to drop PAUSE support Peter Ujfalusi
@ 2024-12-13 18:26 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2024-12-13 18:26 UTC (permalink / raw)
To: lgirdwood, Peter Ujfalusi
Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
pierre-louis.bossart, liam.r.girdwood
On Fri, 13 Dec 2024 12:11:21 +0200, Peter Ujfalusi wrote:
> A new set of tokens have been added to SOF topology to indicate that the pause
> operation is supported or not on the given PCM device.
> Pause is an optional feature that depends on pipeline, topology and modules
> used by the PCM.
>
> Add a pause_supported flag to snd_sof_pcm_stream and use this flag in Intel
> platform code to keep the pause support enabled or to disable it.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: SOF: Add support for pause supported tokens from topology
commit: 70a667d70cce338ab8552dd762ae114a5ab96500
[2/2] ASoC: SOF: Intel: hda-pcm: Follow the pause_supported flag to drop PAUSE support
commit: 3a47319d2d910291f4c09c0f1fec4e86a2e03696
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-12-13 18:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-13 10:11 [PATCH 0/2] ASoC: SOF: core/Intel: Handle pause supported token from topology Peter Ujfalusi
2024-12-13 10:11 ` [PATCH 1/2] ASoC: SOF: Add support for pause supported tokens " Peter Ujfalusi
2024-12-13 10:11 ` [PATCH 2/2] ASoC: SOF: Intel: hda-pcm: Follow the pause_supported flag to drop PAUSE support Peter Ujfalusi
2024-12-13 18:26 ` [PATCH 0/2] ASoC: SOF: core/Intel: Handle pause supported token from topology Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox