All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/2] da850 mcasp playback ping-pong buffers don't work
@ 2011-05-13 21:26 Ben Gardiner
  2011-05-13 21:26 ` [PATCH 1/2] [RFC] ASoC: davinci-mcasp: enable ping-pong SRAM buffers Ben Gardiner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ben Gardiner @ 2011-05-13 21:26 UTC (permalink / raw)
  To: Liam Girdwood, Troy Kisky, Chaithrika U S, alsa-devel
  Cc: davinci-linux-open-source, Sekhar Nori

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

-- 
1.7.4.1

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

* [PATCH 1/2] [RFC] ASoC: davinci-mcasp: enable ping-pong SRAM buffers
  2011-05-13 21:26 [PATCH RFC 0/2] da850 mcasp playback ping-pong buffers don't work Ben Gardiner
@ 2011-05-13 21:26 ` Ben Gardiner
  2011-05-13 21:26 ` [PATCH 2/2] [RFC] da850evm: enable mcasp ping-pong buffers Ben Gardiner
  2011-05-16 19:15 ` [PATCH RFC 0/2] da850 mcasp playback ping-pong buffers don't work Ben Gardiner
  2 siblings, 0 replies; 4+ messages in thread
From: Ben Gardiner @ 2011-05-13 21:26 UTC (permalink / raw)
  To: Liam Girdwood, Troy Kisky, Chaithrika U S, alsa-devel
  Cc: davinci-linux-open-source, Sekhar Nori

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

Not-signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
---
 sound/soc/davinci/davinci-mcasp.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 4ddc6d3..8566238 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -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);
 
-- 
1.7.4.1

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

* [PATCH 2/2] [RFC] da850evm: enable mcasp ping-pong buffers
  2011-05-13 21:26 [PATCH RFC 0/2] da850 mcasp playback ping-pong buffers don't work Ben Gardiner
  2011-05-13 21:26 ` [PATCH 1/2] [RFC] ASoC: davinci-mcasp: enable ping-pong SRAM buffers Ben Gardiner
@ 2011-05-13 21:26 ` Ben Gardiner
  2011-05-16 19:15 ` [PATCH RFC 0/2] da850 mcasp playback ping-pong buffers don't work Ben Gardiner
  2 siblings, 0 replies; 4+ messages in thread
From: Ben Gardiner @ 2011-05-13 21:26 UTC (permalink / raw)
  To: Liam Girdwood, Troy Kisky, Chaithrika U S, alsa-devel
  Cc: davinci-linux-open-source, Sekhar Nori

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)

Not-signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
---
 arch/arm/configs/da8xx_omapl_defconfig  |    1 +
 arch/arm/mach-davinci/board-da850-evm.c |    4 +++-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/arm/configs/da8xx_omapl_defconfig b/arch/arm/configs/da8xx_omapl_defconfig
index 88ccde0..d06c89b 100644
--- a/arch/arm/configs/da8xx_omapl_defconfig
+++ b/arch/arm/configs/da8xx_omapl_defconfig
@@ -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
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index a7b41bf..1566480 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -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 = {
-- 
1.7.4.1

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

* Re: [PATCH RFC 0/2] da850 mcasp playback ping-pong buffers don't work
  2011-05-13 21:26 [PATCH RFC 0/2] da850 mcasp playback ping-pong buffers don't work Ben Gardiner
  2011-05-13 21:26 ` [PATCH 1/2] [RFC] ASoC: davinci-mcasp: enable ping-pong SRAM buffers Ben Gardiner
  2011-05-13 21:26 ` [PATCH 2/2] [RFC] da850evm: enable mcasp ping-pong buffers Ben Gardiner
@ 2011-05-16 19:15 ` Ben Gardiner
  2 siblings, 0 replies; 4+ messages in thread
From: Ben Gardiner @ 2011-05-16 19:15 UTC (permalink / raw)
  To: Troy Kisky, alsa-devel
  Cc: Subhasish Ghosh, davinci-linux-open-source, Sekhar Nori, Liam Girdwood

Hi All,

On Fri, May 13, 2011 at 5:26 PM, Ben Gardiner
<bengardiner@nanometrics.ca> wrote:
> [...]
> 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

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

end of thread, other threads:[~2011-05-16 19:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-13 21:26 [PATCH RFC 0/2] da850 mcasp playback ping-pong buffers don't work Ben Gardiner
2011-05-13 21:26 ` [PATCH 1/2] [RFC] ASoC: davinci-mcasp: enable ping-pong SRAM buffers Ben Gardiner
2011-05-13 21:26 ` [PATCH 2/2] [RFC] da850evm: enable mcasp ping-pong buffers Ben Gardiner
2011-05-16 19:15 ` [PATCH RFC 0/2] da850 mcasp playback ping-pong buffers don't work Ben Gardiner

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.