Skip to contentSkip to conversation

da850 mcasp playback ping-pong buffers don't work

RFC PATCH In review Ben Gardiner 1 participant 4 messages May 13, 2011 – May 16, 2011

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover da850 mcasp playback ping-pong buffers don't work

Hi All,

I've been testing playback on the da850evm. The good news is on 2.6.39-rc7 playback works fine. The bad news is that if the patches in the series are applied -- playback does not work.

The first patch copies the sram-size platform data to the dma parameters used by davinci-pcm the same way that the existing davinci-i2s driver does. The second patch assigns a buffer size to the playback sram platform data and sets the queues as per Troy's introduction of ping-pong buffers.

I was hoping this would result in playback of audio; but instead there is soft click and then silence. I added pointer debug and observed that the period_update and hwptr_update events progress; but that's as far as I have probed.

Does anyone have any clues why ping-pong buffers on da850 to the McASP would work? Or any clues why the patches are broken?

Best Regards,
Ben Gardiner

Ben Gardiner (2):
[RFC] ASoC: davinci-mcasp: enable ping-pong SRAM buffers [RFC] da850evm: enable mcasp ping-pong buffers

 arch/arm/configs/da8xx_omapl_defconfig  |    1 +
 arch/arm/mach-davinci/board-da850-evm.c |    4 +++-
 sound/soc/davinci/davinci-mcasp.c       |    2 ++
 3 files changed, 6 insertions(+), 1 deletions(-)
Signature · 1 line
1.7.4.1
#1 lore raw

RFC PATCH 1/2 ASoC: davinci-mcasp: enable ping-pong SRAM buffers

The davinci-i2s driver copies the platform data for playback and capture sram sizes which is in turn used by davinci-pcm to allocate ping-pong buffers.

Copy also the platform data in the davinci-mcasp probe().

---
 sound/soc/davinci/davinci-mcasp.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
sound/soc/davinci/davinci-mcasp.c +2 -0
index 4ddc6d3..8566238 100644
@@ -909,6 +909,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 	dma_data = &dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK];
 	dma_data->asp_chan_q = pdata->asp_chan_q;
 	dma_data->ram_chan_q = pdata->ram_chan_q;
+	dma_data->sram_size = pdata->sram_size_playback;
 	dma_data->dma_addr = (dma_addr_t) (pdata->tx_dma_offset +
 							mem->start);
 
@@ -925,6 +926,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 	dma_data = &dev->dma_params[SNDRV_PCM_STREAM_CAPTURE];
 	dma_data->asp_chan_q = pdata->asp_chan_q;
 	dma_data->ram_chan_q = pdata->ram_chan_q;
+	dma_data->sram_size = pdata->sram_size_capture;
 	dma_data->dma_addr = (dma_addr_t)(pdata->rx_dma_offset +
 							mem->start);
 
Signature · 1 line
1.7.4.1
#2 lore raw

RFC PATCH 2/2 da850evm: enable mcasp ping-pong buffers

In reply to Ben Gardiner

The davinci--mcasp driver will copy the platform data specified sram_size's and eventq's.

Set the eventq's and sram size for da850 and disable CONFIG_SUSPEND so that there is SRAM enough left for the McASP (until the patch to allocate sram from the 128K shared RAM region, then there should be plenty to spare)

---
 arch/arm/configs/da8xx_omapl_defconfig  |    1 +
 arch/arm/mach-davinci/board-da850-evm.c |    4 +++-
 2 files changed, 4 insertions(+), 1 deletions(-)
arch/arm/configs/da8xx_omapl_defconfig +1 -0
index 88ccde0..d06c89b 100644
@@ -34,6 +34,7 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=m
 CONFIG_CPU_FREQ_GOV_POWERSAVE=m
 CONFIG_CPU_FREQ_GOV_ONDEMAND=m
 CONFIG_CPU_IDLE=y
+# CONFIG_SUSPEND is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
arch/arm/mach-davinci/board-da850-evm.c +3 -1
index a7b41bf..1566480 100644
@@ -722,10 +722,12 @@ static struct snd_platform_data da850_evm_snd_data = {
 	.num_serializer	= ARRAY_SIZE(da850_iis_serializer_direction),
 	.tdm_slots	= 2,
 	.serial_dir	= da850_iis_serializer_direction,
-	.asp_chan_q	= EVENTQ_1,
+	.asp_chan_q	= EVENTQ_0,
+	.ram_chan_q	= EVENTQ_1,
 	.version	= MCASP_VERSION_2,
 	.txnumevt	= 1,
 	.rxnumevt	= 1,
+	.sram_size_playback = SZ_8K /* or SZ_4K -- same results */,
 };
 
 static const short da850_evm_mcasp_pins[] __initconst = {
Signature · 1 line
1.7.4.1
#3 lore raw
In reply to Ben Gardiner

Hi All,

Quoted 3 lines · Ben Gardiner

[...]
Does anyone have any clues why ping-pong buffers on da850 to the McASP would work? Or any clues why the patches are broken?

To answer my own question: the reason ping-pong buffering was not working is because the SRAM allocator being used was allocating buffers from the "ARM local RAM" block @0xFFFF0000 which is not addressable by the DMA engine -- according to SPRS586.

Ping-pong buffers work when I substitute the allocator for one that allocates from the 'Shared RAM' block @0x80000000 using Subhasish Ghosh's patch "davinci: changed SRAM allocator to shared ram."

Best Regards,
Ben Gardiner

---
Nanometrics Inc.
http://www.nanometrics.ca