Hello,
I am writing a Python extension module for the ALSA PCM device, because I am interested in real-time audio processing with Python scripts. This may sound weird first, but Python is fast enough for modest audio processing in the frequency domain and great for difficult experimental work. I have already written a Python extension for ALSA-0.5.9, which can be downloaded at http://www.cafeconleche.de (generated using SWIG and rather ugly, I admit). Now I'm writing an pure C extension for ALSA-0.9 . I encountered the following strange problem: When I try to initialize the pcm device, I get the following error message: ------------------------------------------------------ jnix@sirrah:~/zosma/rtaudio > ./test.py default 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 errcode ist: -6Traceback (most recent call last): File "./test.py", line 2, in ? from rtaudio import pcm File "/home/jnix/lib/python/rtaudio/__init__.py", line 5, in ? import alsa_pcm File "/home/jnix/lib/python/rtaudio/alsa_pcm.py", line 13, in ? from pcm import * pcm.error: device open error: No such device or address ------------------------------------------------------ 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 ? kind regards, Johannes _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel