libasound2: snd_device_name_hint() wrongly calls snd_config_delete()
A message that is not in the archive (sent off-list or not yet received): 1254616484.15064.58.camel@dark-knight
forwarded 549531 [email protected]
thanks
This looks more like a general problem and shouldn't be solved distribution specific so request for help to the alsa developers.
Elimar
* John Lindgren [091003 20:34 -0400]
Quoted 130 lines
Package: libasound2
Version: 1.0.21a-1
Severity: normal
Tags: patchSymptoms
--------This bug first showed up because of a new ALSA output plugin for Audacious audio player:
http://jira.atheme.org/browse/AUDPLUG-77#action_10640Essentially, any call to
snd_device_name_hint()causes later calls tosnd_pcm_open()to fail with messages like these:ALSA lib conf.c:4600:(snd_config_expand) Unknown parameters CARD=Live,DEV=0 ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM rear:CARD=Live,DEV=0
This happens only for PCMs defined in ALSA config files (such as the ones under
/usr/share/alsa/cards), not for "default" or "hw:0,0"-style. It does not seem to depend on a particular sound card. It can be reproduced without Audacious by adding a call topcm_list()before the call tosnd_pcm_open()inaplay.cfrom the alsa-utils package:$ ./aplay -D front:CARD=ICH6,DEV=0 Test.wav default:CARD=ICH6 Intel ICH6, Intel ICH6 Default Audio Device front:CARD=ICH6,DEV=0 Intel ICH6, Intel ICH6 Front speakers surround40:CARD=ICH6,DEV=0 Intel ICH6, Intel ICH6 4.0 Surround output to Front and Rear speakers surround41:CARD=ICH6,DEV=0 Intel ICH6, Intel ICH6 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=ICH6,DEV=0 Intel ICH6, Intel ICH6 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=ICH6,DEV=0 Intel ICH6, Intel ICH6 5.1 Surround output to Front, Center, Rear and Subwoofer speakers iec958:CARD=ICH6,DEV=0 Intel ICH6, Intel ICH6 - IEC958 IEC958 (S/PDIF) Digital Audio Output null Discard all samples (playback) or generate zero samples (capture) ALSA lib conf.c:4600:(snd_config_expand) Unknown parameters CARD=ICH6,DEV=0 ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM front:CARD=ICH6,DEV=0 aplay: main:610: audio open error: Invalid argumentDiagnosis
---------
try_config(), called bysnd_device_name_hint(), callssnd_config_search_definition()atnamehint.cline 243 andsnd_config_search_alias_hooks()at line 339, then callssnd_config_delete()on the returned nodes at lines 331 and 383. This was probably meant to prevent leaking memory returned by the search functions, but in fact it removes information from the config that is needed by later calls, such assnd_pcm_open. Hence,snd_pcm_openbehaves as though devices like "front" and "rear" do not exist.I have attached a patch for
aplay.cto reproduce the problem and a patch fornamehint.cto fix it. One side effect of the fix (on my system at least) is that two "null" devices are now listed by "aplay -L" and in Audacious.Peace,
John Lindgren-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)Kernel: Linux 2.6.30-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell:/bin/shlinked to/bin/dashVersions of packages libasound2 depends on:
ii libc6 2.9-25 GNU C Library: Shared librarieslibasound2 recommends no packages.
Versions of packages libasound2 suggests:
pn libasound2-plugins <none> (no description available)-- no debconf information
aplay.c renamed from aplay.0.c +2
-0@@ -603,6 +603,8 @@ goto __end; } +pcm_list (); + err =snd_pcm_open (&handle, pcm_name, stream, open_mode);if (err <0 ) {error (_ ("audio open error: %s" ),snd_strerror (err));namehint.c renamed from namehint.0.c +0
-3@@ -328,7 +328,6 @@if (snd_config_search (cfg1,"slave" , &cfg) >=0 &&snd_config_search (cfg, base, &cfg1) >=0 ) goto __hint; -snd_config_delete (res); res =NULL ;if (strchr (buf,':' ) !=NULL ) goto __ok;@@ -379,8 +378,6 @@ err =hint_list_add (list, buf, buf1); } __skip_add: -if (res) -snd_config_delete (res);if (buf1)free (buf1);free (buf);_______________________________________________
Pkg-alsa-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-alsa-devel
Signature · 2 lines
It's a good thing we don't get all the government we pay for.