Speex AEC (Accoustic Echo Cancellation) fails @configuration

Discussion related to implementation and use of the H.323 Plus H.323 stack at https://www.h323plus.org.
Post Reply
mazilo
Posts: 45
Joined: Thu Sep 15, 2011 2:12 pm

Speex AEC (Accoustic Echo Cancellation) fails @configuration

Post by mazilo »

Is Speex AEC module on H323plus supported under Linux? If so, I got the following error messages during configure stage when trying to cross compile the latest H323plus from CVS trunk with the latest Opal/PTLib from SVN trunk.

Code: Select all

checking Checking PTLib version 2.11.2... ok
configure: Disabling H.460.23/.24
configure: Enabling T.38
./configure: line 4517: syntax error near unexpected token `H323_AEC=1,'
./configure: line 4517: `  PTLIB_FIND_LUA(H323_AEC=1, H323_AEC=)'
make[2]: *** [/opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs/.configured_] Error 2
make[2]: Leaving directory `/opt/OpenWRT/feeds/packages/libs/h323plus_cvs'
make[1]: *** [package/feeds/local/h323plus_cvs/compile] Error 2
make[1]: Leaving directory `/opt/openwrt-svn-trunk'
make: *** [package/h323plus_cvs/compile] Error 2
shorne
Posts: 45
Joined: Thu Aug 27, 2009 4:17 am

Re: Speex AEC (Accoustic Echo Cancellation) fails @configura

Post by shorne »

Should now be fixed.
mazilo
Posts: 45
Joined: Thu Sep 15, 2011 2:12 pm

Re: Speex AEC (Accoustic Echo Cancellation) fails @configura

Post by mazilo »

shorne wrote:Should now be fixed.
Yes and now configure works. However, there is still a minor problem in cross compilation as shown below. It doesn't seem to know what @PREFIX@ variable and also where to look for h323plus/include directory.

Code: Select all

make[5]: Entering directory `/opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs/src'
mipsel-openwrt-linux-uclibc-g++ -I/opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/ptlib2_svn/include  -DPTRACING=2 -D_REENTRANT -I/opt/openwrt-svn-trunk/staging_dir/target-mipsel_uClibc-0.9.33/usr/include     -fexceptions -I/opt/openwrt-svn-trunk/staging_dir/target-mipsel_uClibc-0.9.33/usr/include -I/opt/openwrt-svn-trunk/staging_dir/target-mipsel_uClibc-0.9.33/include -I/opt/openwrt-svn-trunk/staging_dir/toolchain-mipsel_gcc-4.6-linaro_uClibc-0.9.33/usr/include -I/opt/openwrt-svn-trunk/staging_dir/toolchain-mipsel_gcc-4.6-linaro_uClibc-0.9.33/include  -Wall  -Wformat -Wformat-security -D_FORTIFY_SOURCE=2  -fPIC -DPIC -DNDEBUG -Os  -I@PREFIX@/include/openh323 -fno-strict-aliasing -felide-constructors -Wreorder -I/opt/openwrt-svn-trunk/staging_dir/target-mipsel_uClibc-0.9.33/usr/include -I/opt/openwrt-svn-trunk/staging_dir/target-mipsel_uClibc-0.9.33/include -I/opt/openwrt-svn-trunk/staging_dir/toolchain-mipsel_gcc-4.6-linaro_uClibc-0.9.33/usr/include -I/opt/openwrt-svn-trunk/staging_dir/toolchain-mipsel_gcc-4.6-linaro_uClibc-0.9.33/include   -c h225_1.cxx -o /opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs/lib/obj/h225_1.o
h225_1.cxx:12:18: fatal error: h225.h: No such file or directory
compilation terminated.
make[5]: *** [/opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs/lib/obj/h225_1.o] Error 1
make[5]: Leaving directory `/opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs/src'
make[4]: *** [optshared] Error 2
make[4]: Leaving directory `/opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs/src'
make[3]: *** [optshared] Error 2
make[3]: Leaving directory `/opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs'
make[2]: *** [/opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs/.built] Error 2
make[2]: Leaving directory `/opt/OpenWRT/feeds/packages/libs/h323plus_cvs'
make[1]: *** [package/feeds/local/h323plus_cvs/compile] Error 2
make[1]: Leaving directory `/opt/openwrt-svn-trunk'
make: *** [package/h323plus_cvs/compile] Error 2
mazilo
Posts: 45
Joined: Thu Sep 15, 2011 2:12 pm

Re: Speex AEC (Accoustic Echo Cancellation) fails @configura

Post by mazilo »

I am now able to resolve the issue to cross compile H323Plus from the latest CVS trunk with a patch as shown below.

Code: Select all

--- a/src/Makefile
+++ b/src/Makefile
@@ -34,7 +34,7 @@ LIBRARY_MAKEFILE:=1
 include $(OPENH323DIR)/openh323u.mak
 
 # turn off strict-aliasing optimization, because it breaks the PDynaLink code
-STDCCFLAGS += -fno-strict-aliasing
+STDCCFLAGS += -fno-strict-aliasing -I../include
 
 OH323_OBJDIR = $(OH323_LIBDIR)/$(PT_OBJBASE)
 ifdef NOTRACE
It looks like -I../include is missing. So, I just added it in the CFLAGS of src/Makefile. When cross compilation for a MIPS platform is called with a make optshared, it produces both libh323_linux_mipsel__s.a and libh323_linux_mipsel_.so.2.11--alpha2 libraries as shown below:

