All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: compress: Derive substream from stream based on direction
@ 2017-06-17  0:33 bgoswami
  2017-06-19 12:42 ` Vinod Koul
  2017-06-19 16:23   ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: bgoswami @ 2017-06-17  0:33 UTC (permalink / raw)
  To: broonie
  Cc: vinod.koul, alsa-devel, Banajit Goswami, plai,
	Satish Babu Patakokila

From: Satish Babu Patakokila <sbpata@codeaurora.org> 

Currently compress driver hardcodes direction as playback to get
substream from the stream. This results in getting the incorrect
substream for compressed capture usecase.
To fix this, remove the hardcoding and derive substream based on
the stream direction.

Signed-off-by: Satish Babu Patakokila <sbpata@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
---
 sound/soc/soc-compress.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index bfd71b8..206f36b 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -81,7 +81,8 @@ static int soc_compr_open(struct snd_compr_stream *cstream)
 static int soc_compr_open_fe(struct snd_compr_stream *cstream)
 {
 	struct snd_soc_pcm_runtime *fe = cstream->private_data;
-	struct snd_pcm_substream *fe_substream = fe->pcm->streams[0].substream;
+	struct snd_pcm_substream *fe_substream =
+		 fe->pcm->streams[cstream->direction].substream;
 	struct snd_soc_platform *platform = fe->platform;
 	struct snd_soc_dai *cpu_dai = fe->cpu_dai;
 	struct snd_soc_dpcm *dpcm;
@@ -467,7 +468,8 @@ static int soc_compr_set_params_fe(struct snd_compr_stream *cstream,
 					struct snd_compr_params *params)
 {
 	struct snd_soc_pcm_runtime *fe = cstream->private_data;
-	struct snd_pcm_substream *fe_substream = fe->pcm->streams[0].substream;
+	struct snd_pcm_substream *fe_substream =
+		 fe->pcm->streams[cstream->direction].substream;
 	struct snd_soc_platform *platform = fe->platform;
 	struct snd_soc_dai *cpu_dai = fe->cpu_dai;
 	int ret = 0, stream;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH] ASoC: compress: Derive substream from stream based on direction
  2017-06-17  0:33 [PATCH] ASoC: compress: Derive substream from stream based on direction bgoswami
@ 2017-06-19 12:42 ` Vinod Koul
  2017-06-19 16:23   ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2017-06-19 12:42 UTC (permalink / raw)
  To: bgoswami; +Cc: alsa-devel, broonie, plai, Satish Babu Patakokila

On Fri, Jun 16, 2017 at 05:33:40PM -0700, bgoswami@codeaurora.org wrote:
> From: Satish Babu Patakokila <sbpata@codeaurora.org> 
> 
> Currently compress driver hardcodes direction as playback to get
> substream from the stream. This results in getting the incorrect
> substream for compressed capture usecase.
> To fix this, remove the hardcoding and derive substream based on
> the stream direction.

Acked-By: Vinod Koul <vinod.koul@intel.com>

I think we should cc this to stable..

