All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Galakhov <agalakhov@gmail.com>
To: Boojin Kim <boojin.kim@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org, ben-linux@fluff.org,
	Kukjin Kim <kgene.kim@samsung.com>
Subject: S3C2440 DMA broken
Date: Wed, 30 Jan 2013 19:10:13 +0600	[thread overview]
Message-ID: <51091BB5.2000400@gmail.com> (raw)

Hello,

I found that audio on S3C2440 was broken since commit 344b4c4 (ASoC:
Samsung: Update DMA interface). Each audio buffer is played multiple times.

An investigation of the issue has shown that it is caused by incorrect
buffer length passed to s3c2410_dma_enqueue() in the s3c_dma_prepare()
function (file arch/arm/plat-samsung/s3c-dma-ops.c). To be more precise:

int len = (param->cap == DMA_CYCLIC) ? param->period : param->len;

The buffer length is set in sound/soc/samsung/dma.c like that:

dma_info.period = prtd->dma_period;
dma_info.len = prtd->dma_period*limit;

So the "limit" multiplier is used twice. To prove it, I changed the line
in s3c-dma-ops.c to the following:

int len = /*(param->cap == DMA_CYCLIC)*/1 ? param->period : param->len;

and the audio was played correctly.

What is the intended behavior of s3c_dma_prepare()? Where shoild the
length to be fixed - in s3c_dma_prepare() or in dma.c ?

Regards,
--
Alex

                 reply	other threads:[~2013-01-30 13:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51091BB5.2000400@gmail.com \
    --to=agalakhov@gmail.com \
    --cc=ben-linux@fluff.org \
    --cc=boojin.kim@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.