All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@nokia.com>
To: ext Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Tony Lindgren <tony@atomide.com>,
	"Nurkkala Eero.An (EXT-Offcode/Oulu)"
	<ext-Eero.Nurkkala@nokia.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"lrg@slimlogic.co.uk" <lrg@slimlogic.co.uk>
Subject: Re: [PATCHv2 0/5] FIFO caused playback delay (latency) handling in soc/omap
Date: Fri, 12 Mar 2010 08:18:30 +0200	[thread overview]
Message-ID: <201003120818.30290.peter.ujfalusi@nokia.com> (raw)
In-Reply-To: <186E584F-F553-44F0-A49D-361BB76E0EE4@opensource.wolfsonmicro.com>

On Friday 12 March 2010 00:43:41 ext Mark Brown wrote:

> I can do, though there was some debate about how useful the
> information the hardware returns actually is - could folks confirm
> what the consensus there was, please?

Yeah, that thread went silent without final go or no go...

I do agree with Eero, that the BUFFSTAT register is not the most reliable source 
of information, but I still believe that the way we are going to use it will 
give pretty close to the reality estimation on the statuses.
Eero also mentioned timestamp based estimation, which I think can also be used 
in this way:
In element mode, we just return the delay as the whole size of the buffer (which 
is not accurate when we initially fill the buffer, and when we drain it at the 
end, but it is not a real problem).
In threshold mode, than we can take timestamp at DMA completion interrupts, and 
calculate the delay based on the FIFO size (FIFO size - samples played out since 
the last timstamp). This can also give false numbers at the start of the 
playback (for few periods, until the buffer utilization settles).

So the timestamp based solution looks good, but it is only usable when the codec 
is running synchronously. It will definitely falls apart as soon as we use a 
codec like tlv320dac33 in burst mode (FIFO on the codec as well).
We could have ~100 ms between DMA interrupts, so the countdown for McBSP FIFO 
usage is already broken.
Furthermore since there is no way at the moment to actually synchronize the 
omap-mcbsp, omap-pcm and tlv320dac33 (in DMA, McBSP threshold, McBSP mode and 
DAC33 mode sense), there could be cases, that this big silence on the bus (when 
DAC33 is playing from it's buffer) is not happening exactly after the DMA filled 
up the McBSP FIFO, but a bit later (could be just one sample away from the next 
McBSP threshold event), which means that the McBSP FIFO is nowhere near to be 
full.
In this case the BUFFSTAT register would give good estimation, than any 
timestamp based solution for McBSP FIFO.

All in all, I think the usage of the BUFFSTAT register is a good compromise for 
all cases, and it is needed for the cases, where the codec also have buffer of 
it's own.
Never the less, we can also add the timestamp based estimation later, but we 
need to make sure, that those can be picked somehow for the given setup.

-- 
Péter

  reply	other threads:[~2010-03-12  6:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-03 13:08 [PATCHv2 0/5] FIFO caused playback delay (latency) handling in soc/omap Peter Ujfalusi
2010-03-03 13:08 ` [PATCHv2 1/5] ASoC: core: fix tailing whitespace in soc_pcm_apply_symmetry Peter Ujfalusi
2010-03-03 13:27   ` [alsa-devel] " Liam Girdwood
2010-03-03 13:08 ` [PATCH] OMAP3: PM: Enable wake-up from McBSP2, 3 and 4 modules Peter Ujfalusi
2010-03-03 14:08   ` Peter Ujfalusi
2010-03-03 14:46   ` Jarkko Nikula
2010-03-03 13:08 ` [PATCHv2 2/5] ASoC: core: soc level wrapper for pcm_pointer callback Peter Ujfalusi
2010-03-03 13:27   ` [alsa-devel] " Liam Girdwood
2010-03-03 13:08 ` [PATCHv2 3/5] ASoC: core: Add delay operation to snd_soc_dai_ops Peter Ujfalusi
2010-03-03 13:28   ` Liam Girdwood
2010-03-03 13:08 ` [PATCHv2 4/5] OMAP3: McBSP: Add interface for FIFO caused delay query Peter Ujfalusi
2010-03-03 14:38   ` Jarkko Nikula
2010-03-03 13:08 ` [PATCHv2 5/5] ASoC: OMAP3: Report delay caused by the internal FIFO Peter Ujfalusi
2010-03-03 13:28   ` Liam Girdwood
2010-03-03 14:30     ` Jarkko Nikula
2010-03-03 13:38 ` [PATCHv2 0/5] FIFO caused playback delay (latency) handling in soc/omap Mark Brown
2010-03-11 22:26   ` Tony Lindgren
2010-03-11 22:43     ` Mark Brown
2010-03-12  6:18       ` Peter Ujfalusi [this message]
2010-03-12  8:30         ` Jarkko Nikula
2010-03-12 11:12           ` Mark Brown

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=201003120818.30290.peter.ujfalusi@nokia.com \
    --to=peter.ujfalusi@nokia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=ext-Eero.Nurkkala@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=tony@atomide.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.