> 
> Signed-off-by: Satish Babu Patakokila <sbpata@codeaurora.org>
> Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
> ---
>  sound/soc/soc-compress.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
> index bfd71b8..206f36b 100644
> --- a/sound/soc/soc-compress.c
> +++ b/sound/soc/soc-compress.c
> @@ -81,7 +81,8 @@ static int soc_compr_open(struct snd_compr_stream *cstream)
>  static int soc_compr_open_fe(struct snd_compr_stream *cstream)
>  {
>  	struct snd_soc_pcm_runtime *fe = cstream->private_data;
> -	struct snd_pcm_substream *fe_substream = fe->pcm->streams[0].substream;
> +	struct snd_pcm_substream *fe_substream =
> +		 fe->pcm->streams[cstream->direction].substream;
>  	struct snd_soc_platform *platform = fe->platform;
>  	struct snd_soc_dai *cpu_dai = fe->cpu_dai;
>  	struct snd_soc_dpcm *dpcm;
> @@ -467,7 +468,8 @@ static int soc_compr_set_params_fe(struct snd_compr_stream *cstream,
>  					struct snd_compr_params *params)
>  {
>  	struct snd_soc_pcm_runtime *fe = cstream->private_data;
> -	struct snd_pcm_substream *fe_substream = fe->pcm->streams[0].substream;
> +	struct snd_pcm_substream *fe_substream =
> +		 fe->pcm->streams[cstream->direction].substream;
>  	struct snd_soc_platform *platform = fe->platform;
>  	struct snd_soc_dai *cpu_dai = fe->cpu_dai;
>  	int ret = 0, stream;
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

-- 
~Vinod

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

* Applied "ASoC: compress: Derive substream from stream based on direction" to the asoc tree
  2017-06-17  0:33 [PATCH] ASoC: compress: Derive substream from stream based on direction bgoswami
@ 2017-06-19 16:23   ` Mark Brown
  2017-06-19 16:23   ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2017-06-19 16:23 UTC (permalink / raw)
  To: Satish Babu Patakokila; +Cc: Banajit Goswami, Mark Brown, stable

The patch

   ASoC: compress: Derive substream from stream based on direction

has been applied to the asoc tree at

   git://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 01b8cedfd0422326caae308641dcadaa85e0ca72 Mon Sep 17 00:00:00 2001
From: Satish Babu Patakokila <sbpata@codeaurora.org>
Date: Fri, 16 Jun 2017 17:33:40 -0700
Subject: [PATCH] ASoC: compress: Derive substream from stream based on
 direction

Currently compress driver hardcodes direction as playback to get
substream from the stream. This results in getting the incorrect
substream for compressed capture usecase.
To fix this, remove the hardcoding and derive substream based on
the stream direction.

Signed-off-by: Satish Babu Patakokila <sbpata@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
---
 sound/soc/soc-compress.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index bfd71b873ca2..206f36bf43e8 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -81,7 +81,8 @@ static int soc_compr_open(struct snd_compr_stream *cstream)
 static int soc_compr_open_fe(struct snd_compr_stream *cstream)
 {
 	struct snd_soc_pcm_runtime *fe = cstream->private_data;
-	struct snd_pcm_substream *fe_substream = fe->pcm->streams[0].substream;
+	struct snd_pcm_substream *fe_substream =
+		 fe->pcm->streams[cstream->direction].substream;
 	struct snd_soc_platform *platform = fe->platform;
 	struct snd_soc_dai *cpu_dai = fe->cpu_dai;
 	struct snd_soc_dpcm *dpcm;
@@ -467,7 +468,8 @@ static int soc_compr_set_params_fe(struct snd_compr_stream *cstream,
 					struct snd_compr_params *params)
 {
 	struct snd_soc_pcm_runtime *fe = cstream->private_data;
-	struct snd_pcm_substream *fe_substream = fe->pcm->streams[0].substream;
+	struct snd_pcm_substream *fe_substream =
+		 fe->pcm->streams[cstream->direction].substream;
 	struct snd_soc_platform *platform = fe->platform;
 	struct snd_soc_dai *cpu_dai = fe->cpu_dai;
 	int ret = 0, stream;
-- 
2.11.0

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

* Applied "ASoC: compress: Derive substream from stream based on direction" to the asoc tree
@ 2017-06-19 16:23   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2017-06-19 16:23 UTC (permalink / raw)
  To: Satish Babu Patakokila
  Cc: Banajit Goswami, Mark Brown, stable, broonie, vinod.koul,
	alsa-devel, Banajit Goswami, plai, alsa-devel

The patch

   ASoC: compress: Derive substream from stream based on direction

has been applied to the asoc tree at

   git://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 01b8cedfd0422326caae308641dcadaa85e0ca72 Mon Sep 17 00:00:00 2001
From: Satish Babu Patakokila <sbpata@codeaurora.org>
Date: Fri, 16 Jun 2017 17:33:40 -0700
Subject: [PATCH] ASoC: compress: Derive substream from stream based on
 direction

Currently compress driver hardcodes direction as playback to get
substream from the stream. This results in getting the incorrect
substream for compressed capture usecase.
To fix this, remove the hardcoding and derive substream based on
the stream direction.

Signed-off-by: Satish Babu Patakokila <sbpata@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
---
 sound/soc/soc-compress.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index bfd71b873ca2..206f36bf43e8 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -81,7 +81,8 @@ static int soc_compr_open(struct snd_compr_stream *cstream)
 static int soc_compr_open_fe(struct snd_compr_stream *cstream)
 {
 	struct snd_soc_pcm_runtime *fe = cstream->private_data;
-	struct snd_pcm_substream *fe_substream = fe->pcm->streams[0].substream;
+	struct snd_pcm_substream *fe_substream =
+		 fe->pcm->streams[cstream->direction].substream;
 	struct snd_soc_platform *platform = fe->platform;
 	struct snd_soc_dai *cpu_dai = fe->cpu_dai;
 	struct snd_soc_dpcm *dpcm;
@@ -467,7 +468,8 @@ static int soc_compr_set_params_fe(struct snd_compr_stream *cstream,
 					struct snd_compr_params *params)
 {
 	struct snd_soc_pcm_runtime *fe = cstream->private_data;
-	struct snd_pcm_substream *fe_substream = fe->pcm->streams[0].substream;
+	struct snd_pcm_substream *fe_substream =
+		 fe->pcm->streams[cstream->direction].substream;
 	struct snd_soc_platform *platform = fe->platform;
 	struct snd_soc_dai *cpu_dai = fe->cpu_dai;
 	int ret = 0, stream;
-- 
2.11.0

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

end of thread, other threads:[~2017-06-19 16:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-17  0:33 [PATCH] ASoC: compress: Derive substream from stream based on direction bgoswami
2017-06-19 12:42 ` Vinod Koul
2017-06-19 16:23 ` Applied "ASoC: compress: Derive substream from stream based on direction" to the asoc tree Mark Brown
2017-06-19 16:23   ` Mark Brown

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.