alsa-lib/include
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
..
sound hdspm.h: Update LTC ioctl to use struct hdspm_ltc 2013-08-19 20:13:55 +02:00
alisp.h Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
alsa-symbols.h Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
aserver.h Removed snd_pcm_hwptr(). 2003-02-22 17:19:02 +00:00
asoundef.h IEC958 definition for consumer status channel update 2008-08-01 13:17:52 +02:00
asoundlib-head.h Add definition of __inline__ for non-GCC 2013-04-25 09:55:49 +02:00
asoundlib-tail.h Create asoundlib.h dynamically according to configure options 2007-07-10 15:58:41 +02:00
conf.h fix doc errors 2009-08-04 09:17:20 +02:00
control.h Use __inline__ for exported headers 2013-04-25 09:52:33 +02:00
control_external.h all places: doxygen cleanups 2013-04-08 16:42:24 +02:00
error.h all places: doxygen cleanups 2013-04-08 16:42:24 +02:00
global.h include/global.h - don't define timeval and timespec structures for !glibc 2013-11-08 12:34:44 +01:00
hwdep.h Remove assert from header files 2007-10-25 15:36:03 +02:00
iatomic.h alsa-lib: heavy pcm atomics cleanup 2014-02-11 13:45:16 +01:00
input.h Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
list.h ucm: Moved ucm to src/ucm subdirectory 2010-09-15 08:09:31 +02:00
local.h local.h: include sys/types.h to fix issues with pcm.h 2013-10-11 09:29:05 +02:00
Makefile.am ucm: build - add build support for Use Case Manager 2010-08-23 20:05:45 +02:00
mixer.h all places: doxygen cleanups 2013-04-08 16:42:24 +02:00
mixer_abst.h implemented integer volume <-> dB volume conversion functions for simple mixer 2008-04-21 11:44:20 +02:00
output.h Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
pcm.h Use __inline__ for exported headers 2013-04-25 09:52:33 +02:00
pcm_external.h Fix documentation of external PCM plugin SDK 2005-05-24 09:42:01 +00:00
pcm_extplug.h Use __inline__ for exported headers 2013-04-25 09:52:33 +02:00
pcm_ioplug.h all places: doxygen cleanups 2013-04-08 16:42:24 +02:00
pcm_old.h Move old PCM API to pcm_old.h 2005-04-14 14:01:10 +00:00
pcm_plugin.h Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
pcm_rate.h Query the supported rate ranges from rate plugins 2009-06-02 16:26:03 +02:00
rawmidi.h Remove assert from header files 2007-10-25 15:36:03 +02:00
search.h Corrections by Kevin Conder <kconder@interaccess.com> 2002-03-12 20:14:33 +00:00
seq.h add snd_seq_client_info_event_filter_*() functions 2008-02-22 17:46:50 +01:00
seq_event.h all places: doxygen cleanups 2013-04-08 16:42:24 +02:00
seq_midi_event.h Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
seqmid.h Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
sys.h Ok, added warning to sys/asoundlib.h with redirection to alsa/asoundlib.h. 2001-09-11 12:18:56 +00:00
timer.h Defined symbols exposing the hrtimer to applications. 2009-11-08 09:21:56 +01:00
use-case.h UCM: Document some standard values 2013-08-08 12:31:05 +02:00