[alsa-devel] [PATCH 2/2] ASoC: samsung: Use ASoC dmaengine code where possible
padma.kvr at gmail.com
Thu Dec 5 11:50:03 CET 2013
On Thu, Nov 28, 2013 at 5:23 PM, Mark Brown <broonie at kernel.org> wrote:
> On Thu, Nov 28, 2013 at 03:29:31PM +0530, Padma Venkat wrote:
>> On Wed, Nov 27, 2013 at 8:35 PM, Mark Brown <broonie at kernel.org> wrote:
>> > But if it's initialised at probe time then when is it getting
>> > overwritten? This must be something triggered by DT which unfortunately
>> > I can't test. It's a bit of a shame that the flows are different
>> > between the DT and non-DT cases.
>> it's getting overwritten in i2s_hw_params which is happening after
>> dma_data got initialized in dai probe. Based on mono or stereo channel
>> this value getting initialized to 2 or 4 respectively in
>> i2s_hw_params. This value is not triggered by DT now.
> OK, so we can probably just reinitialise the dmaengine data after we
> reset it? Like below
Yes. That works well.
>> > Are you sure that dma_size should be 2? The i2s DAI driver seems to be
>> > hard coding it to 4.
>> I think for mono files the dma_size should be 2 only. Right now based
>> on mono or stereo this value getting overwritten in i2s_hw_params.
>> Initially it is hardcoded to 4. Due to this commit "ASoC: samsung:
>> Allow mono in i2s driver" which was not there earlier, I got confused.
>> Now it seems clear except that underrun message which I am still
As I forgot to add SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag, I was
getting underrun error. After adding this flag audio playback is
working fine for smaller files on smdk5420 with pl330 dma driver.
Except for the crash due to NULL pointer dereference in secondary
dai(I posted a patch for the same (ASoC: samsung: Initialize the
dma_data for secondary dai)) you can add my
Tested By: Padmavathi Venna <padma.v at samsung.com>
> Yeah, that's now confusing - I'll send a patch to remove the
> initialisation on probe() since it's getting overwritten later.
> diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
> index 67d9fa91fdb9..ba24a954b9e4 100644
> --- a/sound/soc/samsung/i2s.c
> +++ b/sound/soc/samsung/i2s.c
> @@ -702,6 +702,8 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
> writel(mod, i2s->addr + I2SMOD);
> + samsung_asoc_init_dma_data(dai, &i2s->dma_playback, &i2s->dma_capture);
> i2s->frmclk = params_rate(params);
> return 0;
More information about the Alsa-devel