tags 505089 +patch
thanks

On Thu, Feb 12, 2009 at 10:09:34AM +1100, Paul TBBle Hampson wrote:

> Just came across this, and from [1] it turns out the fix is to
> remove the exclamation mark in front of the "defaults.pcm.card" in
> the generated file.

No, the reference you give does more than just remove the exclamation
mark. It also refers to the card by number and not by name, which is
not useful to someone that does not have root access to the machine
and cannot fix which card is which number.

When just removing the exclamation mark, I get the following
.asoundrc.asoundconf

# ALSA library configuration file managed by asoundconf(1).
#
# MANUAL CHANGES TO THIS FILE WILL BE OVERWRITTEN!
#
# Manual changes to the ALSA library configuration should be implemented
# by editing the ~/.asoundrc file, not by editing this file.
defaults.pcm.card CK804
defaults.ctl.card CK804
defaults.pcm.device 0
defaults.pcm.subdevice -1

which gives this error:

ALSA lib conf.c:976:(parse_value) card is not a string
ALSA lib conf.c:1589:(snd_config_load1) 
/home/master/.asoundrc.asoundconf:8:0:Invalid argument
ALSA lib conf.c:2850:(snd_config_hook_load) /home/master/.asoundrc may be old 
or corrupted: consider to remove or fix it
ALSA lib conf.c:2714:(snd_config_hooks_call) function snd_config_hook_load 
returned error: Invalid argument
ALSA lib conf.c:3079:(snd_config_update_r) hooks failed, removing configuration



But I have _finally_ figured it out! Removing the exclamation mark
_and_ applying this patch to /usr/share/alsa/alsa.conf does the trick.

--- alsa.conf.bak       2009-02-12 08:06:25.458031089 +0100
+++ alsa.conf   2009-02-12 08:08:59.074231990 +0100
@@ -58,8 +58,8 @@
 # show extended name hints
 defaults.namehint.extended off
 #
-defaults.ctl.card 0
-defaults.pcm.card 0
+defaults.ctl.card "0"
+defaults.pcm.card "0"
 defaults.pcm.device 0
 defaults.pcm.subdevice -1
 defaults.pcm.nonblock 1


Here are patches.

-- 
Lionel
diff --recursive -N -u alsa-lib-1.0.18/debian/changelog alsa-lib-1.0.18.505089/debian/changelog
--- alsa-lib-1.0.18/debian/changelog	2009-02-12 08:24:16.000000000 +0100
+++ alsa-lib-1.0.18.505089/debian/changelog	2009-02-12 08:14:55.257031809 +0100
@@ -1,3 +1,9 @@
+alsa-lib (1.0.18-1.0) experimental; urgency=low
+
+  * Allow defaults.{ctl,pcm}.card to be a string
+
+ --
+
 alsa-lib (1.0.18-1) experimental; urgency=low
 
   * New upstream release.
diff --recursive -N -u alsa-lib-1.0.18/debian/patches/named_defaults alsa-lib-1.0.18.505089/debian/patches/named_defaults
--- alsa-lib-1.0.18/debian/patches/named_defaults	1970-01-01 01:00:00.000000000 +0100
+++ alsa-lib-1.0.18.505089/debian/patches/named_defaults	2009-02-12 08:21:07.306033058 +0100
@@ -0,0 +1,15 @@
+Index: alsa-lib-1.0.18/src/conf/alsa.conf
+===================================================================
+--- alsa-lib-1.0.18.orig/src/conf/alsa.conf	2009-02-12 08:19:56.197033159 +0100
++++ alsa-lib-1.0.18/src/conf/alsa.conf	2009-02-12 08:20:14.915281547 +0100
+@@ -58,8 +58,8 @@
+ # show extended name hints
+ defaults.namehint.extended off
+ #
+-defaults.ctl.card 0
+-defaults.pcm.card 0
++defaults.ctl.card "0"
++defaults.pcm.card "0"
+ defaults.pcm.device 0
+ defaults.pcm.subdevice -1
+ defaults.pcm.nonblock 1
diff --recursive -N -u alsa-lib-1.0.18/debian/patches/series alsa-lib-1.0.18.505089/debian/patches/series
--- alsa-lib-1.0.18/debian/patches/series	2009-02-12 08:24:16.000000000 +0100
+++ alsa-lib-1.0.18.505089/debian/patches/series	2009-02-12 08:19:50.217032117 +0100
@@ -1,3 +1,4 @@
 relibtoolise.patch
 add-maintainer-mode.patch
 configure_cross_compile.patch
+named_defaults
diff --recursive -u alsa-utils-1.0.18/debian/asoundconf alsa-utils-1.0.18.505089/debian/asoundconf
--- alsa-utils-1.0.18/debian/asoundconf	2009-02-12 08:29:51.000000000 +0100
+++ alsa-utils-1.0.18.505089/debian/asoundconf	2009-02-12 08:32:04.753031103 +0100
@@ -340,9 +340,9 @@
 	sep = re.compile(r'[ ]')
 	r = re.compile('^defaults.pcm.card')
 	s = re.compile('^defaults.ctl.card')
-	## !defaults.pcm.card and defaults.ctl.card should lead
+	## defaults.pcm.card and defaults.ctl.card should lead
 	## the user's custom asoundrc.
-	if set('!defaults.pcm.card', card) and \
+	if set('defaults.pcm.card', card) and \
 	   set('defaults.ctl.card', card):
 	    for i in clist:
 		(j, k) = sep.split(i)
diff --recursive -u alsa-utils-1.0.18/debian/changelog alsa-utils-1.0.18.505089/debian/changelog
--- alsa-utils-1.0.18/debian/changelog	2009-02-12 08:29:51.000000000 +0100
+++ alsa-utils-1.0.18.505089/debian/changelog	2009-02-12 08:34:00.873031419 +0100
@@ -1,3 +1,9 @@
+alsa-utils (1.0.18-1.0) experimental; urgency=low
+
+  * asoundconf set-default-card: no "!" (closes: #505089)
+
+ --
+
 alsa-utils (1.0.18-1) experimental; urgency=low
 
   * New upstream release.

Reply via email to