The Advanced Linux Sound Architecture (ALSA) - library
Find a file
Riku Voipio 326c6802e4 alsa-lib: heavy pcm atomics cleanup
The following patch comes from the realization that at least ARM code
for atomics is quite broken and nobody has cared for a decade.

A quick dive shows that only snd_atomic_{read,write}_{begin,end}
appear to be used widely. These are implemented using wmb/rmb.

Only other use of atomic functions is in pcm_meter.c.
The #SND_PCM_TYPE_METER plugin type appears rarely, if ever, used.
I presume these days anyone who wants a meter/scope will do in pulseaudio
layer instead of alsa.

It would seem better fit to have pcm_meter in alsa-plugins instead
of alsa-lib, but I guess that would be an ABI break...

So instead, I'm proposing here

1. Removal of all hand-crafted atomics from iatomic.h apart from barriers,
   which are used in snd_atomic_{read,write}_{begin,end}.

2. Using __sync_synchronize as the default fallback for barriers. This
   has been available since gcc 4.1, so it shouldn't be a problem.

3. Defining the few atomics used by pcm_meter.c withing pcm_meter.c
   itself, using gcc atomic builtins[1].

4. Since gcc atomic builtins are available only since gcc 4.7, add a check for
   that in gcc configure.in, and don't build pcm meter plugin if using
   older gcc.

The last point has the impact, that if there actually is someone who 1)
uses the meter plugin 2) wants to upgrade to 2014 alsa-lib 3) but
does not want to use a 2012+ gcc - that someone will be inconvenienced.

Finally remove the unneeded configure check for cpu type. We can
trust the gcc to set right flags for us.

[1] http://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-11 13:45:16 +01:00
alsalisp Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
aserver Make some static tables and strings constants. 2008-11-21 13:04:41 +01:00
doc all places: doxygen cleanups 2013-04-08 16:42:24 +02:00
include alsa-lib: heavy pcm atomics cleanup 2014-02-11 13:45:16 +01:00
m4 Add the attributes.m4 macro file from xine/lscube. 2008-11-21 13:04:19 +01:00
modules alsa-lib: fixed coverity reported issues under "FORWARD_NULL" checker. 2011-05-04 09:11:46 +02:00
src alsa-lib: heavy pcm atomics cleanup 2014-02-11 13:45:16 +01:00
test test/chmap: Add missing usage text for -s option 2013-11-04 14:19:03 +01:00
utils build: Disable another compile chack with --disable-alsatest 2012-07-17 14:57:10 +02:00
.gitignore Update .gitignore 2012-09-22 09:39:12 +02:00
acinclude.m4 fixed for the recent autoconf. 2004-01-26 15:52:17 +00:00
ChangeLog * update to libtool 1.3.3 1999-07-22 12:18:42 +00:00
configure.in alsa-lib: heavy pcm atomics cleanup 2014-02-11 13:45:16 +01:00
COPYING Updated GNU GPL license (address). 2001-12-30 09:22:54 +00:00
gitcompile Introduce --with-pkgconfdir, add 64-bit defaults to gitcompile 2012-01-20 16:14:44 +01:00
INSTALL Add hgcompile script and fix INSTALL document 2006-05-12 15:33:44 +02:00
Makefile.am Add m4/attributes.m4 as dist file.. 2009-01-05 13:21:12 +01:00
MEMORY-LEAK Initial version 2003-02-04 14:56:07 +00:00
NOTES Change assert condition in error message handler 2007-10-24 12:53:08 +02:00
TODO Added snd_config_load_override(). 2002-01-09 21:28:15 +00:00