From: Jiebing Chen <jiebing.chen@amlogic.com>
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: jiebing chen via B4 Relay
<devnull+jiebing.chen.amlogic.com@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org
Subject: Re: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
Date: Wed, 15 Jan 2025 20:09:10 +0800 [thread overview]
Message-ID: <b3b60ec4-ae88-4110-9839-449ee7477d9b@amlogic.com> (raw)
In-Reply-To: <af4fde1c-281b-4826-a52c-a4e14727eb67@amlogic.com>
在 2025/1/15 19:47, Jiebing Chen 写道:
>
> 在 2025/1/15 18:36, Jiebing Chen 写道:
>>
>> 在 2025/1/15 16:36, Jerome Brunet 写道:
>>> [ EXTERNAL EMAIL ]
>>>
>>> On Wed 15 Jan 2025 at 10:56, Jiebing Chen <jiebing.chen@amlogic.com>
>>> wrote:
>>>
>>>> 在 2025/1/14 22:05, Jerome Brunet 写道:
>>>>> [ EXTERNAL EMAIL ]
>>>>>
>>>>> On Tue 14 Jan 2025 at 19:20, Jiebing Chen
>>>>> <jiebing.chen@amlogic.com> wrote:
>>>>>
>>>>>>>>> +
>>>>>>>>> +MODULE_DESCRIPTION("Amlogic to codec driver");
>>>>>>>>> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
>>>>>>>>> +MODULE_LICENSE("GPL");
>>>>>>>>> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
>>>>>>>>> index
>>>>>>>>> 571f65788c592050abdca264f5656d4d1a9d99f6..2db1cd18cf2cea507f3d7282054e03d953586648
>>>>>>>>>
>>>>>>>>> 100644
>>>>>>>>> --- a/sound/soc/meson/t9015.c
>>>>>>>>> +++ b/sound/soc/meson/t9015.c
>>>>>>>>> @@ -89,10 +89,7 @@ static struct snd_soc_dai_driver t9015_dai = {
>>>>>>>>> .channels_min = 1,
>>>>>>>>> .channels_max = 2,
>>>>>>>>> .rates = SNDRV_PCM_RATE_8000_96000,
>>>>>>>>> - .formats = (SNDRV_PCM_FMTBIT_S8 |
>>>>>>>>> - SNDRV_PCM_FMTBIT_S16_LE |
>>>>>>>>> - SNDRV_PCM_FMTBIT_S20_LE |
>>>>>>>>> - SNDRV_PCM_FMTBIT_S24_LE),
>>>>>>>>> + .formats = (SNDRV_PCM_FMTBIT_S16_LE |
>>>>>>>>> SNDRV_PCM_FMTBIT_S32_LE),
>>>>>>>> Again, mixed up changes with zero justification.
>>>>>>>>
>>>>>>>> This drops S8 and S16 format support for the existing SoCs
>>>>>>>> (such as GXL)
>>>>>>>> which is known to work and add S32 support on an HW documented
>>>>>>>> as 24bits
>>>>>>>> only. Can you explain ?
>>>>>> for g12a, sm1 etc, it is use new audio ip, GXL is old ip,
>>>>> If there are chips difference we did not know about, then you should
>>>>> introduce those difference, without breaking existing support -
>>>>> including for GXL, which is what you did IIUC.
>>>>>
>>>>>> the new ip not support 24 bit,
>>>>> Are sure about that ? that code has been there for a while.
>>>>>
>>>>> If sm1 does not support SNDRV_PCM_FMTBIT_S24_LE, you should a fix
>>>>> up patch for
>>>>> that, with the proper "Fixes:" tag, how to reproduce the problem and
>>>>> explaining the fix.
At first I thought you said 24bit is s24_3le, becasue of the fddr can't
get it,
so spend a lot of time trying to explain it
I think it may be because of this difference that we are not focused on
the same problem
yes, we support s24_le, the internal codec also process it 24 bit of 32
bit,
if we send valid 32bit data, it only process 24bit, discard 8 bit data,
if this behavior should be prohibit
we will follow this rule
>>>> maybe there are some gap , we support SNDRV_PCM_FMTBIT_S24, not
>>>> support the
>>>>
>>>> SNDRV_PCM_FMTBIT_S24_3LE, for SNDRV_PCM_FMTBIT_S24
>>>>
>>>> it is Signed, 24-bit (32-bit in memory), little endian , the audio
>>>> dma
>>>> busrt is 64bit
>>> It makes absolutely no sense to discuss memory layout for the codec.
>>>
>>>> it can get the full data. we send the 32 bit data mclk = 32bit*
>>>> 48k *4,
>>>> use the clk to send
>>>>
>>>> the SNDRV_PCM_FMTBIT_S24, the hadware always send the 32bit data
>>> No it does not. It send 24 bits of data over a 32 bits physical word
>>> with
>>> 8 bits ignored.
>>
>> The original intention, we play 32bit data from tdmout, it play
>> error, so we add the s32_le
>>
>> for tdmouta ,it can bind Multiple codec, one codec is the internal
>> codec,
>>
>> other is external codec, tdmout can send the data to internal codec
>> and external codec from the output pad
>>
>> for example, tdmout send 4 ch, 2 ch is send the internal codec, 2 ch
>> send the data pad
>>
>> it aplay error, due to the internal codec fomat parameter limiting
>> condition
>>
>> There is a contradiction here, Considering our internal codec can
>> process this it, drop 8bit, 24bit valid
>>
>> therefore software can set s24_le/s32_le, still work ok for
>> hardware, so Multiple ch can support for internal codec and external
>> codec
>>
>>
> add the s32_le format for the t9015.c, it can resovle Multiple codec
> s32_le format case, although hardware only process 24bit of 32bit,
> but it can't affect the acodec hardware work, it still work fine
>
> usually we add the s32_le format support, if not allow to do it, think
> of it as a limitation, we can remove 32bit test for it
>
>>>
>>>> so, i think we only add the SNDRV_PCM_FMTBIT_S32 base on it
>>> That's wrong if the codec does not actually use the full 32bits ... and
>>> I have clear indication that's what the codec is doing, on GXL at
>>> least.
>>>
>>>> we think the 24 bit is the SNDRV_PCM_FMTBIT_S24_3LE, it is 24bit in
>>>> memroy,
>>>>
>>>> due to the dma busrt 64 bit limit, it can't align the sample bit,
>>>> if it is
>>>> 24 bit
>>> Again, memory layout makes no sense here.
>>>
>>>> so the clock configure can't 24bit clock,
>>> I disagree and this has been tested. If you have a test case showing
>>> otherwise please share it.
>>>
>>>> by the way, We discuss internally for gxl,
>>>>
>>>> it also support the SNDRV_PCM_FMTBIT_S32
>>>>
>>> Does it really ? If it is just to ignore the 8bits LSB, that not a
>>> support.
>>>
>>>>>> usually support 16/32 bit for new audio ip , for
>>>>>> SNDRV_PCM_FMTBIT_S24_LE,
>>>>>> it width =24, phy =32
>>>>> Yes physical of SNDRV_PCM_FMTBIT_S24_LE, so most chip supporting
>>>>> 32 bits
>>>>> width would support this S24_LE, unless there is something odd.
>>>>>
>>>>>> it was treated as 32 bit to send for tdm, so we can only add the
>>>>>> S32LE
>>>>>> base on it , right ?
>>>>> You are asking me ? How am I suppose to know ?
>>>>>
>>>>>> but if the gxl not support the 32bit
>>>>> I don't see a problem with a DAC taking input on 32bits physical
>>>>> interface and ignoring some bit on processing.
>>>>>
>>>>> If that's not the case, please send a proper fix change with some
>>>>> explanation
>>>>>
>>>>>> we need add new snd_soc_dai_driver t9015_dai_s4 ?
>>>>>>
>>>>> If I understood correctly format depends on the chip and needs to
>>>>> adjusted including for sm1.
>>>>>
>>>>>>>>> },
>>>>>>>>> .ops = &t9015_dai_ops,
>>>>>>>>> };
>>>>>>>> -- Jerome
>>>>> --
>>>>> Jerome
>>> --
>>> Jerome
next prev parent reply other threads:[~2025-01-15 12:09 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-13 6:35 [PATCH 0/3] Add support for S4 audio jiebing chen via B4 Relay
2025-01-13 6:35 ` [PATCH 1/3] ASoC: dt-bindings: Add Amlogic " jiebing chen via B4 Relay
2025-01-13 7:19 ` Rob Herring (Arm)
2025-01-13 6:35 ` [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio jiebing chen via B4 Relay
2025-01-13 14:31 ` Jerome Brunet
2025-01-14 8:16 ` Jiebing Chen
2025-01-14 11:20 ` Jiebing Chen
2025-01-14 14:05 ` Jerome Brunet
2025-01-15 2:56 ` Jiebing Chen
2025-01-15 8:36 ` Jerome Brunet
2025-01-15 10:36 ` Jiebing Chen
2025-01-15 11:47 ` Jiebing Chen
2025-01-15 12:09 ` Jiebing Chen [this message]
2025-01-14 11:29 ` Jerome Brunet
2025-01-14 12:41 ` Jiebing Chen
2025-01-14 9:09 ` kernel test robot
2025-01-13 6:35 ` [PATCH 3/3] arm64: dts: amlogic: Add Amlogic S4 Audio jiebing chen via B4 Relay
2025-01-13 14:50 ` Jerome Brunet
2025-01-14 8:52 ` Jiebing Chen
2025-01-14 11:16 ` Jerome Brunet
2025-01-14 12:34 ` Jiebing Chen
2025-01-14 14:15 ` Jerome Brunet
2025-01-15 3:38 ` Jiebing Chen
2025-01-15 6:16 ` Jiebing Chen
2025-01-15 8:43 ` Jerome Brunet
2025-01-15 9:56 ` Jiebing Chen
2025-01-13 15:26 ` [PATCH 0/3] Add support for S4 audio Rob Herring (Arm)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b3b60ec4-ae88-4110-9839-449ee7477d9b@amlogic.com \
--to=jiebing.chen@amlogic.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=devnull+jiebing.chen.amlogic.com@kernel.org \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=neil.armstrong@linaro.org \
--cc=perex@perex.cz \
--cc=robh@kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox