1
0
Fork 0
alistair23-linux/sound
David Dillow 5daeba34d2 ALSA: pcm_lib: avoid timing jitter in snd_pcm_read/write()
When using poll() to wait for the next period -- or avail_min samples --
one gets a consistent delay for each system call that is usually just a
little short of the selected period time. However, When using
snd_pcm_read/write(), one gets a jittery delay that alternates between
less than a millisecond and approximately two period times. This is
caused by snd_pcm_lib_{read,write}1() transferring any available samples
to the user's buffer and adjusting the application pointer prior to
sleeping to the end of the current period. When the next period
interrupt occurs, there is then less than avail_min samples remaining to
be transferred in the period, so we end up sleeping until a second
period occurs.

This is solved by using runtime->twake as the number of samples needed
for a wakeup in addition to selecting the proper wait queue to wake in
snd_pcm_update_state(). This requires twake to be non-zero when used
by snd_pcm_lib_{read,write}1() even if avail_min is zero.

Signed-off-by: Dave Dillow <dave@thedillows.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-06-28 09:42:09 +02:00
..
aoa Merge remote branch 'origin' into secretlab/next-devicetree 2010-05-22 00:36:56 -06:00
arm Merge remote branch 'alsa/devel' into topic/misc 2010-04-16 15:20:06 +02:00
atmel ALSA: AC97: add full duplex support for atmel AT91 and AVR. 2010-03-25 20:22:36 +01:00
core ALSA: pcm_lib: avoid timing jitter in snd_pcm_read/write() 2010-06-28 09:42:09 +02:00
drivers Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 2010-05-20 09:41:44 -07:00
i2c Merge remote branch 'alsa/devel' into topic/misc 2010-04-16 15:20:06 +02:00
isa Merge branch 'topic/misc' into for-linus 2010-05-20 11:59:29 +02:00
mips sound: Add missing spin_unlock 2010-05-27 09:47:02 +02:00
oss sound: Add missing spin_unlock 2010-05-27 09:47:02 +02:00
parisc ALSA: sound/parisc: Move dereference after NULL test 2009-10-30 12:01:38 +01:00
pci ALSA: hda-intel - fix wallclk variable update and condition 2010-06-02 13:34:18 +02:00
pcmcia pcmcia: dev_node removal (write-only drivers) 2010-05-10 10:23:14 +02:00
ppc Merge remote branch 'alsa/devel' into topic/misc 2010-04-16 15:20:06 +02:00
sh include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
soc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 2010-05-29 15:31:57 -07:00
sparc of: Remove duplicate fields from of_platform_driver 2010-05-22 00:10:40 -06:00
spi ALSA: Convert to snd_card_create() in other sound/* 2009-01-12 15:21:19 +01:00
synth include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
usb Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 2010-05-29 15:31:57 -07:00
Kconfig tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
Makefile ALSA: Add Atmel ALSA drivers directory 2009-02-05 15:08:53 +01:00
ac97_bus.c ALSA: ac97 - Include ac97_codec.h for ac97_bus_type declaration 2008-12-02 16:25:37 +01:00
last.c [ALSA] Remove sound/driver.h 2008-01-31 17:29:48 +01:00
sound_core.c ALSA: use subsys_initcall for sound core instead of module_init 2010-01-14 21:21:47 +01:00
sound_firmware.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00