linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: cs42xx8: Remove S32_LE in format list
@ 2019-02-28  5:56 S.j. Wang
  2019-02-28 14:33 ` Timur Tabi
  2019-03-01  4:50 ` Nicolin Chen
  0 siblings, 2 replies; 8+ messages in thread
From: S.j. Wang @ 2019-02-28  5:56 UTC (permalink / raw)
  To: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com,
	festevam@gmail.com, broonie@kernel.org,
	alsa-devel@alsa-project.org
  Cc: linuxppc-dev@lists.ozlabs.org

cs42xx8 is a 24-bit A/D and 24-bit D/A device, so the S32_LE
should not be in the supported format list.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/codecs/cs42xx8.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c
index ebb9e0cf8364..271972337d23 100644
--- a/sound/soc/codecs/cs42xx8.c
+++ b/sound/soc/codecs/cs42xx8.c
@@ -32,8 +32,7 @@
 
 #define CS42XX8_FORMATS	(SNDRV_PCM_FMTBIT_S16_LE | \
 			 SNDRV_PCM_FMTBIT_S20_3LE | \
-			 SNDRV_PCM_FMTBIT_S24_LE | \
-			 SNDRV_PCM_FMTBIT_S32_LE)
+			 SNDRV_PCM_FMTBIT_S24_LE)
 
 /* codec private data */
 struct cs42xx8_priv {
-- 
1.9.1


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

* Re: [PATCH] ASoC: cs42xx8: Remove S32_LE in format list
  2019-02-28  5:56 [PATCH] ASoC: cs42xx8: Remove S32_LE in format list S.j. Wang
@ 2019-02-28 14:33 ` Timur Tabi
  2019-03-01  3:45   ` S.j. Wang
  2019-03-01  4:50 ` Nicolin Chen
  1 sibling, 1 reply; 8+ messages in thread
From: Timur Tabi @ 2019-02-28 14:33 UTC (permalink / raw)
  To: S.j. Wang, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com,
	festevam@gmail.com, broonie@kernel.org,
	alsa-devel@alsa-project.org
  Cc: linuxppc-dev@lists.ozlabs.org

On 2/27/19 11:56 PM, S.j. Wang wrote:
> cs42xx8 is a 24-bit A/D and 24-bit D/A device, so the S32_LE
> should not be in the supported format list.
> 
> Signed-off-by: Shengjiu Wang<shengjiu.wang@nxp.com>

Is the device capable of accepting 32-bit samples, even if it downgrades 
it to 24-bit internally?  If so, then maybe SNDRV_PCM_FMTBIT_S32_LE 
should stay.


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

* RE: [PATCH] ASoC: cs42xx8: Remove S32_LE in format list
  2019-02-28 14:33 ` Timur Tabi
@ 2019-03-01  3:45   ` S.j. Wang
  0 siblings, 0 replies; 8+ messages in thread
From: S.j. Wang @ 2019-03-01  3:45 UTC (permalink / raw)
  To: Timur Tabi, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com,
	festevam@gmail.com, broonie@kernel.org,
	alsa-devel@alsa-project.org
  Cc: linuxppc-dev@lists.ozlabs.org

Hi

> > cs42xx8 is a 24-bit A/D and 24-bit D/A device, so the S32_LE should
> > not be in the supported format list.
> >
> > Signed-off-by: Shengjiu Wang<shengjiu.wang@nxp.com>
> 
> Is the device capable of accepting 32-bit samples, even if it downgrades it to
> 24-bit internally?  If so, then maybe SNDRV_PCM_FMTBIT_S32_LE should
> stay.
Yes,  the S32_LE can be accepted by device, it seems like that the device only
Use the upper 24bit, so the S32_LE result is same as S24_LE,  do you think the
S32_LE should be remained?

Best regards
Wang shengjiu



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

* Re: [PATCH] ASoC: cs42xx8: Remove S32_LE in format list
  2019-02-28  5:56 [PATCH] ASoC: cs42xx8: Remove S32_LE in format list S.j. Wang
  2019-02-28 14:33 ` Timur Tabi
@ 2019-03-01  4:50 ` Nicolin Chen
  2019-03-01  5:04   ` [alsa-devel] " Matt Flax
  1 sibling, 1 reply; 8+ messages in thread
From: Nicolin Chen @ 2019-03-01  4:50 UTC (permalink / raw)
  To: S.j. Wang
  Cc: alsa-devel@alsa-project.org, timur@kernel.org,
	Xiubo.Lee@gmail.com, festevam@gmail.com, broonie@kernel.org,
	linuxppc-dev@lists.ozlabs.org

Hi Shengjiu,

On Thu, Feb 28, 2019 at 05:56:31AM +0000, S.j. Wang wrote:
> cs42xx8 is a 24-bit A/D and 24-bit D/A device, so the S32_LE
> should not be in the supported format list.
> 
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> ---
>  sound/soc/codecs/cs42xx8.c | 3 +--

This is for cs42xx8 codec driver, but its maintainers aren't
seemly in To/Cc list. Please run ./scripts/get_maintainer.pl
for it and resend.

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

* Re: [alsa-devel] [PATCH] ASoC: cs42xx8: Remove S32_LE in format list
  2019-03-01  4:50 ` Nicolin Chen
@ 2019-03-01  5:04   ` Matt Flax
  2019-03-01  6:32     ` S.j. Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Matt Flax @ 2019-03-01  5:04 UTC (permalink / raw)
  To: Nicolin Chen, S.j. Wang
  Cc: alsa-devel@alsa-project.org, timur@kernel.org,
	Xiubo.Lee@gmail.com, festevam@gmail.com, broonie@kernel.org,
	linuxppc-dev@lists.ozlabs.org

It would be a mistake to remove S32_LE from the format list.

If you removed that, then we wouldn't be able to do 32 bit native 
playback - it would force users to go through an ALSA plugin.

If you look at the cs42448 data sheet for example, the I2S and TDM bus 
uses a 32 bit word size. For that reason, native S32_LE format is 
handled by the codec. While the codec only uses the 24 MSBs, the I2S bus 
is 32 bit.

Matt

On 1/3/19 3:50 pm, Nicolin Chen wrote:
> Hi Shengjiu,
>
> On Thu, Feb 28, 2019 at 05:56:31AM +0000, S.j. Wang wrote:
>> cs42xx8 is a 24-bit A/D and 24-bit D/A device, so the S32_LE
>> should not be in the supported format list.
>>
>> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
>> ---
>>   sound/soc/codecs/cs42xx8.c | 3 +--
> This is for cs42xx8 codec driver, but its maintainers aren't
> seemly in To/Cc list. Please run ./scripts/get_maintainer.pl
> for it and resend.
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* RE: [alsa-devel] [PATCH] ASoC: cs42xx8: Remove S32_LE in format list
  2019-03-01  5:04   ` [alsa-devel] " Matt Flax
@ 2019-03-01  6:32     ` S.j. Wang
  2019-03-01 14:32       ` Timur Tabi
  0 siblings, 1 reply; 8+ messages in thread
From: S.j. Wang @ 2019-03-01  6:32 UTC (permalink / raw)
  To: Matt Flax, Nicolin Chen
  Cc: alsa-devel@alsa-project.org, timur@kernel.org,
	Xiubo.Lee@gmail.com, festevam@gmail.com, broonie@kernel.org,
	linuxppc-dev@lists.ozlabs.org



> 
> It would be a mistake to remove S32_LE from the format list.
> 
> If you removed that, then we wouldn't be able to do 32 bit native playback
> - it would force users to go through an ALSA plugin.
> 
> If you look at the cs42448 data sheet for example, the I2S and TDM bus
> uses a 32 bit word size. For that reason, native S32_LE format is handled by
> the codec. While the codec only uses the 24 MSBs, the I2S bus is 32 bit.

This case is covered by S24_LE I think.  The S32_LE means the data is 32bit and slot width
Is 32bit, this is not in data sheet.

Best regards
Wang shengjiu
> 
> Matt
> 
> On 1/3/19 3:50 pm, Nicolin Chen wrote:
> > Hi Shengjiu,
> >
> > On Thu, Feb 28, 2019 at 05:56:31AM +0000, S.j. Wang wrote:
> >> cs42xx8 is a 24-bit A/D and 24-bit D/A device, so the S32_LE should
> >> not be in the supported format list.
> >>
> >> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> >> ---
> >>   sound/soc/codecs/cs42xx8.c | 3 +--
> > This is for cs42xx8 codec driver, but its maintainers aren't seemly in
> > To/Cc list. Please run ./scripts/get_maintainer.pl for it and resend.
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel@alsa-project.org
> >
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fma
> i
> > lman.alsa-project.org%2Fmailman%2Flistinfo%2Falsa-
> devel&amp;data=02%7C
> >
> 01%7Cshengjiu.wang%40nxp.com%7Ce5686d72bd7843c5962508d69e0370a4
> %7C686e
> >
> a1d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C636870134975623123&amp;
> sdata=Rr
> >
> YwfC4Y3xssED%2FzRum%2FXABGJTHvRrYwnRNgUL7u2lU%3D&amp;reserved
> =0

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

* Re: [alsa-devel] [PATCH] ASoC: cs42xx8: Remove S32_LE in format list
  2019-03-01  6:32     ` S.j. Wang
@ 2019-03-01 14:32       ` Timur Tabi
  2019-03-02  5:42         ` S.j. Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Timur Tabi @ 2019-03-01 14:32 UTC (permalink / raw)
  To: S.j. Wang, Matt Flax, Nicolin Chen
  Cc: linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org,
	broonie@kernel.org, festevam@gmail.com, Xiubo.Lee@gmail.com

On 3/1/19 12:32 AM, S.j. Wang wrote:
> This case is covered by S24_LE I think.  The S32_LE means the data is 32bit and slot width
> Is 32bit, this is not in data sheet.

The problem is that if you have 32-bit samples in your audio file, and 
you want to play them, then software (e.g. alsalib) will need to convert 
the audio to 24-bit before sending it to hardware.  This is unnecessary 
because the hardware can "convert" the sample to 24-bit automatically by 
ignoring the lower 8 bits.

I think a lot of codecs do this already.

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

* RE: [alsa-devel] [PATCH] ASoC: cs42xx8: Remove S32_LE in format list
  2019-03-01 14:32       ` Timur Tabi
@ 2019-03-02  5:42         ` S.j. Wang
  0 siblings, 0 replies; 8+ messages in thread
From: S.j. Wang @ 2019-03-02  5:42 UTC (permalink / raw)
  To: Timur Tabi, Matt Flax, Nicolin Chen
  Cc: linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org,
	broonie@kernel.org, festevam@gmail.com, Xiubo.Lee@gmail.com

Hi

> On 3/1/19 12:32 AM, S.j. Wang wrote:
> > This case is covered by S24_LE I think.  The S32_LE means the data is
> > 32bit and slot width Is 32bit, this is not in data sheet.
> 
> The problem is that if you have 32-bit samples in your audio file, and you
> want to play them, then software (e.g. alsalib) will need to convert the
> audio to 24-bit before sending it to hardware.  This is unnecessary because
> the hardware can "convert" the sample to 24-bit automatically by ignoring
> the lower 8 bits.
> 
> I think a lot of codecs do this already.

Ok. Thanks for reviewing, I will drop this patch.

Best regards
Wang shengjiu

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

end of thread, other threads:[~2019-03-02  5:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-28  5:56 [PATCH] ASoC: cs42xx8: Remove S32_LE in format list S.j. Wang
2019-02-28 14:33 ` Timur Tabi
2019-03-01  3:45   ` S.j. Wang
2019-03-01  4:50 ` Nicolin Chen
2019-03-01  5:04   ` [alsa-devel] " Matt Flax
2019-03-01  6:32     ` S.j. Wang
2019-03-01 14:32       ` Timur Tabi
2019-03-02  5:42         ` S.j. Wang

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