All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: davinci: ping-pong buffers for mcasp on da850evm
@ 2011-05-18 13:27 Ben Gardiner
  2011-05-18 13:27 ` [PATCH 1/2] ASoC: davinci-mcasp: enable ping-pong SRAM buffers Ben Gardiner
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ben Gardiner @ 2011-05-18 13:27 UTC (permalink / raw)
  To: Mark Brown, Sekhar Nori, Liam Girdwood, alsa-devel,
	davinci-linux-open-source
  Cc: Subhasish Ghosh, Troy Kisky

davinci-i2s enables the use of ping-pong buffers by copying the sram sizes
specified by platform data into the dma params used by davinci-pcm.

This patch series first implements that same behaviour in davinic-mcasp
and then specified sram sizes and eventq's for da850evm.

To achieve the use of ping-pong buffers at runtime this patch depends also
on the conversion of da850's SRAM allocator to the "Share RAM" region from 
the "ARM Local RAM" region -- originally proposed by Subhasish Ghosh[1] and
recently reposted by myself [2].

This is because the "ARM Local RAM" region currently used by the da850 SRAM
allocator is not addressable by the EDMA. The resulting behaviour, when
ping-pong buffers are used by davinci-pcm, is that playback produces silence
and capture acquires silence.

However, there is no change in behaviour for da850evm build with the in-tree
defconfig since suspend allocates SRAM which prevents a successful allocation
of 8K by davinci-pcm and thus the behaviour falls back to the usual scheme.

In the case of da850evm builds where CONFIG_SUSPEND is not set, playback 
will produce silence and capture will acquire silence until such time as the
patches to change the da850 SRAM allocator to the "Shared RAM" region are 
merged.

[1] http://article.gmane.org/gmane.linux.kernel/1098928
[2] http://article.gmane.org/gmane.linux.ports.arm.kernel/117261

Ben Gardiner (2):
  ASoC: davinci-mcasp: enable ping-pong SRAM buffers
  davinci: da850evm: enable mcasp ping-pong buffers and eventq's

 arch/arm/mach-davinci/board-da850-evm.c |    5 ++++-
 sound/soc/davinci/davinci-mcasp.c       |    2 ++
 2 files changed, 6 insertions(+), 1 deletions(-)

-- 
1.7.4.1

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

* [PATCH 1/2] ASoC: davinci-mcasp: enable ping-pong SRAM buffers
  2011-05-18 13:27 [PATCH 0/2] ASoC: davinci: ping-pong buffers for mcasp on da850evm Ben Gardiner
@ 2011-05-18 13:27 ` Ben Gardiner
  2011-05-19 21:13   ` Mark Brown
  2011-05-18 13:27 ` [PATCH 2/2] davinci: da850evm: enable mcasp ping-pong bufs and evq's Ben Gardiner
  2011-05-19 11:08 ` [PATCH 0/2] ASoC: davinci: ping-pong buffers for mcasp on da850evm Liam Girdwood
  2 siblings, 1 reply; 8+ messages in thread
From: Ben Gardiner @ 2011-05-18 13:27 UTC (permalink / raw)
  To: Mark Brown, Sekhar Nori, Liam Girdwood, alsa-devel,
	davinci-linux-open-source
  Cc: Subhasish Ghosh, Troy Kisky

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 davinci-mcasp probe.

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] 8+ messages in thread

* [PATCH 2/2] davinci: da850evm: enable mcasp ping-pong bufs and evq's
  2011-05-18 13:27 [PATCH 0/2] ASoC: davinci: ping-pong buffers for mcasp on da850evm Ben Gardiner
  2011-05-18 13:27 ` [PATCH 1/2] ASoC: davinci-mcasp: enable ping-pong SRAM buffers Ben Gardiner
@ 2011-05-18 13:27 ` Ben Gardiner
  2011-05-19 21:14   ` Mark Brown
  2011-05-19 11:08 ` [PATCH 0/2] ASoC: davinci: ping-pong buffers for mcasp on da850evm Liam Girdwood
  2 siblings, 1 reply; 8+ messages in thread
From: Ben Gardiner @ 2011-05-18 13:27 UTC (permalink / raw)
  To: Mark Brown, Sekhar Nori, Liam Girdwood, alsa-devel,
	davinci-linux-open-source
  Cc: Subhasish Ghosh, Troy Kisky

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

Set the event queues and sram sizes for da850. 8K SRAM buffers are selected
because it is the minimum that resulted in the same period size when testing
48KHz S16_LE stereo. Event queues 0 and 1 are assigned to match those 
specified by Troy Kisky in his introduction of ping-pong buffers for dm644x.

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

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index a7b41bf..2ee1a6f 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -722,10 +722,13 @@ 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,
+	.sram_size_capture = SZ_8K,
 };
 
 static const short da850_evm_mcasp_pins[] __initconst = {
-- 
1.7.4.1

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

* Re: [PATCH 0/2] ASoC: davinci: ping-pong buffers for mcasp on da850evm
  2011-05-18 13:27 [PATCH 0/2] ASoC: davinci: ping-pong buffers for mcasp on da850evm Ben Gardiner
  2011-05-18 13:27 ` [PATCH 1/2] ASoC: davinci-mcasp: enable ping-pong SRAM buffers Ben Gardiner
  2011-05-18 13:27 ` [PATCH 2/2] davinci: da850evm: enable mcasp ping-pong bufs and evq's Ben Gardiner
@ 2011-05-19 11:08 ` Liam Girdwood
  2 siblings, 0 replies; 8+ messages in thread
