[alsa-devel] Plug In Creation - aplay can't find existing .so

Takashi Iwai tiwai at suse.de
Wed Jun 18 12:29:18 CEST 2014


At Tue, 17 Jun 2014 15:08:31 -0400,
Brandon Yates wrote:
> 
> Interestingly strace shows the failure occurs on the open call (not
> dlopen)
> 
> open("/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_pcm_adt_dsp.so",
> O_RDONLY|O_CLOEXEC) = 3

This succeeded and returned the proper fd number 3.

> running ldd on my shared library shows undefined symbols that are part
> of libasound, for example
> undefined symbol: snd_pcm_ioplug_create
> 
> I wonder if I have to build the .so a different way so these can be
> resolved? Any advice would be greatly appreciated. 

Maybe you forgot to link your shared object with -lasound -lm?


Takashi

> 
> 
> -----Original Message-----
> From: Takashi Iwai [mailto:tiwai at suse.de] 
> Sent: Friday, June 13, 2014 8:42 AM
> To: Brandon Yates
> Cc: alsa-devel at alsa-project.org
> Subject: Re: [alsa-devel] Plug In Creation - aplay can't find existing
> .so
> 
> At Tue, 10 Jun 2014 13:55:39 -0400,
> Brandon Yates wrote:
> > 
> > Hello,
> > 
> > I am working on a new pcm plugin. At this point it is basically just a
> 
> > Hello World plugin, to make sure I have the tools working and 
> > understand the workflow.  I created a simple file which is just
> basically:
> > 
> > #include <alsa/asoundlib.h>
> > #include <alsa/pcm_external.h>
> > SND_PCM_PLUGIN_DEFINE_FUNC(my_mod)
> > {	
> >    printf("hello world\n");
> >    return 0;
> > }
> > SND_PCM_PLUGIN_SYMBOL(my_mod);
> > 
> > 
> > I compiled this as a shared lib named
> 'libasound_module_pcm_my_mod.so'
> > and copied it to '/usr/lib/i386-linux-gnu/alsa-lib/'
> > 
> > I edited my ~/.asoundrc to create a new device that uses this plugin.
> > Then I try to use it with `aplay --device=my_mod_test out.pcm`
> > 
> > I get the error message
> > 
> > ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared 
> > library 
> > /usr/lib/i386-linux-gnu/alsa-lib/libasound_module_pcm_my_mod.so
> > aplay: main:682: audio open error: No such device or address
> > 
> > 
> > But this file actually does exist, I just copied it there.
> > 
> > 
> > Any idea why this happens?
> 
> Try strace to see what happens.  If it fails in dlopen(), it's likely
> because your shared object is invalid.
> 
> 
> Takashi
> 


More information about the Alsa-devel mailing list