Code: Select all

~ ls -lart lib/
total 38473
drwxr-xr-x  2 mazilo users     2456 Mar  9 10:18 obj
-rw-r--r--  1 mazilo users 25724590 Mar  9 10:18 libh323_linux_mipsel__s.a
-rwxr-xr-x  1 mazilo users 13624705 Mar  9 10:18 libh323_linux_mipsel_.so.2.11--alpha2
lrwxrwxrwx  1 mazilo users       37 Mar  9 10:18 libh323_linux_mipsel_.so -> libh323_linux_mipsel_.so.2.11--alpha2
drwxr-xr-x  3 mazilo users      216 Mar  9 10:18 .
drwxr-xr-x 11 mazilo users     1648 Mar  9 11:08 ..
Obviously, this will cause the installation stage to crash (see below) because the library naming doesn't seem to conform with the format, i.e. @MAJOR_VERSION@.@MINOR_VERSION@.@BUILD_NUMBER@, as set out by the main Makefile of H323Plus package.

Code: Select all

make -j1 -C /opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs DESTDIR="/opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs/ipkg-install" install
make[3]: Entering directory `/opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs'
mkdir -p /opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs/ipkg-install/usr//lib
rm -f /opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs/ipkg-install/usr//lib/libh323_*_r.so*
/usr/bin/install -c -m 444 lib/libh323_linux_mipsel_.so.1.24.1 /opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs/ipkg-install/usr//lib
/usr/bin/install: cannot stat `lib/libh323_linux_mipsel_.so.1.24.1': No such file or directory
make[3]: *** [install] Error 1
make[3]: Leaving directory `/opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs'
make[2]: *** [/opt/openwrt-svn-trunk/build_dir/target-mipsel_uClibc-0.9.33/h323plus_cvs/.built] Error 2
make[2]: Leaving directory `/opt/OpenWRT/feeds/packages/libs/h323plus_cvs'
make[1]: *** [package/feeds/local/h323plus_cvs/compile] Error 2
make[1]: Leaving directory `/opt/openwrt-svn-trunk'
make: *** [package/h323plus_cvs/compile] Error 2
As with the -I@PREFIX@/include/openh323, it is still there, but is harmless. Perhaps, it has nothing to do with H323Plus.
mazilo
Posts: 45
Joined: Thu Sep 15, 2011 2:12 pm

Re: Speex AEC (Accoustic Echo Cancellation) fails @configura

Post by mazilo »

Instead of my previous post about src/Makefile patch, I could also modify the openh323u.mak.in file (see the patch below) instead to yield the same result which I believe is a more elegant way (but don't know if that will cause other problems) to resolve the issue. As with the mismatch in library version during the installation stage, it remains unsolved.

Code: Select all

--- a/openh323u.mak.in
+++ b/openh323u.mak.in
@@ -70,11 +70,7 @@ LIBDIRS += $(OPENH323DIR)
 #OH323_SUPPRESS_H235   = 1
 
 OH323_SRCDIR = $(OPENH323DIR)/src
-ifdef PREFIX
-OH323_INCDIR = $(PREFIX)/include/openh323
-else
 OH323_INCDIR = $(OPENH323DIR)/include
-endif # PREFIX
 
 ifndef OH323_LIBDIR
 OH323_LIBDIR = $(OPENH323DIR)/lib
shorne
Posts: 45
Joined: Thu Aug 27, 2009 4:17 am

Re: Speex AEC (Accoustic Echo Cancellation) fails @configura

Post by shorne »

It looks like this error is coming from PTLIB. I understand they are working on it.
mazilo
Posts: 45
Joined: Thu Sep 15, 2011 2:12 pm

Re: Speex AEC (Accoustic Echo Cancellation) fails @configura

Post by mazilo »

shorne wrote:It looks like this error is coming from PTLIB. I understand they are working on it.
Thanks for the clarification.
mazilo
Posts: 45
Joined: Thu Sep 15, 2011 2:12 pm

Re: Speex AEC (Accoustic Echo Cancellation) fails @configura

Post by mazilo »

Just some (not so good) update::

I have created an additional quick-and-dirty patch for h323plus/Makefile.in file (see below) just to make the installation happy. In other words, this patch doesn't fix the wrong version naming set by PTLib macros. It is a temporary fix so that I package the cross compiled library to use.

Code: Select all

--- a/Makefile.in
+++ b/Makefile.in
@@ -86,7 +86,7 @@ docs:
 install:
        mkdir -p $(DESTDIR)$(LIBDIR)
        rm -f $(DESTDIR)$(LIBDIR)/libh323_*_r.so*
-       $(INSTALL) -m 444 lib/$(OH323_FILE).@MAJOR_VERSION@.@MINOR_VERSION@.@BUILD_NUMBER@ $(DESTDIR)$(LIBDIR)                                                                                          
+       $(INSTALL) -m 444 lib/$(OH323_FILE)$(LIBNAME_PAT) $(DESTDIR)$(LIBDIR)
        (cd $(DESTDIR)$(LIBDIR) ; \
                rm -f  $(OH323_FILE).@MAJOR_VERSION@.@MINOR_VERSION@ ; \
                ln -sf $(OH323_FILE).@MAJOR_VERSION@.@MINOR_VERSION@.@BUILD_NUMBER@ $(OH323_FILE).@MAJOR_VERSION@.@MINOR_VERSION@ \
Post Reply