The Advanced Linux Sound Architecture (ALSA) - library
Find a file
Takashi Iwai 6e55578125 pcm: Return the consistent error code for unexpected PCM states
Some PCM functions have the sanity check of the expected PCM states,
and most of them return -EBADFD if the current state doesn't match.
This is bad for some programs like aplay that expect the function
returning a proper code corresponding to the state, e.g. -ESTRPIPE for
the suspend.

This patch is an attempt to address such inconsistencies.  The sanity
checker bad_pcm_state() now returns the error code instead of bool, so
that the caller can pass the returned code as is.  And it calls a new
helper, pcm_state_to_error(), for obtaining the error code to certain
known PCM error state.

While we're at it, use the new pcm_state_to_error() for simplifying
the existing code to retrieve the error code, too.

Tested-by: Mirza Krak <mirza.krak@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-18 10:11:59 +01:00
alsalisp Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
aserver Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
doc doxygen: Suppress timestamp 2016-06-23 16:29:07 +02:00
include core: Proper reference of internal snd_dlopen() 2018-01-04 15:29:57 +01:00
m4 Add the attributes.m4 macro file from xine/lscube. 2008-11-21 13:04:19 +01:00
modules configure.ac: build extra mixer modules conditionally 2017-11-27 21:48:20 +01:00
src pcm: Return the consistent error code for unexpected PCM states 2018-01-18 10:11:59 +01:00
test test: correct emulation for channel-map TLV 2017-11-24 13:47:17 +01:00
utils autotools: update style 2014-02-26 08:16:22 +01:00
.gitignore Add pcm-multi-thread to .gitignore 2016-07-07 16:30:54 +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.ac conf/ucm: Add chtrt5645-mono-speaker-analog-mic configuration 2018-01-09 08:56:27 +01:00
COPYING Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
gitcompile configure.ac: do not enable alisp code by default 2017-11-27 21:48:20 +01:00
INSTALL pcm: Add thread-safety to PCM API 2016-07-11 15:25:30 +02:00
Makefile.am autotools: update style 2014-02-26 08:16:22 +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