Hi Mark,

On Thu, Nov 28, 2013 at 5:23 PM, Mark Brown <broo...@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 <broo...@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
>> debugging.

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 <padm...@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;

Thanks
Padma
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to