On Tue, 5 Feb 2002, [EMAIL PROTECTED] wrote:

> The error is triggered in snd_pcm_open(). It seems to
> be that it is related to the property that the Python extension
> module is dynamically loaded, and some parts of alsa-lib also.
> This hypothesis is supported by the fact, that I get the same
> error when I construct an minimal extension module which calls
> nothing than snd_pcm_open().
>
> For example:
> -----------------------------------------------------------------
> jnix@sirrah:~/tmp > cat ad.c
> #include <stdio.h>
> #include <alsa/asoundlib.h>
>
> static snd_pcm_t *handle;
>
> int initad(int argc, char *argv[])
> {
>         int err;
>
>         err = snd_pcm_open(&handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
>         if (err < 0) {
>                 error("audio open error: %s", snd_strerror(err));
>                 return 1;
>         }
>
>
> }
>
> jnix@sirrah:~/tmp > gcc   -c ad.c -o ad.o
> jnix@sirrah:~/tmp >  gcc -shared ad.o -lasound -o ad.so
> jnix@sirrah:~/tmp > python
> Python 2.0 (#1, May 16 2001, 00:02:45)
> [GCC 2.95.3 20010315 (SuSE)] on linux2
> Type "copyright", "credits" or "license" for more information.
> >>> import ad
> ALSA lib dlmisc.c:97:(snd_dlsym_verify) unable to verify version
> for symbol snd_config_hook_load
> ALSA lib conf.c:2452:(snd_config_hooks_call) symbol
> snd_config_hook_load is not defined inside (null)
> ALSA lib conf.c:2859:(snd_config_update_r) hooks failed, removing
> configuration
> python: : Unknown error 1075756497
> jnix@sirrah:~/tmp >
> -----------------------------------------------------------------
>
>
> So there seems to be a conflict in dynamic loading.
>
> What can be done to avoid it ?

The ALSA library must be imported with RTLD_GLOBAL flag otherwise the code
can't find buildin dynamic symbols accessed by dlopen(NULL, "function")..

                                                Jaroslav

-----
Jaroslav Kysela <[EMAIL PROTECTED]>
SuSE Linux    http://www.suse.com
ALSA Project  http://www.alsa-project.org


_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to