The Advanced Linux Sound Architecture (ALSA) - library
Find a file
Lennart Poettering 73d20069e0 alsa-lib: Make sure SND_PCM_NO_xxx flags don't get lost when nonblocking mode is enabled
The plug PCM copies the 'mode' field from the slave PCM. If blocking mode is
enabled for the plug PCM the mode is subsequently overwritten with the original
requested 'mode'. If non-blocking mode is requested this does not happen.

Because the hw PCM synthesizes the 'mode' from the actual file descriptor flags
no SND_PCM_NO_xxx will ever be set for it. This has the effect that the 'mode'
of the plug PCM will also not include those flags anymore -- unless they are
overwritten as mentioned above. This basically means SND_PCM_NO_xxx is ignored
for plug:hw:4711 style device strings opened in non-blocking mode.

You can easily test this with "aplay --channels 7 --disable-channels -f S16_LE
-r 44100 -D plug:hw:0" on a device that cannot do 7 channels. Normally this
call should fail, however if you add "-N" to the command line this call will
succeed.

This patch simply copies the SND_PCM_NO_xxx flags back into the 'mode' field in
case we don't overwrite it with the original anyway.

Probably closes bug 3571 for good.

From: Lennart Poettering <mznyfn@0pointer.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-31 15:45:18 +02: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 Terminate long_options array 2004-09-28 17:22:33 +00:00
doc Create doxgen.cfg dynamically 2008-02-25 14:56:51 +01:00
include IEC958 definition for consumer status channel update 2008-08-01 13:17:52 +02:00
modules implemented integer volume <-> dB volume conversion functions for simple mixer 2008-04-21 11:44:20 +02:00
src alsa-lib: Make sure SND_PCM_NO_xxx flags don't get lost when nonblocking mode is enabled 2008-08-31 15:45:18 +02:00
test test/pcm.c: Fix SND_PCM_FORMAT_S24 support 2008-07-10 18:45:23 +02:00
utils Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
.gitignore removed .hg files and renamed hgcompile to gitcompile 2008-05-20 13:29:44 +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 Release v1.0.17a 2008-08-15 13:28:55 +02:00
COPYING Updated GNU GPL license (address). 2001-12-30 09:22:54 +00:00
cvscompile make sure commands in cvs/hg compile scripts worked 2006-09-26 15:37:07 +02:00
gitcompile removed .hg files and renamed hgcompile to gitcompile 2008-05-20 13:29:44 +02:00
INSTALL Add hgcompile script and fix INSTALL document 2006-05-12 15:33:44 +02:00
Makefile.am hgcompile -> gitcompile 2008-06-03 10:17:48 +02: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