Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Troy Kisky <troy.kisky@boundarydevices.com>
To: davinci-linux-open-source@linux.davincidsp.com
Cc: alsa-devel@alsa-project.org, broonie@sirena.org.uk
Subject: Re: [PATCH 5/5] ASoC: DaVinci: pcm, fix underruns by using sram
Date: Thu, 06 Aug 2009 19:05:54 -0700	[thread overview]
Message-ID: <4A7B8C02.6020902@boundarydevices.com> (raw)
In-Reply-To: <1249602935-1267-5-git-send-email-troy.kisky@boundarydevices.com>

Troy Kisky wrote:
> Fix underruns by using dma to copy 1st to sram
> in a ping/pong buffer style and then copying from
> the sram to the ASP. This also has the advantage
> of tolerating very long interrupt latency on dma
> completion.
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>  static int davinci_pcm_dma_request(struct snd_pcm_substream *substream)
>  {
> +	struct snd_dma_buffer *iram_dma;
>  	struct davinci_runtime_data *prtd = substream->runtime->private_data;
>  	struct snd_soc_pcm_runtime *rtd = substream->private_data;
>  	struct davinci_pcm_dma_params *dma_data = rtd->dai->cpu_dai->dma_data;
> -	struct edmacc_param p_ram;
> -	int ret;
> +	int lch;
>  
>  	if (!dma_data)
>  		return -ENODEV;
>  
>  	prtd->params = dma_data;
>  
> -	/* Request master DMA channel */
> -	ret = edma_alloc_channel(prtd->params->channel,
> -				  davinci_pcm_dma_irq, substream,
> -				  EVENTQ_0);
> -	if (ret < 0)
> -		return ret;
> -	prtd->asp_master_lch = ret;
> +	/* Request asp master DMA channel */
> +	lch = prtd->asp_master_lch = edma_alloc_channel(dma_data->channel,
> +			davinci_pcm_dma_irq, substream, EVENTQ_0);
> +	if (lch < 0)
> +		goto exit1;
>  
> -	/* Request parameter RAM reload slot */
> -	ret = edma_alloc_slot(EDMA_CTLR(prtd->asp_master_lch), EDMA_SLOT_ANY);
> -	if (ret < 0) {
> -		edma_free_channel(prtd->asp_master_lch);
> -		return ret;
> -	}
> -	prtd->asp_link_lch[0] = ret;
> +	/* Request asp link channels */
> +	lch = prtd->asp_link_lch[0] = edma_alloc_slot(
> +			EDMA_CTLR(prtd->asp_master_lch), EDMA_SLOT_ANY);
> +	if (lch < 0)
> +		goto exit2;
> +
> +	allocate_sram(substream, dma_data->sram_size);

This is allocated too late for the "ensure that buffer size is a multiple of period size"
constraint.

I have a patch after fixing other feedback.

Troy

  reply	other threads:[~2009-08-07  2:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-06 23:55 [PATCH 1/5] ASoC: DaVinci: i2s: don't bounce through rtd to get dai Troy Kisky
     [not found] ` <1249602935-1267-1-git-send-email-troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2009-08-06 23:55   ` [PATCH 2/5] ASoC: DaVinci: pcm, constrain buffer size to multiple of period Troy Kisky
2009-08-06 23:55     ` [PATCH 3/5] ASoC: DaVinci: i2s, reduce underruns by combining into 1 element Troy Kisky
2009-08-06 23:55       ` [PATCH 4/5] ASoC: DaVinci: pcm, rename variables in prep for ping/pong Troy Kisky
2009-08-06 23:55         ` [PATCH 5/5] ASoC: DaVinci: pcm, fix underruns by using sram Troy Kisky
2009-08-07  2:05           ` Troy Kisky [this message]
2009-08-08  9:17             ` Mark Brown
2009-08-11  0:32               ` Troy Kisky
2009-08-11  9:59                 ` Mark Brown
2009-08-08  8:59       ` [PATCH 3/5] ASoC: DaVinci: i2s, reduce underruns by combining into 1 element Mark Brown
2009-08-08  9:07         ` Mark Brown
2009-08-07 10:41 ` [PATCH 1/5] ASoC: DaVinci: i2s: don't bounce through rtd to get dai 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=4A7B8C02.6020902@boundarydevices.com \
    --to=troy.kisky@boundarydevices.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@sirena.org.uk \
    --cc=davinci-linux-open-source@linux.davincidsp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox