alsa-lib/src/pcm
Andreas Pape 9219034301 pcm: direct: fix race on clearing timer events
snd_timer handling is racy: plugins clear timer queue if avail_min
is not reached to force a sleep on timer. The race can happen if
the expected event arrives in between the avail check and the
clearing of pending events. If this race happens, the user will
unnecessarily wait for one more timer event. On low latency/realtime
streams this can lead to xruns and must be avoided.

As a fix we recheck avail after having cleared poll events.

Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Mounesh Sutar <sutar.mounesh@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-17 18:38:08 +01:00
..
scopes Change .so module name and installation patch (/usr/lib/alsa-lib/scopes) 2005-06-07 11:31:18 +00:00
interval.c Removed more asserts 2003-05-28 18:49:15 +00:00
interval.h Make local functions really local 2007-11-30 18:26:13 +01:00
interval_inline.h Added snd_interval_set_min_max()... 2003-02-17 10:21:24 +00:00
ladspa.h big ALSA LADSPA plugin rewrite for multiple channel LADSPA plugins 2005-12-13 14:08:58 +00:00
Makefile.am pcm: Remove home brew atomic operations 2016-07-11 15:25:30 +02:00
mask.c Updated GNU GPL license (address). 2001-12-30 09:22:54 +00:00
mask.h Enhanced bitmasks in PCM - added support for more formats by Takashi and me 2002-06-26 02:04:11 +00:00
mask_inline.h Removed more asserts 2003-05-28 18:49:15 +00:00
pcm.c pcm: Disable locking in async mode 2017-02-09 17:29:21 +01:00
pcm_adpcm.c Introduce bswap.h for portable definitions of byte swap macros. 2016-03-03 16:18:10 +01:00
pcm_alaw.c Introduce bswap.h for portable definitions of byte swap macros. 2016-03-03 16:18:10 +01:00
pcm_asym.c Set PCM name properly in empty and asym plugins 2007-11-26 12:29:37 +01:00
pcm_copy.c Introduce bswap.h for portable definitions of byte swap macros. 2016-03-03 16:18:10 +01:00
pcm_direct.c pcm: direct: fix race on clearing timer events 2017-02-17 18:38:08 +01:00
pcm_direct.h pcm: direct: fix race on clearing timer events 2017-02-17 18:38:08 +01:00
pcm_dmix.c pcm: dmix_rewind corrupts application pointer fix 2017-02-17 18:35:03 +01:00
pcm_dmix_generic.c Introduce bswap.h for portable definitions of byte swap macros. 2016-03-03 16:18:10 +01:00
pcm_dmix_i386.c pcm: dmix: Allow disabling x86 optimizations 2017-02-10 12:16:12 +01:00
pcm_dmix_i386.h pcm dmix plugin: fix MIX_AREAS_24 routine for i386 & x86_64 platforms 2009-06-16 20:10:19 +02:00
pcm_dmix_x86_64.c pcm: dmix: Allow disabling x86 optimizations 2017-02-10 12:16:12 +01:00
pcm_dmix_x86_64.h pcm dmix plugin: fix MIX_AREAS_24 routine for i386 & x86_64 platforms 2009-06-16 20:10:19 +02:00
pcm_dshare.c pcm: direct: don't return bogus buffer levels in xrun state 2017-01-10 09:24:39 +01:00
pcm_dsnoop.c pcm: direct: don't return bogus buffer levels in xrun state 2017-01-10 09:24:39 +01:00
pcm_empty.c Set PCM name properly in empty and asym plugins 2007-11-26 12:29:37 +01:00
pcm_ext_parm.h Make local functions really local 2007-11-30 18:26:13 +01:00
pcm_extplug.c pcm: ioplug,extplug: Fix logic errors in type checks 2015-09-08 20:57:47 +02:00
pcm_file.c pcm: file: update linked hw_ptr and appl_ptr 2016-12-14 15:43:43 +01:00
pcm_generic.c pcm: Add thread-safety to PCM API 2016-07-11 15:25:30 +02:00
pcm_generic.h PCM: Avoid busy loop in snd_pcm_write_areas() with rate plugin 2012-11-13 16:16:26 +01:00
pcm_hooks.c pcm: remove alloca() from _snd_pcm_hook_ctl_elems_install() 2016-07-14 16:33:48 +02:00
pcm_hw.c pcm: Add the PCM state checks to plugins 2016-11-29 16:22:20 +01:00
pcm_iec958.c Introduce bswap.h for portable definitions of byte swap macros. 2016-03-03 16:18:10 +01:00
pcm_ioplug.c pcm: fix return value of snd_pcm_ioplug_sw_params() 2016-07-13 16:37:01 +02:00
pcm_ladspa.c pcm: ladspa: Fix segfault due to a wrong channel reference 2015-10-02 11:55:36 +02:00
pcm_lfloat.c Introduce bswap.h for portable definitions of byte swap macros. 2016-03-03 16:18:10 +01:00
pcm_linear.c Introduce bswap.h for portable definitions of byte swap macros. 2016-03-03 16:18:10 +01:00
pcm_local.h pcm: Add the PCM state checks to plugins 2016-11-29 16:22:20 +01:00
pcm_meter.c pcm: Remove superfluous rmb() from PCM meter plugin 2016-07-07 16:30:54 +02:00
pcm_misc.c Introduce bswap.h for portable definitions of byte swap macros. 2016-03-03 16:18:10 +01:00
pcm_mmap.c pcm: Add thread-safety to PCM API 2016-07-11 15:25:30 +02:00
pcm_mmap_emul.c pcm: Implement timestamp type handling in all plugins 2014-07-14 18:12:34 +02:00
pcm_mulaw.c Introduce bswap.h for portable definitions of byte swap macros. 2016-03-03 16:18:10 +01:00
pcm_multi.c pcm: multi: Drop the fixed slave_map[] in snd_pcm_multi_open() 2017-01-27 12:05:32 +01:00
pcm_null.c Introduce bswap.h for portable definitions of byte swap macros. 2016-03-03 16:18:10 +01:00
pcm_params.c pcm: Don't assert in _snd_pcm_hw_params_internal() 2015-06-01 13:46:40 +02:00
pcm_plug.c pcm_plug: Clear plugins on all error conditions 2016-10-20 07:05:12 +02:00
pcm_plugin.c rate: dynamic update avail_min on slave 2017-01-02 15:00:04 +01:00
pcm_plugin.h rate: dynamic update avail_min on slave 2017-01-02 15:00:04 +01:00
pcm_rate.c rate: dynamic update avail_min on slave 2017-01-02 15:00:04 +01:00
pcm_rate_linear.c Introduce bswap.h for portable definitions of byte swap macros. 2016-03-03 16:18:10 +01:00
pcm_route.c pcm: Add thread-safety to PCM API 2016-07-11 15:25:30 +02:00
pcm_share.c pcm: drop unused sys/shm.h inclusion 2015-11-05 14:37:10 +01:00
pcm_shm.c Remove unused hostname resolution in shm plugins and aserver 2015-01-28 16:23:06 +01:00
pcm_simple.c pcm: remove alloca() from snd_spcm_init_duplex() 2016-07-14 16:33:50 +02:00
pcm_softvol.c ctl: rename APIs to add an element set so that their names are appropriate 2016-07-17 10:01:25 +02:00
pcm_symbols.c Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
plugin_ops.h pcm: route: Use get32 for multi-source route calculation 2014-07-22 14:06:12 +02:00