traud / asterisk-amr

Asterisk 13 transcoding module: AMR-WB
The Unlicense
32 stars 19 forks source link

Decoder_Interface_exit #6

Closed asharpaev closed 6 years ago

asharpaev commented 8 years ago

I build by instructions for asterisk 13.7.2

But codec_amr can`t load:

module load codec_amr.so Unable to load module codec_amr.so Command 'module load codec_amr.so' failed. [May 6 09:10:38] WARNING[31626]: loader.c:595 load_dynamic_module: Error loading module 'codec_amr.so': /usr/lib/asterisk/modules/codec_amr.so: undefined symbol: Decoder_Interface_exit [May 6 09:10:38] WARNING[31626]: loader.c:1079 load_resource: Module 'codec_amr.so' could not be loaded.

asharpaev commented 8 years ago

I use Ubuntu 16.04 Packages libopencore-amrnb, libopencore-amrwb-dev, libopencore-amrwb, libopencore-amrwb-dev is installed

asharpaev commented 8 years ago

I also try to build opencore-amr-0.1.3 and vo-amrwbenc-0.1.3 from sources. No effect.

asharpaev commented 8 years ago

I tryed: make clean && ./bootstrap.sh && ./configure --with-opencore-amrnb=/usr/local/lib --with-opencore-amrwb=/usr/local/lib --with-vo-amrwbenc=/usr/local/lib && make menuselect.makeopts && make && make install

make clean && ./bootstrap.sh && ./configure --with-opencore-amrnb=/usr/local/include --with-opencore-amrwb=/usr/local/include --with-vo-amrwbenc=/usr/local/include && make menuselect.makeopts && make && make install

make clean && ./bootstrap.sh && ./configure --with-opencore-amrnb=/usr/local/include/opencore-amrnb --with-opencore-amrwb=/usr/local/include/opencore-amrwb --with-vo-amrwbenc=/usr/local/include/vo-amrwbenc && make menuselect.makeopts && make && make install

error the same

asharpaev commented 8 years ago

I solved by copy /opencore-amrnb/.h, /opencore-amrwb/.h and /vo-amrwbenc/*.h to asterisk source ./include path

traud commented 8 years ago

Mhm. I tested Ubuntu 16.04 LTS and was not able to reproduce your issue, yet. Furthermore, your error message indicates a problem with the shared library (.so) of AMR (Narrow Band) rather than its header files (.h). Furthermore, I did not have to go for the sources of those AMR packages. Furthermore, I did not have to specify those packages, because the configure script of Asterisk finds those libraries itself. Finally, the -dev variants of these software packages install their normal variants automatically, because depend on each other.

Just to double-check if that was a typo or the issue: Do you have the software package libopencore-amrnb-dev installed as well? Actually, all you have to do is to issue the command of the Read Me: sudo apt-get --assume-yes install libopencore-amrnb-dev libopencore-amrwb-dev libvo-amrwbenc-dev

traud commented 8 years ago

Closing this because of lack of activity. I am still not able to reproduce this. If you or somebody else wants to update this issue, please, re-open so it can be looked at.

ceco commented 6 years ago

I had the same problem like the one described here. So I had to recompile my codec with dynamic libs included:

  1. Configure and patch asterisk, install opencore-amr and vo-amrwbenc

  2. Build amr codec

    >  cwd=`pwd`
    > (cd codecs; gcc -o codec_amr.o -c codec_amr.c -MD -MT codec_amr.o -MF .codec_amr.o.d -MP -pthread -I$cwd/include    -I/usr/include/libxml2  -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3  -O3  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -march=native -fPIC -DAST_MODULE=\"codec_amr\" -DAST_MODULE_SELF_SYM=__internal_codec_amr_self; $cwd/build_tools/make_linker_version_script codec_amr "" "$cwd"; gcc -o codec_amr.so -pthread -shared -Wl,--version-script,codec_amr.exports,--warn-common codec_amr.o -lopencore-amrnb -lopencore-amrwb -lvo-amrwbenc)

    This is the fix: -lopencore-amrnb -lopencore-amrwb -lvo-amrwbenc

Now copy and restart your asterisk and the problem is gone.

traud commented 6 years ago

Цветан, thanks for sharing you experience and steps. My aim is that it works without such things, therefore:

  1. Which distribution/version do you use (Ubuntu 18.04 LTS, Arch Linux, Fedora 28, …)?
  2. After running the script ./configure, what is printed about the AMR libraries?
  3. Is codec_amr visible in make menuselect?
  4. When you do a normal make in the root of your Asterisk installation, doesn’t that build the file codec_amr.so? Any error message?
ceco commented 6 years ago
  1. I tested on OpenSuSE 42.3 and CentOS 7
  2. Amr output from ./configure:
    checking for Encoder_Interface_init in -lopencore-amrnb... yes
    checking opencore-amrnb/interf_enc.h usability... yes
    checking opencore-amrnb/interf_enc.h presence... yes
    checking for opencore-amrnb/interf_enc.h... yes
    checking for D_IF_init in -lopencore-amrwb... yes
    checking opencore-amrwb/dec_if.h usability... yes
    checking opencore-amrwb/dec_if.h presence... yes
    checking for opencore-amrwb/dec_if.h... yes
    checking for E_IF_init in -lvo-amrwbenc... yes
    checking vo-amrwbenc/enc_if.h usability... yes
    checking vo-amrwbenc/enc_if.h presence... yes
    checking for vo-amrwbenc/enc_if.h... yes
  3. Yes and it is enabled
  4. It is build. No errors.

I just tested again and copied codec_amr.so to my codecs folder and got no error messages.

On OpenSuSE I built an RPM and on CentOS I did make install. I got the same error on both systems but now that you asked I repeated the build steps and got no errors.

May there is no problem after all. If I notice this problem in the future I will report.

traud commented 6 years ago

Thanks for updating. Anyway, I am closing this because I am not able to reproduce it, yet. When you or someone has more information to avoid this issue, please, re-open this issue report.