alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, Nicolin Chen <b42378@freescale.com>,
	Timur Tabi <timur@tabi.org>, Liam Girdwood <lgirdwood@gmail.com>,
	Markus Pargmann <mpa@pengutronix.de>,
	Shawn Guo <shawn.guo@linaro.org>
Subject: Re: [PATCH 06/19] ASoC: fsl: Don't set unused struct snd_pcm_hardware fields
Date: Fri, 20 Dec 2013 19:16:34 +0100	[thread overview]
Message-ID: <52B48982.2000308@metafoo.de> (raw)
In-Reply-To: <20131220182727.GA31886@sirena.org.uk>

On 12/20/2013 07:27 PM, Mark Brown wrote:
> On Fri, Dec 20, 2013 at 03:04:08PM +0100, Lars-Peter Clausen wrote:
>> On 12/20/2013 03:25 PM, Timur Tabi wrote:
> 
>>> Is this new?  There are formats that the codec and the SSI support that the
>>> DMA controller does NOT support, like packed 24-bit samples.  How do we
>>> ensure that we never get those?
> 
>> No, this is how it has always been. If there are restrictions imposed by the
>> DMA controller we need to add support for expressing this inside the ASoC
>> framework. But I think it will probably be more complex than just saying the
>> DMA controller supports format A, B, C and the DAI controller supports
>> format B, C, D and then just do the intersection of both. E.g. the DAI
>> controller probably does not care whether the samples are packed or not if
>> it only sees one sample at a time, while
> 
> The most common pattern I've seen is that the DAIs expect to see whole
> samples at a time get written into their FIFOs since the FIFOs tend to
> be stored in samples rather than bytes. With that pattern it'd be a bit
> cleaner to have them advertise sample sizes and transfer sizes and then
> have the core work out that if you can for example do 24 bit samples
> with four byte transfers and have a DMA controller that needs a 1:1
> mapping between data read and written then we can't do packed format.
> 

Yep. The other one I've seen is where the audio controller expects the DMA
to pack samples, that are smaller than the bus width, to one bus width word.
E.g. if the bus width is 32 and the sample width is 16 the DMA controller is
supposed to write 2 samples at once.

And then there might be different variations of the first one. Some
controllers might expect narrow writes/reads while others might expect full
bus width access with the upper bytes padded/discarded. But I think most
controllers are fine with both.

The audio controller should probably advertise what sample sizes it supports
and how it expects them to be written/read. And the DMA controller then
based on that list needs to figure out what kind of in memory
representations of the audio data it can support.

> I think in general we want to be moving the DAIs to a sample size based
> interface and then mapping that onto the DMA controller when we connect
> the DMA and CPU DAIs.  This would help with clarity on the CODEC side as
> well.
> 

Yep, something similar should probably be done for format negotiation
between DAI and CODEC.

  reply	other threads:[~2013-12-20 19:15 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-20 13:20 [PATCH 01/19] ASoC: atmel: Don't set unused struct snd_pcm_hardware fields Lars-Peter Clausen
2013-12-20 13:20 ` [PATCH 02/19] ASoC: au1x: " Lars-Peter Clausen
2013-12-20 15:24   ` Manuel Lauss
2013-12-21 14:24   ` Mark Brown
2013-12-20 13:20 ` [PATCH 03/19] ASoC: blackfin: " Lars-Peter Clausen
2013-12-24 11:54   ` Mark Brown
2013-12-20 13:20 ` [PATCH 04/19] ASoC: davinci: " Lars-Peter Clausen
2013-12-23  7:04   ` Peter Ujfalusi
2013-12-24 12:01   ` Mark Brown
2013-12-20 13:20 ` [PATCH 05/19] ASoC: ep93xx: " Lars-Peter Clausen
2013-12-30 13:59   ` Mark Brown
2013-12-20 13:20 ` [PATCH 06/19] ASoC: fsl: " Lars-Peter Clausen
2013-12-20 14:25   ` Timur Tabi
2013-12-20 14:04     ` Lars-Peter Clausen
2013-12-20 18:27       ` Mark Brown
2013-12-20 18:16         ` Lars-Peter Clausen [this message]
2013-12-20 13:20 ` [PATCH 07/19] ASoC: intel: " Lars-Peter Clausen
2013-12-20 13:20 ` [PATCH 08/19] ASoC: kirkwood: " Lars-Peter Clausen
2013-12-20 18:05   ` Jean-Francois Moine
2013-12-20 17:18     ` Lars-Peter Clausen
2013-12-20 19:13       ` Jean-Francois Moine
2013-12-20 18:29         ` Lars-Peter Clausen
2013-12-20 13:20 ` [PATCH 09/19] ASoC: mxs: " Lars-Peter Clausen
2013-12-20 13:20 ` [PATCH 10/19] ASoC: nuc900: " Lars-Peter Clausen
2013-12-20 13:20 ` [PATCH 11/19] ASoC: omap: " Lars-Peter Clausen
2013-12-22 17:19   ` Jarkko Nikula
2013-12-23  7:04   ` Peter Ujfalusi
2013-12-24 12:04   ` Mark Brown
2013-12-20 13:20 ` [PATCH 12/19] ASoC: mmp: " Lars-Peter Clausen
2013-12-30 13:59   ` Mark Brown
2013-12-20 13:20 ` [PATCH 13/19] ASoC: s6000: " Lars-Peter Clausen
2013-12-22 22:21   ` Daniel Glöckner
2013-12-24 12:02   ` Mark Brown
2013-12-20 13:20 ` [PATCH 14/19] ASoC: samsung: " Lars-Peter Clausen
2013-12-30 13:57   ` Mark Brown
2013-12-20 13:20 ` [PATCH 15/19] ASoC: sh: " Lars-Peter Clausen
2013-12-20 13:20 ` [PATCH 16/19] ASoC: tegra: " Lars-Peter Clausen
2013-12-20 17:43   ` Stephen Warren
2013-12-21 14:27   ` Mark Brown
2013-12-20 13:20 ` [PATCH 17/19] ASoC: txx9: " Lars-Peter Clausen
2013-12-30 13:58   ` Mark Brown
2013-12-20 13:20 ` [PATCH 18/19] ASoC: ux500: " Lars-Peter Clausen
2013-12-20 13:20 ` [PATCH 19/19] ASoC: soc-utils: " Lars-Peter Clausen
2013-12-30 13:56   ` Mark Brown
2014-01-04 18:15 ` [PATCH 01/19] ASoC: atmel: " Lars-Peter Clausen
2014-01-06  3:01   ` Bo Shen
2014-01-06 16:45 ` 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=52B48982.2000308@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=b42378@freescale.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=mpa@pengutronix.de \
    --cc=shawn.guo@linaro.org \
    --cc=timur@tabi.org \
    /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;
as well as URLs for NNTP newsgroup(s).