[alsa-devel] [RFC update 0/2] dmaengine/ASoC: omap: Enable element mode in cyclic DMA
Hi Russell,
Enable the element mode (thus allowing mono playback and probably unblocking OMAP1, OMAP2420) in OMAP dmaengine and omap-pcm.
Janusz: would it be possible for you to test Russell's series plus this on OMAP1 to make sure that we do not broke it?
Russell: we should wait for Janusz to test this on OMAP1. Based on the feedback we can plan on how to proceed with the dmaengine for OMAP audio.
Regards, Peter --- Peter Ujfalusi (2): dmaengine: omap: Support for element mode in cyclic DMA ASoC: omap-pcm: Do not check DMA sync_mode
drivers/dma/omap-dma.c | 5 ++++- sound/soc/omap/omap-pcm.c | 10 ---------- 2 files changed, 4 insertions(+), 11 deletions(-)
When src_maxburst/dst_maxburst is set to 0 by the users of cyclic DMA (mostly audio) indicates that we should configure the omap DMA to element sync mode instead of packet mode.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- drivers/dma/omap-dma.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index ae05618..b77a40d 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c @@ -413,7 +413,10 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_cyclic( d->dev_addr = dev_addr; d->fi = burst; d->es = es; - d->sync_mode = OMAP_DMA_SYNC_PACKET; + if (burst) + d->sync_mode = OMAP_DMA_SYNC_PACKET; + else + d->sync_mode = OMAP_DMA_SYNC_ELEMENT; d->sync_type = sync_type; d->periph_port = OMAP_DMA_PORT_MPUI; d->sg[0].addr = buf_addr;
OMAP dmaengine now supports element mode also in cyclic DMA so we do not need to block non PACKET modes.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap-pcm.c | 10 ---------- 1 file changed, 10 deletions(-)
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index 50ae048..0f88db3 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c @@ -32,7 +32,6 @@ #include <sound/pcm_params.h> #include <sound/soc.h>
-#include <plat/dma.h> /* needed just for OMAP_DMA_SYNC_PACKET */ #include "omap-pcm.h"
static const struct snd_pcm_hardware omap_pcm_hardware = { @@ -83,15 +82,6 @@ static int omap_pcm_hw_params(struct snd_pcm_substream *substream, return 0; prtd->dma_data = dma_data;
- /* - * This is the only parameter we don't handle with DMA - * engine - so we insist on OMAP_DMA_SYNC_PACKET here. - */ - if (dma_data->sync_mode != OMAP_DMA_SYNC_PACKET) { - pr_warn("ALSA: omap-dma: DMA using non-packet mode?\n"); - return -EINVAL; - } - req = dma_data->dma_req; err = snd_dmaengine_pcm_open(substream, omap_dma_filter_fn, &req); if (err)
On Tue, 4 Sep 2012 15:08:00 Peter Ujfalusi wrote:
Hi Russell,
Enable the element mode (thus allowing mono playback and probably unblocking OMAP1, OMAP2420) in OMAP dmaengine and omap-pcm.
Janusz: would it be possible for you to test Russell's series plus this on OMAP1 to make sure that we do not broke it?
Hi Peter, Russell, I'll be happy to make this test for you. This will take some time (I work away from home), but I expect to have it done by Monday.
BTW, I haven't been following OMAP development very closely last weeks, and I didn't even know about the OMAP DMA engine availability. Which Linux version should I base my test on? Would 3.6-rc be OK? Or l-o master?
Thanks, Janusz
On Tue, 4 Sep 2012 15:08:00 Peter Ujfalusi wrote:
Enable the element mode (thus allowing mono playback and probably
unblocking
OMAP1, OMAP2420) in OMAP dmaengine and omap-pcm.
Janusz: would it be possible for you to test Russell's series plus
this on
OMAP1 to make sure that we do not broke it?
Hi, I can confirm that sound works for me as before, both capture and playback, on my OMAP1 Amstrad Delta with Russell's and Peter's patches applied on top of linux-3.6-rc3, with the OMAP DMA engine driver built in. I was not able make audible tests with applications other than a soft phone as I didn't get back home for this weekend, but I think that the asterisk soft phone is quite a demanding use case.
The only thing I'm not sure about is why the sysfs provided bytes_transferred values never change from their initial zeros.
For OMAP1: Tested-by: Janusz Krzysztofik jkrzyszt@tis.icnet.pl
Thanks, Janusz
Hi Janusz,
On 09/09/2012 10:57 PM, Janusz Krzysztofik wrote:
On Tue, 4 Sep 2012 15:08:00 Peter Ujfalusi wrote:
Enable the element mode (thus allowing mono playback and probably
unblocking
OMAP1, OMAP2420) in OMAP dmaengine and omap-pcm.
Janusz: would it be possible for you to test Russell's series plus
this on
OMAP1 to make sure that we do not broke it?
Hi, I can confirm that sound works for me as before, both capture and playback, on my OMAP1 Amstrad Delta with Russell's and Peter's patches applied on top of linux-3.6-rc3, with the OMAP DMA engine driver built in. I was not able make audible tests with applications other than a soft phone as I didn't get back home for this weekend, but I think that the asterisk soft phone is quite a demanding use case.
Thank you very much for taking time to test this! This is indeed a good news.
The only thing I'm not sure about is why the sysfs provided bytes_transferred values never change from their initial zeros.
I have not looked at those files in sysfs, but if the same applies for OMAP3/4/5 I can look at it and fix it which should correct OMAP1 at the same time.
For OMAP1: Tested-by: Janusz Krzysztofik jkrzyszt@tis.icnet.pl
Again, thanks for the testing, Péter
participants (2)
-
Janusz Krzysztofik
-
Peter Ujfalusi