All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaroslav Kysela <perex@perex.cz>
To: Takashi Iwai <tiwai@suse.de>
Cc: Vinod Koul <vinod.koul@linux.intel.com>,
	broonie@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org,
	lrg@ti.com
Subject: Re: [PATCH] ALSA: pcm - introduce soc_delay
Date: Mon, 23 Jul 2012 12:47:19 +0200	[thread overview]
Message-ID: <500D2BB7.2010802@perex.cz> (raw)
In-Reply-To: <s5hvcheu60x.wl%tiwai@suse.de>

Date 23.7.2012 12:27, Takashi Iwai wrote:
> At Mon, 23 Jul 2012 15:36:37 +0530,
> Vinod Koul wrote:
>>
>> In many modern SoCs the audio DSP can buffer the PCM ring buffer data. Today we
>> have no means to represent this buffering and ALSA wrongly detects an overrun
>> when hw_ptr reaches app_ptr value, though DSP may still have some buffered data.
>>
>> This patch tries to add a new field "soc_delay" to represent buffering done in
>> DSPs. This value is also used for the xrun calculations in ALSA.
>>
>> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
>>
>> --
>> Once we are okay with this approach, I will send a follow up patch which adds
>> this notion in ASoC and uses this to compute cpu_dai delay. The codec_dai delay
>> along with FIFO delay from cpu_dai should be added and reresented by today's
>> notion of delay.
> 
> Hmm, it's confusing to have both delay and soc_delay fields.
> 
> And, if the XRUN detection is the only problem, we can provide a flag
> to correct avail with runtime->delay.

I agree. The runtime->delay variable should handle all situations for
queued samples.

But the point is - we have data in some FIFO, but the DMA ring buffer is
empty. If you use the delay value in the snd_pcm_update_state(), you'll
probably allow to transfer invalid samples to the FIFO (probably
previous samples from the ring buffer, because application has not
provided new ones). That was the purpose of the check.

Of course, if you stop DMA according the appl_ptr and wait on
application to provide new data in the "FIFO time window", then the
check should be updated for this type of hw.

					Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project; Red Hat, Inc.

  parent reply	other threads:[~2012-07-23 10:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-23 10:06 [PATCH] ALSA: pcm - introduce soc_delay Vinod Koul
2012-07-23 10:18 ` Mark Brown
2012-07-23 10:39   ` Vinod Koul
2012-07-23 10:47     ` Mark Brown
2012-07-23 11:06       ` Vinod Koul
2012-07-23 13:47         ` Mark Brown
2012-07-23 19:51       ` Pierre-Louis Bossart
2012-07-23 20:05         ` Mark Brown
2012-07-23 20:16           ` Pierre-Louis Bossart
2012-07-23 21:27             ` Mark Brown
2012-07-23 14:21     ` Jassi Brar
2012-07-23 10:19 ` Jassi Brar
2012-07-23 10:39   ` Vinod Koul
2012-07-23 10:50     ` Jassi Brar
2012-07-23 11:17       ` Vinod Koul
2012-07-23 11:23         ` Mark Brown
2012-07-23 13:37         ` Jassi Brar
2012-07-23 10:27 ` Takashi Iwai
2012-07-23 10:47   ` Vinod Koul
2012-07-23 10:47   ` Jaroslav Kysela [this message]
2012-07-23 11:14     ` Vinod Koul

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=500D2BB7.2010802@perex.cz \
    --to=perex@perex.cz \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lrg@ti.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@linux.intel.com \
    /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.