From: Takashi Iwai Subject: Re: load_for_all_cards bug Date: Mon, 10 Aug 2009 14:17:48 +0200 Message-ID: References: <4A4A6966.20804@omegacrash.net> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 0394010385B for ; Mon, 10 Aug 2009 14:17:49 +0200 (CEST) In-Reply-To: <4A4A6966.20804@omegacrash.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Kevin Goodsell Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Tue, 30 Jun 2009 12:37:10 -0700, Kevin Goodsell wrote: > > (I originally tried to send this via the moderator without subscribing > to the list, but it never went through and I never received a moderator > response. Apparently this list is set up as moderated, but nobody is > actually moderating it.) Somehow I seem to have overlooked your post. Sorry for the late response. > 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..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..pcm.dmix.. > 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. > > Fixing this may just be a matter of changing the line in > snd_config_hook_load_for_all_cards from: > > if (snd_config_search(root, fdriver, &n) >= 0) { > > to: > > if (snd_config_search(root, fdriver, &n) >= 0 && n->type != > SND_CONFIG_TYPE_COMPOUND) { An easier fix is just to test snd_config_get_string() in the same if condition. I fixed on GIT tree now. Thanks! Takashi