alsa-lib/src/pcm
Takashi Sakamoto 48bf3d3e96 pcm: hw: maintain fallback mode for control data mapping independently
Currently, failures of status/control data mapping are handled dependently.
However, it's not sure that one of the operations is failed when another
is failed.

This commit adds a member into private data structure to maintain fallback
mode for control data mapping, independently of status data mapping. As a
result, we have four cases to handle status/control data:

1. both of status/control data are mapped.
Nothing changed. A structure with alias of 'snd_pcm_hw_t' already has two
members to point the mapped area and in application runtime they're used
to refer/set status/control data. No need to call ioctl(2) with
SNDRV_PCM_IOCTL_SYNC_PTR to issue/query the data.

2. both of status/control data are unmapped.
The two members point to allocated memory for fallback buffer. In
application runtime, the buffer is given as an argument for ioctl(2) with
SNDRV_PCM_IOCTL_SYNC_PTR to issue/query the data.

3. status data is mapped only.
One of the two members is used to point the mapped area. Another points to
allocated memory for fallback buffer. In application runtime, the buffer
is used as an argument to execute ioctl(2) with SNDRV_PCM_IOCTL_SYNC_PTR
for the latter data, but the former data is already synchronized.

4. control data is mapped only.
The same as the above.

In design of ALSA PCM interface, userspace applications are not expected
to map the status data as writable. On the other hand, expected to map
the control data as writable. In a focus on the differences, we could
achieve to reduce calls of the ioctl(2) in a case that one of the
status/control data is successfully mapped and another is failed (case 3
and 4). Especially, in current alsa-lib implementation, application
runtime queries state of runtime of PCM substream so often.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-27 11:12:05 +02: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 conf: Check the availability of PTHREAD_MUTEX_RECURSIVE 2017-05-16 16:26:20 +02: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: obsolete 'mmap_emulation' parameter of snd_pcm_hw_open_fd() 2017-06-23 15:33:37 +02:00
pcm_direct.h pcm: dmix: Workaround for binary incompatibility 2017-05-26 14:38:55 +02:00
pcm_dmix.c pcm: dmix: Fix the inconsistent PCM state 2017-05-31 12:47:31 +02: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: dshare: Call snd_pcm_dshare_state() directly 2017-05-30 17:33:17 +02: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: extplug: refinement of masks in extplug 2017-02-17 18:41:48 +01:00
pcm_file.c pcm:file: delegate htimestamping to slave instead of always getting real_htimestamp 2017-03-29 09:47:36 +02: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: hw: maintain fallback mode for control data mapping independently 2017-06-27 11:12:05 +02: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: obsolete 'mmap_emulation' parameter of snd_pcm_hw_open_fd() 2017-06-23 15:33:37 +02: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: save converter config 2017-03-21 16:38:12 +01:00
pcm_plugin.c pcm:plugin: Fix sound capture via MMAP access 2017-04-05 21:39:35 +02:00
pcm_plugin.h rate: dynamic update avail_min on slave 2017-01-02 15:00:04 +01:00
pcm_rate.c always handle return value from snd_config_get_id() (coverity) 2017-02-27 09:26:33 +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