alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [ASoC]Changing the order of trigger in soc_pcm_trigger
@ 2007-06-06 13:06 Nobin Mathew
  2007-06-06 13:24 ` Nobin Mathew
  2007-06-06 13:24 ` Liam Girdwood
  0 siblings, 2 replies; 3+ messages in thread
From: Nobin Mathew @ 2007-06-06 13:06 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: alsa-devel

Liam,

I have one suggestion.

Can we use this

if (rtd->codec_dai->ops.trigger) {
		ret = rtd->codec_dai->ops.trigger(substream, cmd);
		if (ret < 0)
			return ret;
	}

if (rtd->cpu_dai->ops.trigger) {
	ret = rtd->cpu_dai->ops.trigger(substream, cmd);
	if (ret < 0)
		return ret;
}
if (platform->pcm_ops->trigger) {
	ret = platform->pcm_ops->trigger(substream, cmd);
	if (ret < 0)
		return ret;
}

Instead of

if (rtd->codec_dai->ops.trigger) {
		ret = rtd->codec_dai->ops.trigger(substream, cmd);
		if (ret < 0)
			return ret;
	}

if (platform->pcm_ops->trigger) {
	ret = platform->pcm_ops->trigger(substream, cmd);
	if (ret < 0)
		return ret;
}

if (rtd->cpu_dai->ops.trigger) {
	ret = rtd->cpu_dai->ops.trigger(substream, cmd);
	if (ret < 0)
		return ret;
}


That means trigger the Cpu before pcm. Because most of the controllers
needs to be initialized and triggered before external DMA is
triggered.

Correct me if i am going wrong.

This was causing so many problems in my hardware.

Nobin Mathew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ASoC]Changing the order of trigger in soc_pcm_trigger
  2007-06-06 13:06 [ASoC]Changing the order of trigger in soc_pcm_trigger Nobin Mathew
@ 2007-06-06 13:24 ` Nobin Mathew
  2007-06-06 13:24 ` Liam Girdwood
  1 sibling, 0 replies; 3+ messages in thread
From: Nobin Mathew @ 2007-06-06 13:24 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: alsa-devel

I feel i am wrong because as soon as controller is triggered it will
request for data from DMA.
 So this is my controller implementation problem.

On 6/6/07, Nobin Mathew <nobin.mathew@gmail.com> wrote:
> Liam,
>
> I have one suggestion.
>
> Can we use this
>
> if (rtd->codec_dai->ops.trigger) {
>                 ret = rtd->codec_dai->ops.trigger(substream, cmd);
>                 if (ret < 0)
>                         return ret;
>         }
>
> if (rtd->cpu_dai->ops.trigger) {
>         ret = rtd->cpu_dai->ops.trigger(substream, cmd);
>         if (ret < 0)
>                 return ret;
> }
> if (platform->pcm_ops->trigger) {
>         ret = platform->pcm_ops->trigger(substream, cmd);
>         if (ret < 0)
>                 return ret;
> }
>
> Instead of
>
> if (rtd->codec_dai->ops.trigger) {
>                 ret = rtd->codec_dai->ops.trigger(substream, cmd);
>                 if (ret < 0)
>                         return ret;
>         }
>
> if (platform->pcm_ops->trigger) {
>         ret = platform->pcm_ops->trigger(substream, cmd);
>         if (ret < 0)
>                 return ret;
> }
>
> if (rtd->cpu_dai->ops.trigger) {
>         ret = rtd->cpu_dai->ops.trigger(substream, cmd);
>         if (ret < 0)
>                 return ret;
> }
>
>
> That means trigger the Cpu before pcm. Because most of the controllers
> needs to be initialized and triggered before external DMA is
> triggered.
>
> Correct me if i am going wrong.
>
> This was causing so many problems in my hardware.
>
> Nobin Mathew
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ASoC]Changing the order of trigger in soc_pcm_trigger
  2007-06-06 13:06 [ASoC]Changing the order of trigger in soc_pcm_trigger Nobin Mathew
  2007-06-06 13:24 ` Nobin Mathew
@ 2007-06-06 13:24 ` Liam Girdwood
  1 sibling, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2007-06-06 13:24 UTC (permalink / raw)
  To: Nobin Mathew; +Cc: alsa-devel

On Wed, 2007-06-06 at 18:36 +0530, Nobin Mathew wrote:
> Liam,
> 
> I have one suggestion.
> 
> Can we use this
> 
> if (rtd->codec_dai->ops.trigger) {
> 		ret = rtd->codec_dai->ops.trigger(substream, cmd);
> 		if (ret < 0)
> 			return ret;
> 	}
> 
> if (rtd->cpu_dai->ops.trigger) {
> 	ret = rtd->cpu_dai->ops.trigger(substream, cmd);
> 	if (ret < 0)
> 		return ret;
> }
> if (platform->pcm_ops->trigger) {
> 	ret = platform->pcm_ops->trigger(substream, cmd);
> 	if (ret < 0)
> 		return ret;
> }
> 
> Instead of
> 
> if (rtd->codec_dai->ops.trigger) {
> 		ret = rtd->codec_dai->ops.trigger(substream, cmd);
> 		if (ret < 0)
> 			return ret;
> 	}
> 
> if (platform->pcm_ops->trigger) {
> 	ret = platform->pcm_ops->trigger(substream, cmd);
> 	if (ret < 0)
> 		return ret;
> }
> 
> if (rtd->cpu_dai->ops.trigger) {
> 	ret = rtd->cpu_dai->ops.trigger(substream, cmd);
> 	if (ret < 0)
> 		return ret;
> }
> 
> 
> That means trigger the Cpu before pcm. Because most of the controllers
> needs to be initialized and triggered before external DMA is
> triggered.
> 
> Correct me if i am going wrong.


The current ordering allows the DMA to trigger before the I2S/PCM
controller triggers. This means that the DMA should be ready before the
controller generates any FIFO DMA interrupt requests. Fwiw, this seems
to work well on most machines atm. 

> This was causing so many problems in my hardware.

What sort of problems. Underruns ? What does your trigger do in each
case ?

Is it possible to set some of your controller up in prepare() and then
hit it's enable bit in trigger ?

Liam

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-06-06 13:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-06 13:06 [ASoC]Changing the order of trigger in soc_pcm_trigger Nobin Mathew
2007-06-06 13:24 ` Nobin Mathew
2007-06-06 13:24 ` Liam Girdwood

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).