alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: dpcm: allow start or stop during pause for backend
       [not found] <CGME20200401010421epcas2p3d5b16041fa59efa0ac8786f682d4c991@epcas2p3.samsung.com>
@ 2020-04-01  1:04 ` 이경택
  2020-04-01  5:06   ` Vinod Koul
  2020-04-01 11:06   ` Applied "ASoC: dpcm: allow start or stop during pause for backend" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: 이경택 @ 2020-04-01  1:04 UTC (permalink / raw)
  To: broonie, vkoul; +Cc: alsa-devel, lgirdwood, tiwai, hmseo, tkjung, pilsun.jang

soc_compr_trigger_fe() allows start or stop after pause_push.
In dpcm_be_dai_trigger(), however, only pause_release is allowed
command after pause_push.
So, start or stop after pause in compress offload is always
returned as error if the compress offload is used with dpcm.
To fix the problem, SND_SOC_DPCM_STATE_PAUSED should be allowed
for start or stop command.

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
---
 sound/soc/soc-pcm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 2c59b3688ca0..8f6f0ad50288 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2236,7 +2236,8 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
 		switch (cmd) {
 		case SNDRV_PCM_TRIGGER_START:
 			if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) &&
-			    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP))
+			    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) &&
+			    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED))
 				continue;
 
 			ret = dpcm_do_trigger(dpcm, be_substream, cmd);
@@ -2266,7 +2267,8 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
 			be->dpcm[stream].state = SND_SOC_DPCM_STATE_START;
 			break;
 		case SNDRV_PCM_TRIGGER_STOP:
-			if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START)
+			if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) &&
+			    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED))
 				continue;
 
 			if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream))
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: dpcm: allow start or stop during pause for backend
  2020-04-01  1:04 ` [PATCH] ASoC: dpcm: allow start or stop during pause for backend 이경택
@ 2020-04-01  5:06   ` Vinod Koul
  2020-04-01 11:06   ` Applied "ASoC: dpcm: allow start or stop during pause for backend" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2020-04-01  5:06 UTC (permalink / raw)
  To: �̰���
  Cc: alsa-devel, lgirdwood, tiwai, broonie, hmseo, tkjung, pilsun.jang

Hello Gyeongtaek,

On 01-04-20, 10:04, �̰��� wrote:
> soc_compr_trigger_fe() allows start or stop after pause_push.
> In dpcm_be_dai_trigger(), however, only pause_release is allowed
> command after pause_push.
> So, start or stop after pause in compress offload is always
> returned as error if the compress offload is used with dpcm.
> To fix the problem, SND_SOC_DPCM_STATE_PAUSED should be allowed
> for start or stop command.

I think it makes sense to allow START if the stream is paused. Similarly
a STOP should be legal as well for paused stream, so:

Reviewed-by: Vinod Koul <vkoul@kernel.org>

> 
> Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
> ---
>  sound/soc/soc-pcm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
> index 2c59b3688ca0..8f6f0ad50288 100644
> --- a/sound/soc/soc-pcm.c
> +++ b/sound/soc/soc-pcm.c
> @@ -2236,7 +2236,8 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
>  		switch (cmd) {
>  		case SNDRV_PCM_TRIGGER_START:
>  			if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) &&
> -			    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP))
> +			    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) &&
> +			    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED))
>  				continue;
>  
>  			ret = dpcm_do_trigger(dpcm, be_substream, cmd);
> @@ -2266,7 +2267,8 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
>  			be->dpcm[stream].state = SND_SOC_DPCM_STATE_START;
>  			break;
>  		case SNDRV_PCM_TRIGGER_STOP:
> -			if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START)
> +			if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) &&
> +			    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED))
>  				continue;
>  
>  			if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream))
> -- 
> 2.21.0
> 

-- 
~Vinod

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Applied "ASoC: dpcm: allow start or stop during pause for backend" to the asoc tree
  2020-04-01  1:04 ` [PATCH] ASoC: dpcm: allow start or stop during pause for backend 이경택
  2020-04-01  5:06   ` Vinod Koul
@ 2020-04-01 11:06   ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2020-04-01 11:06 UTC (permalink / raw)
  To: 이경택
  Cc: alsa-devel, lgirdwood, tiwai, vkoul, Mark Brown, hmseo,
	Gyeongtaek Lee, pilsun.jang, tkjung

The patch

   ASoC: dpcm: allow start or stop during pause for backend

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

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

From 21fca8bdbb64df1297e8c65a746c4c9f4a689751 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EC=9D=B4=EA=B2=BD=ED=83=9D?= <gt82.lee@samsung.com>
Date: Wed, 1 Apr 2020 10:04:21 +0900
Subject: [PATCH] ASoC: dpcm: allow start or stop during pause for backend

soc_compr_trigger_fe() allows start or stop after pause_push.
In dpcm_be_dai_trigger(), however, only pause_release is allowed
command after pause_push.
So, start or stop after pause in compress offload is always
returned as error if the compress offload is used with dpcm.
To fix the problem, SND_SOC_DPCM_STATE_PAUSED should be allowed
for start or stop command.

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/004d01d607c1$7a3d5250$6eb7f6f0$@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-pcm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index e256d438ee68..289aebc15529 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2324,7 +2324,8 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
 		switch (cmd) {
 		case SNDRV_PCM_TRIGGER_START:
 			if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) &&
-			    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP))
+			    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) &&
+			    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED))
 				continue;
 
 			ret = dpcm_do_trigger(dpcm, be_substream, cmd);
@@ -2354,7 +2355,8 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
 			be->dpcm[stream].state = SND_SOC_DPCM_STATE_START;
 			break;
 		case SNDRV_PCM_TRIGGER_STOP:
-			if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START)
+			if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) &&
+			    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED))
 				continue;
 
 			if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream))
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-01 11:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200401010421epcas2p3d5b16041fa59efa0ac8786f682d4c991@epcas2p3.samsung.com>
2020-04-01  1:04 ` [PATCH] ASoC: dpcm: allow start or stop during pause for backend 이경택
2020-04-01  5:06   ` Vinod Koul
2020-04-01 11:06   ` Applied "ASoC: dpcm: allow start or stop during pause for backend" to the asoc tree Mark Brown

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).