All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [PATCH] ASoC: tlv320aic3x: Correct S24_3LE support
Date: Tue, 24 Jun 2014 09:23:28 +0300	[thread overview]
Message-ID: <53A91960.1040108@ti.com> (raw)
In-Reply-To: <20140623151822.GA23300@sirena.org.uk>

On 06/23/2014 06:18 PM, Mark Brown wrote:
> On Mon, Jun 23, 2014 at 04:01:13PM +0300, Peter Ujfalusi wrote:
> 
>> AIC3X_FORMATS is correct:
>> #define AIC3X_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
>> 			SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE)
> 
>> While in hw_params the switch was not handling the S24_3LE but it was defined
>> as S24_LE. So the code was not correct: It advertised that it supportsd
>> S24_3LE and was not handling it, but it was handling S24_LE which would not
>> happen with this codec driver since the format is not supported - as it was
>> defined by the AIC3X_FORMATS.
> 
>> This is a fix for the current driver.
> 
> Yes, but the fix should be to support both.

I would rather fix the S24_3LE with this patch and add the S24_LE with a
separate one. But IMHO the S24_LE support is not obvious.

>>> I really need to get round to doing
>>> the rest of the conversions to use params_width() which should ensure
>>> this.
> 
>> Not sure how this would work at the end to be honest for all platforms and codecs.
>> How should the bitclock need to be configured for S24_3LE, S24_LE and S32_LE
>> msbits=24? They are at the end have 24bits audio data but in memory they are
>> stored in different ways.
> 
> The number of bits on the wire should be the number specified in the
> format.

So you are saying that for S24_3LE, S24_LE and S32_LE (msbits=24) we should
have 24 bits on the wire?
At least twl4030/5030 expects the 24bit data on the wire with 32 clocks (24
bits data + 8bits padding).
OMAP McBSP can only support 24bit audio with S32_LE (msbits=24) and it needs
to have 32 clock cycle on the bus to do this due to system constraints.

So if we say that S32_LE (msbits=24) should have 24 bits on the wire neither
OMAP McBSP nor twl4030/5030 could do that.

Not sure about other SoCs, but I would not be so surprised that they also want
to shift out all the bits they have got form the main memory, ie 24 bits in
case of S24_3LE, 32bits in case of S24_LE or S32_LE (msbits=24).

>> Aic3x for example need to be configured to 24bit mode (24 clocks/channel if it
>> is master) so it is going to 'pull' that amount from the CPU side. This can
>> not be used with OMAP's sDMA/McBSP but davinci's eDMA/McASP can support it. I
>> can even get daVinci to 'extract' the valid 24 bits from the 32bit sample
>> coming via eDMA (mask/rotate/reverse operation).
> 
> Sure, so it only supports exactly 24 bit sample formats in master mode.
> That's what's expected by default.
> 
>> So I still think that this is a bit more complicated than it looks
> 
> I'm not seeing anything particularly hard here.  The main thing is that
> we ought to do something for dealing with extra BCLKs (eg, a device that
> can tolerate extra BCLKs can have the other end generating more data
> quite happily).
> 


-- 
Péter

  reply	other threads:[~2014-06-24  6:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-06 13:05 [PATCH] ASoC: tlv320aic3x: Correct S24_3LE support Peter Ujfalusi
2014-06-09 20:24 ` Mark Brown
2014-06-23 13:01   ` Peter Ujfalusi
2014-06-23 15:18     ` Mark Brown
2014-06-24  6:23       ` Peter Ujfalusi [this message]
2014-06-24  9:18         ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2013-12-13 12:58 Peter Ujfalusi
2013-12-13 13:04 ` Mark Brown
2013-12-13 13:29   ` Peter Ujfalusi
2013-12-13 13:34     ` Mark Brown
2013-12-13 13:41       ` Takashi Iwai
2013-12-13 13:50         ` Mark Brown
2013-12-13 13:57       ` Peter Ujfalusi
2013-12-13 14:18         ` Mark Brown
2013-12-13 14:31           ` Peter Ujfalusi
2013-12-13 18:29             ` Mark Brown
2013-12-13 13:42     ` Lars-Peter Clausen
2013-12-13 13:49       ` Mark Brown

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=53A91960.1040108@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.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 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.