From: Liam Girdwood @ 2011-05-19 11:08 UTC (permalink / raw)
  To: Ben Gardiner
  Cc: alsa-devel, Subhasish Ghosh, Mark Brown, Nori, Sekhar,
	davinci-linux-open-source, Troy Kisky

On 18/05/11 14:27, Ben Gardiner wrote:
> davinci-i2s enables the use of ping-pong buffers by copying the sram sizes
> specified by platform data into the dma params used by davinci-pcm.
> 
> This patch series first implements that same behaviour in davinic-mcasp
> and then specified sram sizes and eventq's for da850evm.
> 
> To achieve the use of ping-pong buffers at runtime this patch depends also
> on the conversion of da850's SRAM allocator to the "Share RAM" region from 
> the "ARM Local RAM" region -- originally proposed by Subhasish Ghosh[1] and
> recently reposted by myself [2].
> 
> This is because the "ARM Local RAM" region currently used by the da850 SRAM
> allocator is not addressable by the EDMA. The resulting behaviour, when
> ping-pong buffers are used by davinci-pcm, is that playback produces silence
> and capture acquires silence.
> 
> However, there is no change in behaviour for da850evm build with the in-tree
> defconfig since suspend allocates SRAM which prevents a successful allocation
> of 8K by davinci-pcm and thus the behaviour falls back to the usual scheme.
> 
> In the case of da850evm builds where CONFIG_SUSPEND is not set, playback 
> will produce silence and capture will acquire silence until such time as the
> patches to change the da850 SRAM allocator to the "Shared RAM" region are 
> merged.
> 
> [1] http://article.gmane.org/gmane.linux.kernel/1098928
> [2] http://article.gmane.org/gmane.linux.ports.arm.kernel/117261
> 
> Ben Gardiner (2):
>   ASoC: davinci-mcasp: enable ping-pong SRAM buffers
>   davinci: da850evm: enable mcasp ping-pong buffers and eventq's
> 
>  arch/arm/mach-davinci/board-da850-evm.c |    5 ++++-
>  sound/soc/davinci/davinci-mcasp.c       |    2 ++
>  2 files changed, 6 insertions(+), 1 deletions(-)
> 

Both

Acked-by: Liam Girdwood <lrg@ti.com>

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

* Re: [PATCH 1/2] ASoC: davinci-mcasp: enable ping-pong SRAM buffers
  2011-05-18 13:27 ` [PATCH 1/2] ASoC: davinci-mcasp: enable ping-pong SRAM buffers Ben Gardiner
@ 2011-05-19 21:13   ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2011-05-19 21:13 UTC (permalink / raw)
  To: Ben Gardiner
  Cc: davinci-linux-open-source, Subhasish Ghosh, Sekhar Nori,
	alsa-devel, Troy Kisky, Liam Girdwood

On Wed, May 18, 2011 at 09:27:45AM -0400, Ben Gardiner wrote:
> 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 davinci-mcasp probe.
> 
> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>

Applied, thanks.

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

* Re: [PATCH 2/2] davinci: da850evm: enable mcasp ping-pong bufs and evq's
  2011-05-18 13:27 ` [PATCH 2/2] davinci: da850evm: enable mcasp ping-pong bufs and evq's Ben Gardiner
@ 2011-05-19 21:14   ` Mark Brown
       [not found]     ` <20110519211406.GE18849-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2011-05-19 21:14 UTC (permalink / raw)
  To: Ben Gardiner
  Cc: davinci-linux-open-source, Subhasish Ghosh, Sekhar Nori,
	alsa-devel, Troy Kisky, Liam Girdwood

On Wed, May 18, 2011 at 09:27:46AM -0400, Ben Gardiner wrote:
> The davinci-mcasp driver will copy the platform data specified sram sizes and
> eventq's.
> 
> Set the event queues and sram sizes for da850. 8K SRAM buffers are selected
> because it is the minimum that resulted in the same period size when testing
> 48KHz S16_LE stereo. Event queues 0 and 1 are assigned to match those 
> specified by Troy Kisky in his introduction of ping-pong buffers for dm644x.
> 
> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>

