alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "ASoC: rockchip: i2s: Support mono capture"
@ 2019-07-26  4:42 Cheng-Yi Chiang
  2019-07-26 11:17 ` Mark Brown
  2019-07-26 12:12 ` Applied "ASoC: rockchip: Fix mono capture" to the asoc tree Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Cheng-Yi Chiang @ 2019-07-26  4:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: alsa-devel, dianders, Heiko Stuebner, Liam Girdwood,
	Takashi Iwai, tzungbi, Jaroslav Kysela, linux-rockchip,
	Mark Brown, dgreid, mka, linux-arm-kernel, Cheng-Yi Chiang

This reverts commit db51707b9c9aeedd310ebce60f15d5bb006567e0.

Previous discussion in

https://patchwork.kernel.org/patch/10147153/

explains the issue of the patch.
While device is configured as 1-ch, hardware is still
generating a 2-ch stream.
When user space reads the data and assumes it is a 1-ch stream,
the rate will be slower by 2x.

Revert the change so 1-ch is not supported.
User space can selectively take one channel data out of two channel
if 1-ch is preferred.
Currently, both channels record identical data.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
---
 sound/soc/rockchip/rockchip_i2s.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index 0a34d0eb8dba..88ebaf6e1880 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -326,7 +326,6 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream,
 		val |= I2S_CHN_4;
 		break;
 	case 2:
-	case 1:
 		val |= I2S_CHN_2;
 		break;
 	default:
