linux-kernel-test/sound/soc
Oskar Schirmer d6437c14df ASoC: fsl: imx-pcm-fiq: remove bogus period delta calculation
Originally snd_hrtimer_callback() used iprtd->period_time for
some jiffies based estimation to determine the right moment
to call snd_pcm_period_elapsed(). As timer drifts may well be a
problem, this was changed in commit b4e82b5b78 to be based
on buffer transmission progress, using iprtd->offset and
runtime->buffer_size to calculate the amount of data since last
period had elapsed.

Unfortunately, iprtd->offset counts in bytes, while
runtime->buffer_size counts frames, so adding these to find some
delta is like comparing apples and oranges, and eventually results
in negative delta values every now and then. This is no big harm,
because it simply causes snd_pcm_period_elapsed() being called
more often than necessary, as negative delta is taken for a
large unsigned value by implicit conversion rule.
Nonetheless, the calculation is broken, so one would replace
the runtime->buffer_size by its equivalent in bytes.

But then, there are chances snd_pcm_period_elapsed() is called
late, because calculating the moment for the elapsed period
into delta is based against the iprtd->last_offset, which is not
necessarily the first byte of the period in question, but some
random byte which the FIQ handler left us with in r8/r9 by
accident. Again, negative impact is low, as there are plenty of
periods already prefilled with data, and snd_pcm_period_elapsed()
will probably be called latest when the following period is
reached. However, the calculation is conceptually broken, and we
are best off removing the clever stuff altogether.

snd_pcm_period_elapsed() is now simply called once everytime
snd_hrtimer_callback() is run, which may not be most accurate,
but at least this way we are quite sure we dont miss an end of
period. There is not much extra effort wasted by superfluous
calls to snd_pcm_period_elapsed(), as the timer frequency
closely matches the period size anyway.

Signed-off-by: Oskar Schirmer <oskar@scara.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:13:19 +00:00
..
atmel ASoC: atmel: Include linux/of.h header 2013-10-16 19:03:15 +01:00
au1x Merge remote-tracking branch 'asoc/topic/au1x' into asoc-next 2013-08-22 14:28:29 +01:00
blackfin ASoC: blackfin: Add missing break statement to bf6xx 2013-09-17 00:47:14 +01:00
cirrus Merge remote-tracking branch 'asoc/topic/ep93xx' into asoc-next 2013-10-24 11:24:06 +01:00
codecs Merge remote-tracking branch 'asoc/topic/wm8996' into asoc-next 2013-11-03 22:04:22 -08:00
davinci ASoC: davinci-evm: Add device tree binding 2013-10-23 16:43:07 +01:00
dwc ASoC: designware_i2s: Remove unnecessary dev_set_drvdata() 2013-08-29 13:18:32 +01:00
fsl ASoC: fsl: imx-pcm-fiq: remove bogus period delta calculation 2013-12-02 11:13:19 +00:00
generic ASoC: simple-card: un-implemented set_fmt is not error 2013-10-20 17:28:02 +01:00
jz4740
kirkwood ASoC: kirkwood: Fix compile error due to patch 'add S/PDIF support' 2013-10-25 09:12:39 +01:00
mid-x86 ASoC: mfld: Use devm_snd_soc_register_card 2013-09-19 14:57:37 +01:00
mxs Merge remote-tracking branch 'asoc/topic/mxs' into asoc-next 2013-10-24 11:24:09 +01:00
nuc900 ASoC: nuc900: don't check resource with devm_ioremap_resource 2013-07-24 15:34:16 +01:00
omap Merge remote-tracking branch 'asoc/topic/devm' into asoc-next 2013-10-24 11:24:04 +01:00
pxa Merge remote-tracking branch 'asoc/topic/pxa' into asoc-next 2013-10-24 11:24:10 +01:00
s6000 ASoC: s6105-ipcam: Fix incorrect placement of __initdata 2013-08-08 14:27:59 +01:00
samsung Merge remote-tracking branch 'asoc/topic/samsung' into asoc-next 2013-11-03 22:04:20 -08:00
sh Merge remote-tracking branch 'asoc/topic/rcar' into asoc-next 2013-11-03 22:04:19 -08:00
spear ASoC: SPEAr spdif_out: Remove redundant variable 2013-09-19 12:56:26 +01:00
tegra Merge remote-tracking branch 'asoc/topic/tegra' into asoc-next 2013-10-24 11:24:14 +01:00
txx9 ASoC: txx9: don't check resource with devm_ioremap_resource 2013-07-24 15:37:48 +01:00
ux500 ASoC: mop500: add .owner to struct snd_soc_card 2013-07-15 11:12:24 +01:00
Kconfig ALSA: move dmaengine implementation from ASoC to ALSA core 2013-08-15 11:18:09 +01:00
Makefile ASoC: core: Implement devm_snd_soc_register_component() 2013-09-17 00:49:57 +01:00
soc-cache.c ASoC: Remove infrastructure for supporting multiple cache types 2013-09-17 00:37:03 +01:00
soc-compress.c ASoC: compress: Use power efficient workqueue 2013-08-12 11:04:54 +01:00
soc-core.c Merge remote-tracking branch 'asoc/topic/core' into asoc-next 2013-11-03 22:04:15 -08:00
soc-dapm.c Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus 2013-11-03 22:04:12 -08:00
soc-devres.c ASoC: core: Add devm_snd_soc_register_card() 2013-09-17 00:50:06 +01:00
soc-generic-dmaengine-pcm.c ASoC: dmaengine: Use SNDRV_PCM_STREAM_LAST for array size 2013-10-25 21:14:26 +01:00
soc-io.c ASoC: Remove snd_soc_bulk_write_raw() 2013-09-17 00:37:03 +01:00
soc-jack.c ASoC: dont call dapm_sync while reporting jack always 2013-10-22 09:29:02 +01:00
soc-pcm.c ASoC: dpcm: improve robustness 2013-10-31 10:57:47 -07:00
soc-utils.c ASoC: core utils: Dont set DMA params for BE substreams 2013-09-17 00:37:03 +01:00