The Advanced Linux Sound Architecture (ALSA) - library
Find a file
Takashi Iwai 96da0c842d Fix driver conf parsing in snd_config_hook_load_for_all_cards()
Reported by Kevin Goodsell.

Summary: load_for_all_cards fails with existing configuration elements

In snd_config_hook_load_for_all_cards, the first call to
snd_config_search attempts to locate an existing configuration node with
the name of the driver.  Typically none is found, and everything is
good. However, if such a node is located, the next line assumes it is a
leaf node with type 'string' and calls snd_config_get_string to fetch
the string value. If this fails, the entire hook is abandoned.

Because of this, setting something like the following in asoundrc:

cards.<driver name>.foo 0

is sufficient to disable the entire card-specific configuration.

As a concrete example, I have a HDA-Intel sound card. dmix.conf includes
a way to set period_size, period_time, and periods by using
configuration elements of the form cards.<driver name>.pcm.dmix.<var>.
In ~/.asoundrc I add

cards.HDA-Intel.pcm.dmix.period_size 1024

This will cause HDA-Intel.conf to fail to load, and the pcm defined in
default.conf will fail to find the device-specific pcm
cards.HDA-Intel.pcm.default, and fall back on the default pcm using
plughw.  By attempting to configure dmix, I have disabled it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-10 14:14:10 +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 Make some static tables and strings constants. 2008-11-21 13:04:41 +01:00
doc doc: hide structs with typedefs 2009-08-04 09:15:40 +02:00
include snd_pcm_scope_set_ops: make ops parameter const 2009-08-10 10:08:25 +02:00
m4 Add the attributes.m4 macro file from xine/lscube. 2008-11-21 13:04:19 +01:00
modules Add missing -ldl to modules/mixer/simple/* 2009-01-21 09:29:35 +01:00
src Fix driver conf parsing in snd_config_hook_load_for_all_cards() 2009-08-10 14:14:10 +02:00
test add config tests 2009-08-03 13:35:01 +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 add midi event tests 2009-07-06 12:00:04 +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 add midi event tests 2009-07-06 12:00:04 +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 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