Davinci folks, are you OK with this?

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

* RE: [PATCH 2/2] davinci: da850evm: enable mcasp ping-pong bufs and evq's
       [not found]     ` <20110519211406.GE18849-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
@ 2011-05-20  7:08       ` Nori, Sekhar
  2011-05-20  9:05         ` Liam Girdwood
  0 siblings, 1 reply; 8+ messages in thread
From: Nori, Sekhar @ 2011-05-20  7:08 UTC (permalink / raw)
  To: Mark Brown, Ben Gardiner
  Cc: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
	Subhasish Ghosh, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Girdwood,
	Liam

Hi Mark,

On Fri, May 20, 2011 at 02:44:06, Mark Brown wrote:
> On Wed, May 18, 2011 at 09:27:46AM -0400, Ben Gardiner wrote:
> > The davinci-mcasp driver will copy the platform data specified sram sizes and
> > eventq's.
> > 
> > Set the event queues and sram sizes for da850. 8K SRAM buffers are selected
> > because it is the minimum that resulted in the same period size when testing
> > 48KHz S16_LE stereo. Event queues 0 and 1 are assigned to match those 
> > specified by Troy Kisky in his introduction of ping-pong buffers for dm644x.
> > 
> > Signed-off-by: Ben Gardiner <bengardiner-ScDXFp4xN3PN+rMO2ozGnw@public.gmane.org>
> 
> Davinci folks, are you OK with this?

No, please don't merge this just yet. As Ben mentioned in his cover
letter, the default SRAM pool on DA850 is not suitable for Audio
transfers. This patch depends on SRAM not being available for audio
usage in spite of the platform asking for it. This is liable to break.

The SRAM allocation on DaVinci and OMAP is under a bit of flux and
once that is sorted out, this patch should be safe to merge. So,
this probably needs to wait for 2.6.41.

Thanks,
Sekhar

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

* Re: [PATCH 2/2] davinci: da850evm: enable mcasp ping-pong bufs and evq's
  2011-05-20  7:08       ` Nori, Sekhar
@ 2011-05-20  9:05         ` Liam Girdwood
  0 siblings, 0 replies; 8+ messages in thread
From: Liam Girdwood @ 2011-05-20  9:05 UTC (permalink / raw)
  To: Nori, Sekhar, Ben Gardiner
  Cc: Subhasish Ghosh, alsa-devel, Mark Brown,
	davinci-linux-open-source, Troy Kisky

On 20/05/11 08:08, Nori, Sekhar wrote:
> Hi Mark,
> 
> On Fri, May 20, 2011 at 02:44:06, Mark Brown wrote:
>> On Wed, May 18, 2011 at 09:27:46AM -0400, Ben Gardiner wrote:
>>> The davinci-mcasp driver will copy the platform data specified sram sizes and
>>> eventq's.
>>>
>>> Set the event queues and sram sizes for da850. 8K SRAM buffers are selected
>>> because it is the minimum that resulted in the same period size when testing
>>> 48KHz S16_LE stereo. Event queues 0 and 1 are assigned to match those 
>>> specified by Troy Kisky in his introduction of ping-pong buffers for dm644x.
>>>
>>> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
>>
>> Davinci folks, are you OK with this?
> 
> No, please don't merge this just yet. As Ben mentioned in his cover
> letter, the default SRAM pool on DA850 is not suitable for Audio
> transfers. This patch depends on SRAM not being available for audio
> usage in spite of the platform asking for it. This is liable to break.
> 
> The SRAM allocation on DaVinci and OMAP is under a bit of flux and
> once that is sorted out, this patch should be safe to merge. So,
> this probably needs to wait for 2.6.41.
> 

Ok.

Sekhar, Ben, please resend with Acks when the DaVinci depedencies have been merged.

Thanks

Liam

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

end of thread, other threads:[~2011-05-20  9:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-18 13:27 [PATCH 0/2] ASoC: davinci: ping-pong buffers for mcasp on da850evm Ben Gardiner
2011-05-18 13:27 ` [PATCH 1/2] ASoC: davinci-mcasp: enable ping-pong SRAM buffers Ben Gardiner
2011-05-19 21:13   ` Mark Brown
2011-05-18 13:27 ` [PATCH 2/2] davinci: da850evm: enable mcasp ping-pong bufs and evq's Ben Gardiner
2011-05-19 21:14   ` Mark Brown
     [not found]     ` <20110519211406.GE18849-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-05-20  7:08       ` Nori, Sekhar
2011-05-20  9:05         ` Liam Girdwood
2011-05-19 11:08 ` [PATCH 0/2] ASoC: davinci: ping-pong buffers for mcasp on da850evm Liam Girdwood

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.