All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 4/4] ASoC: DaVinci: pcm, fix underrun by using sram
@ 2010-07-13 19:01 troy.kisky
       [not found] ` <51883.1279047660-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: troy.kisky @ 2010-07-13 19:01 UTC (permalink / raw)
  To: Troy Kisky, alsa-devel@alsa-project.org, Nori Sekhar
  Cc: davinci-linux-open-source@linux.davincidsp.com,
	broonie@sirena.org.uk

  BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; } 
 On Tue 13/07/10 6:00 AM , "Nori, Sekhar" nsekhar@ti.com sent:
	Hi Troy,
 On Tue, Nov 17, 2009 at 05:22:34, 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 
 [...]
 > +static int request_ping_pong(struct snd_pcm_substream *substream,
 > + struct davinci_runtime_data *prtd,
 > + struct snd_dma_buffer *iram_dma)
 > +{
 > + dma_addr_t asp_src_ping;
 > + dma_addr_t asp_dst_ping;
 > + int link;
 > + struct davinci_pcm_dma_params *dma_data = prtd->params;
 > +
 > + /* Request ram master channel */
 > + link = prtd->ram_channel = edma_alloc_channel(EDMA_CHANNEL_ANY,
 > + davinci_pcm_dma_irq, substream,
 > + EVENTQ_1);
 What is the reason for choosing EVENTQ_1 for this channel? EVENTQ_0
 is already being used for ASP channel.
 I imagine it will be much easier to tune the queue usage in the
system
 if all of audio data was using the same queue.
 I am working on a patch which lets platform specify the event queues
 for audio DMA. I am not sure if I really need to make a provision
for
 two different queues to be specified - that's why I ask.
 Thanks,
 Sekhar
	The reason is so that the IRAM data can be fetched and used while 

	EVENTQ_1 fetches the next buffer of data from sdram into IRAM. 
	Troy 

	 

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH 1/4] ASoC: DaVinci: remove requirement that dma_params is 1st in structure
@ 2009-11-16 23:52 Troy Kisky
  2009-11-16 23:52 ` [PATCH 2/4] ASoC: DaVinci: i2s, reduce underruns by combining into 1 element Troy Kisky
  0 siblings, 1 reply; 5+ messages in thread
From: Troy Kisky @ 2009-11-16 23:52 UTC (permalink / raw)
  To: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw
  Cc: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
	broonie-GFdadSzt00ze9xe1eoZjHA

Remove requirement that dma_params is 1st in the structures
davinci_audio_dev and davinci_mcbsp_dev.

Signed-off-by: Troy Kisky <troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
---
 sound/soc/davinci/davinci-i2s.c   |    6 +-----
 sound/soc/davinci/davinci-mcasp.c |    1 +
 sound/soc/davinci/davinci-mcasp.h |    5 -----
 sound/soc/davinci/davinci-pcm.c   |    7 ++++---
 4 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
index 4ae7070..9e69a4e 100644
--- a/sound/soc/davinci/davinci-i2s.c
+++ b/sound/soc/davinci/davinci-i2s.c
@@ -98,11 +98,6 @@ enum {
 };
 
 struct davinci_mcbsp_dev {
-	/*
-	 * dma_params must be first because rtd->dai->cpu_dai->private_data
-	 * is cast to a pointer of an array of struct davinci_pcm_dma_params in
-	 * davinci_pcm_open.
-	 */
 	struct davinci_pcm_dma_params	dma_params[2];
 	void __iomem			*base;
 #define MOD_DSP_A	0
@@ -547,6 +542,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
 	dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].channel = res->start;
 
 	davinci_i2s_dai.private_data = dev;
+	davinci_i2s_dai.dma_data = dev->dma_params;
 	ret = snd_soc_register_dai(&davinci_i2s_dai);
 	if (ret != 0)
 		goto err_free_mem;
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 5d1f98a..5023915 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -907,6 +907,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 
 	dma_data->channel = res->start;
 	davinci_mcasp_dai[pdata->op_mode].private_data = dev;
+	davinci_mcasp_dai[pdata->op_mode].dma_data = dev->dma_params;
 	davinci_mcasp_dai[pdata->op_mode].dev = &pdev->dev;
 	ret = snd_soc_register_dai(&davinci_mcasp_dai[pdata->op_mode]);
 
diff --git a/sound/soc/davinci/davinci-mcasp.h b/sound/soc/davinci/davinci-mcasp.h
index 9d179cc..582c924 100644
--- a/sound/soc/davinci/davinci-mcasp.h
+++ b/sound/soc/davinci/davinci-mcasp.h
@@ -39,11 +39,6 @@ enum {
 };
 
 struct davinci_audio_dev {
-	/*
-	 * dma_params must be first because rtd->dai->cpu_dai->private_data
-	 * is cast to a pointer of an array of struct davinci_pcm_dma_params in
-	 * davinci_pcm_open.
-	 */
 	struct davinci_pcm_dma_params dma_params[2];
 	void __iomem *base;
 	int sample_rate;
diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c
index c73a915..c2c2e85 100644
--- a/sound/soc/davinci/davinci-pcm.c
+++ b/sound/soc/davinci/davinci-pcm.c
@@ -238,10 +238,11 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream)
 	struct davinci_runtime_data *prtd;
 	int ret = 0;
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
-	struct davinci_pcm_dma_params *pa = rtd->dai->cpu_dai->private_data;
-	struct davinci_pcm_dma_params *params = &pa[substream->stream];
-	if (!params)
+	struct davinci_pcm_dma_params *pa = rtd->dai->cpu_dai->dma_data;
+	struct davinci_pcm_dma_params *params;
+	if (!pa)
 		return -ENODEV;
+	params = &pa[substream->stream];
 
 	snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware);
 	/* ensure that buffer size is a multiple of period size */
-- 
1.5.6.3

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

end of thread, other threads:[~2010-07-14 17:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-13 19:01 [PATCH 4/4] ASoC: DaVinci: pcm, fix underrun by using sram troy.kisky
     [not found] ` <51883.1279047660-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2010-07-14 13:05   ` Nori, Sekhar
2010-07-14 17:46     ` Troy Kisky
  -- strict thread matches above, loose matches on Subject: below --
2009-11-16 23:52 [PATCH 1/4] ASoC: DaVinci: remove requirement that dma_params is 1st in structure Troy Kisky
2009-11-16 23:52 ` [PATCH 2/4] ASoC: DaVinci: i2s, reduce underruns by combining into 1 element Troy Kisky
2009-11-16 23:52   ` [PATCH 3/4] ASoC: DaVinci: pcm, rename variables in prep for ping/pong Troy Kisky
2009-11-16 23:52     ` [PATCH 4/4] ASoC: DaVinci: pcm, fix underrun by using sram Troy Kisky
     [not found]       ` <1258415554-31069-4-git-send-email-troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2010-07-13 11:00         ` Nori, Sekhar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.