aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorBen Gardiner <bengardiner@nanometrics.ca>2011-05-24 14:50:18 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-25 07:14:30 -0400
commitef39eb6f212996ede8da47ef45e6dffff1121ec7 (patch)
tree5cb3b33659f4e7e280af765124cd8bc2a7175f96 /sound
parentacb8e2666eba7417e2fab783f86dbe067c3e815f (diff)
ASoC: davinci-pcm: fix audible glitch on 2nd ping-pong playback
The release of the dma channels was being performed in prepare and there was a edma_resume call for the asp-channel only being executed on START, RESUME and PAUSE_RELEASE. The mcasp on da850evm with ping-pong buffers enabled was exhibiting an audible glitch on every playback after the first. It was determined through trial and error that the following two changes fix this problem: 1) Move the edma_start calls from prepare to trigger and 2) reverse the order of starting the asp and ram channels. Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca> Reviewed-by: Steven Faludi <stevenfaludi@nanometrics.ca> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/davinci/davinci-pcm.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c
index 9b5a9bf9393a..5d9269a51761 100644
--- a/sound/soc/davinci/davinci-pcm.c
+++ b/sound/soc/davinci/davinci-pcm.c
@@ -544,6 +544,13 @@ static int davinci_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
544 544
545 switch (cmd) { 545 switch (cmd) {
546 case SNDRV_PCM_TRIGGER_START: 546 case SNDRV_PCM_TRIGGER_START:
547 edma_start(prtd->asp_channel);
548 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
549 prtd->ram_channel >= 0) {
550 /* copy 1st iram buffer */
551 edma_start(prtd->ram_channel);
552 }
553 break;
547 case SNDRV_PCM_TRIGGER_RESUME: 554 case SNDRV_PCM_TRIGGER_RESUME:
548 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 555 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
549 edma_resume(prtd->asp_channel); 556 edma_resume(prtd->asp_channel);
@@ -582,11 +589,6 @@ static int davinci_pcm_prepare(struct snd_pcm_substream *substream)
582 print_buf_info(prtd->asp_link[0], "asp_link[0]"); 589 print_buf_info(prtd->asp_link[0], "asp_link[0]");
583 print_buf_info(prtd->asp_link[1], "asp_link[1]"); 590 print_buf_info(prtd->asp_link[1], "asp_link[1]");
584 591
585 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
586 /* copy 1st iram buffer */
587 edma_start(prtd->ram_channel);
588 }
589 edma_start(prtd->asp_channel);
590 return 0; 592 return 0;
591 } 593 }
592 prtd->period = 0; 594 prtd->period = 0;
@@ -596,7 +598,6 @@ static int davinci_pcm_prepare(struct snd_pcm_substream *substream)
596 edma_read_slot(prtd->asp_link[0], &prtd->asp_params); 598 edma_read_slot(prtd->asp_link[0], &prtd->asp_params);
597 edma_write_slot(prtd->asp_channel, &prtd->asp_params); 599 edma_write_slot(prtd->asp_channel, &prtd->asp_params);
598 davinci_pcm_enqueue_dma(substream); 600 davinci_pcm_enqueue_dma(substream);
599 edma_start(prtd->asp_channel);
600 601
601 return 0; 602 return 0;
602} 603}