@@ -459,7 +458,7 @@ static struct snd_soc_dai_driver rockchip_i2s_dai = {
 	},
 	.capture = {
 		.stream_name = "Capture",
-		.channels_min = 1,
+		.channels_min = 2,
 		.channels_max = 2,
 		.rates = SNDRV_PCM_RATE_8000_192000,
 		.formats = (SNDRV_PCM_FMTBIT_S8 |
@@ -659,7 +658,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
 	}
 
 	if (!of_property_read_u32(node, "rockchip,capture-channels", &val)) {
-		if (val >= 1 && val <= 8)
+		if (val >= 2 && val <= 8)
 			soc_dai->capture.channels_max = val;
 	}
 
-- 
2.22.0.709.g102302147b-goog

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

* Re: [PATCH] Revert "ASoC: rockchip: i2s: Support mono capture"
  2019-07-26  4:42 [PATCH] Revert "ASoC: rockchip: i2s: Support mono capture" Cheng-Yi Chiang
@ 2019-07-26 11:17 ` Mark Brown
  2019-07-26 12:10   ` Cheng-yi Chiang
  2019-07-26 12:12 ` Applied "ASoC: rockchip: Fix mono capture" to the asoc tree Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2019-07-26 11:17 UTC (permalink / raw)
  To: Cheng-Yi Chiang
  Cc: alsa-devel, tzungbi, Heiko Stuebner, linux-kernel, Takashi Iwai,
	dianders, Liam Girdwood, linux-rockchip, mka, dgreid,
	Jaroslav Kysela, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 682 bytes --]

On Fri, Jul 26, 2019 at 12:42:02PM +0800, Cheng-Yi Chiang wrote:
> This reverts commit db51707b9c9aeedd310ebce60f15d5bb006567e0.
> 
> Previous discussion in

Please use subject lines matching the style for the subsystem.  This
makes it easier for people to identify relevant patches.

Please include human readable descriptions of things like commits and
issues being discussed in e-mail in your mails, this makes them much
easier for humans to read especially when they have no internet access.
I do frequently catch up on my mail on flights or while otherwise
travelling so this is even more pressing for me than just being about
making things a bit easier to read.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] Revert "ASoC: rockchip: i2s: Support mono capture"
  2019-07-26 11:17 ` Mark Brown
@ 2019-07-26 12:10   ` Cheng-yi Chiang
  0 siblings, 0 replies; 4+ messages in thread
From: Cheng-yi Chiang @ 2019-07-26 12:10 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel, Takashi Iwai, Liam Girdwood, Jaroslav Kysela,
	Heiko Stuebner, Doug Anderson, Dylan Reid, tzungbi,
	Matthias Kaehlcke,
	moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	linux-arm-kernel, linux-rockchip

On Fri, Jul 26, 2019 at 7:17 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Fri, Jul 26, 2019 at 12:42:02PM +0800, Cheng-Yi Chiang wrote:
> > This reverts commit db51707b9c9aeedd310ebce60f15d5bb006567e0.
> >
> > Previous discussion in
>
> Please use subject lines matching the style for the subsystem.  This
> makes it easier for people to identify relevant patches.
>
>
> Please include human readable descriptions of things like commits and
> issues being discussed in e-mail in your mails, this makes them much
> easier for humans to read especially when they have no internet access.
> I do frequently catch up on my mail on flights or while otherwise
> travelling so this is even more pressing for me than just being about
> making things a bit easier to read.
Hi Mark,
Thank you for the reply.
Fixed the title and commit messages in v2.

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

* Applied "ASoC: rockchip: Fix mono capture" to the asoc tree
  2019-07-26  4:42 [PATCH] Revert "ASoC: rockchip: i2s: Support mono capture" Cheng-Yi Chiang
  2019-07-26 11:17 ` Mark Brown
@ 2019-07-26 12:12 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2019-07-26 12:12 UTC (permalink / raw)
  To: Cheng-Yi Chiang
  Cc: alsa-devel, dgreid, dianders, Heiko Stuebner, Jaroslav Kysela,
	Liam Girdwood, linux-arm-kernel, linux-kernel, linux-rockchip,
	Mark Brown, mka, Takashi Iwai, tzungbi

The patch

   ASoC: rockchip: Fix mono capture

has been applied to the asoc tree at

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

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 789e162a6255325325bd321ab0cd51dc7e285054 Mon Sep 17 00:00:00 2001
From: Cheng-Yi Chiang <cychiang@chromium.org>
Date: Fri, 26 Jul 2019 12:42:02 +0800
Subject: [PATCH] ASoC: rockchip: Fix mono capture

This reverts commit db51707b9c9aeedd310ebce60f15d5bb006567e0.
Revert "ASoC: rockchip: i2s: Support mono capture"

Previous discussion in

https://patchwork.kernel.org/patch/10147153/

explains the issue of the patch.
While device is configured as 1-ch, hardware is still
generating a 2-ch stream.
When user space reads the data and assumes it is a 1-ch stream,
the rate will be slower by 2x.

Revert the change so 1-ch is not supported.
User space can selectively take one channel data out of two channel
if 1-ch is preferred.
Currently, both channels record identical data.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Link: https://lore.kernel.org/r/20190726044202.26866-1-cychiang@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/rockchip/rockchip_i2s.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index 0a34d0eb8dba..88ebaf6e1880 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -326,7 +326,6 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream,
 		val |= I2S_CHN_4;
 		break;
 	case 2:
-	case 1:
 		val |= I2S_CHN_2;
 		break;
 	default:
@@ -459,7 +458,7 @@ static struct snd_soc_dai_driver rockchip_i2s_dai = {
 	},
 	.capture = {
 		.stream_name = "Capture",
-		.channels_min = 1,
+		.channels_min = 2,
 		.channels_max = 2,
 		.rates = SNDRV_PCM_RATE_8000_192000,
 		.formats = (SNDRV_PCM_FMTBIT_S8 |
@@ -659,7 +658,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
 	}
 
 	if (!of_property_read_u32(node, "rockchip,capture-channels", &val)) {
-		if (val >= 1 && val <= 8)
+		if (val >= 2 && val <= 8)
 			soc_dai->capture.channels_max = val;
 	}
 
-- 
2.20.1

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

end of thread, other threads:[~2019-07-26 12:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-26  4:42 [PATCH] Revert "ASoC: rockchip: i2s: Support mono capture" Cheng-Yi Chiang
2019-07-26 11:17 ` Mark Brown
2019-07-26 12:10   ` Cheng-yi Chiang
2019-07-26 12:12 ` Applied "ASoC: rockchip: Fix mono capture" 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).