g729 for Cubietruck (arm)

913 views
Skip to first unread message

Carlos Rey-Moreno

unread,
May 31, 2014, 2:23:58 AM5/31/14
to asteri...@googlegroups.com
Good morning, 

I would like to know if someone could help me with the following problem. I am helping out in this project: http://villagetelco.org/deployments/nyandeni-south-africa/ and as a server to install the asterisk handling the simultaneous break-out calls we purchased the following device: http://www.cubietruck.com/collections/frontpage/products/cubietruck-cubieboard3-cortex-a7-dual-core-2gb-ram-8gb-flash-with-wifi-bt. The VoIP provider that we have selected (which is way cheaper than any other) only uses g.729.

We wanted to do everything legal, so we purchased four g.729 licenses. However, we were unable to activate them as Digium only produces binaries for x86 and x86_64 architectures, and the Cubietruck is an arm device. Here is the output f "uname -a":
Linux cubietruck 3.4.79 #6 SMP PREEMPT Fri Feb 14 23:58:54 CST 2014 armv7l armv7l armv7l GNU/Linux

I wonder if anyone could help me to find an alternative for the hardware above. My version of asterisk is Asterisk 1.8.13.1~dfsg-1ubuntu2

Thank you very much in advance,

carlos

Arkadi Shishlov

unread,
May 31, 2014, 2:46:59 AM5/31/14
to asteri...@googlegroups.com
I suggest you to build Bcg729 and then latest asterisk-g72x --with-bcg729
https://bitbucket.org/arkadi/asterisk-g72x/src/tip/README.md
configure.ac might need adjustment as there is an ad-hoc CFLAGS
settings when armv6l-*-linux-gnueabihf* is detected. Cross-compile is
probably broken. Please send a pull request with enhancements.

Carlos Rey-Moreno

unread,
Jun 2, 2014, 12:58:12 PM6/2/14
to asteri...@googlegroups.com
Hi Arkadi, thanks a lot for your answer. I have been trying to build bcg729, but I am encountering the following problem:

Making all in msbcg729
make[2]: Entering directory `/home/linaro/bcg729/msbcg729'
  CC     libmsbcg729_la-bcg729_dec.lo
bcg729_dec.c: In function 'filter_process':
bcg729_dec.c:53:4: error: implicit declaration of function 'mblk_meta_copy' [-Werror=implicit-function-declaration]
bcg729_dec.c:67:3: error: implicit declaration of function 'mblk_set_plc_flag' [-Werror=implicit-function-declaration]
bcg729_dec.c: At top level:
bcg729_dec.c:92:5: error: 'MS_DECODER_HAVE_PLC' undeclared here (not in a function)
cc1: all warnings being treated as errors
make[2]: *** [libmsbcg729_la-bcg729_dec.lo] Error 1

configure finishes without errors, and make do not complain until this point. I am using a version of bcg7219 obtained via "git clone git://git.linphone.org/bcg729.git"

To be able to run configure I have modified CFLAGS in configure.ac for matching my architecture:
CFLAGS="$CFLAGS -Werror -O3 -funroll-loops -marm -march=armv7-a -mtune=cortex-a7"

Additionally I have updated the version of ortp and mediastreamer in ortp.pc and mediastreamer.pc to match the one of those used (I have downloaded them from the Ubuntu Repositories and they are both version 3.5.2-10.

I think the problem is related to pkg-config and how it links to ortp and medistreamer, as in a previous iteration the configure finished without problem but reporting checking ortp and mediastreamer "no". After that configure, make finished successfully. It is only been since I have updated their version in the pc files, that this problem appears when running make. 

I have included the complete path in the different include in bcg729_dec.c to point to the headers from mediastreamer2 but the problem persists. 

I have also tried to compile ortp (to build mediastremer2 afterwards) from the sources provided in linphone, but I encounter a problem with the srtp library that I don't know how to solve either. 

I hope you can provide any advice on how to proceed forward. 

Thank you very much in advance, 

--
You received this message because you are subscribed to the Google Groups "Asterisk G.729" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asterisk-g72...@googlegroups.com.
To post to this group, send email to asteri...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/asterisk-g729/CALGZcDLrGHH_XtCkLgNNO6kUEVptjaqfoi4pTx%3DfU-Ab1iAoUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Carlos Rey-Moreno
Research Assistant
Office 1.28
Department of Computer Science
University of the Western Cape
Private Bag X17 - Bellville, 7535
Cape Town - South Africa
Tel: +27 (0) 21 959 2562 Cel: +27 (0) 76 986 3633
Skype: carlos.reymoreno Twitter: Creym

Arkadi Shishlov

unread,
Jun 2, 2014, 3:47:05 PM6/2/14
to asteri...@googlegroups.com
On Mon, Jun 2, 2014 at 7:58 PM, Carlos Rey-Moreno
<carlos.r...@gmail.com> wrote:
> Hi Arkadi, thanks a lot for your answer. I have been trying to build bcg729,
> but I am encountering the following problem:

You may probably want to report that to bcg729 authors.

Mediastreamer part is not needed for codec_g729.
Straightforward ./configure && make install works fine for me on amd64.
-rw-r--r-- 1 root root 3078 Jan 31 14:01 /usr/local/include/bcg729/decoder.h
-rw-r--r-- 1 root root 3056 Jan 31 14:01 /usr/local/include/bcg729/encoder.h
-rw-r--r-- 1 root root 256868 Jan 31 14:01 /usr/local/lib/libbcg729.a
-rwxr-xr-x 1 root root 949 Jan 31 14:01 /usr/local/lib/libbcg729.la*
lrwxrwxrwx 1 root root 18 Jan 31 14:01 /usr/local/lib/libbcg729.so
-> libbcg729.so.0.0.0*
lrwxrwxrwx 1 root root 18 Jan 31 14:01
/usr/local/lib/libbcg729.so.0 -> libbcg729.so.0.0.0*
-rwxr-xr-x 1 root root 148300 Jan 31 14:01 /usr/local/lib/libbcg729.so.0.0.0*

Carlos Rey-Moreno

unread,
Jun 3, 2014, 11:05:18 AM6/3/14
to asteri...@googlegroups.com
Hi Arkadi, thank you very much for your swift answer. 

If the medistreamer part is not needed for the codec_g729, then everything compiles fine, and I have the same file as you do with the same permissions. 

The configure of asterisk-g72x --with-bcg729 --with-asterisk18 also finishes without reporting problems:
Architecture: armv7l
  CPU -march: native
      CFLAGS: -O3 -fomit-frame-pointer -march=native -flto -O3 -funroll-loops -marm -mtune=cortex-a7 -Wall  
     LDFLAGS: -fwhole-program
 Codecs impl: Bcg729

I have added the following in the "case" for the Raspberry-Pi
  armv7l-unknown-linux-gnueabihf*)
    cflags="-O3 -funroll-loops -marm -mtune=cortex-a7 -Wall"
    march="armv7-a"
    ;;

I am surprised the configure does not pick up the architecture, which could be quite handy for additional optimizations, do you know how to change it?

Make also finishes without problems after the installation of asterisk-dev. I would like the architecture to be recognized properly before proceeding with the installation, can you advice?

Thanks again, 

carlos



--
You received this message because you are subscribed to the Google Groups "Asterisk G.729" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asterisk-g72...@googlegroups.com.
To post to this group, send email to asteri...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Arkadi Shishlov

unread,
Jun 3, 2014, 12:58:39 PM6/3/14
to asteri...@googlegroups.com
On Tue, Jun 3, 2014 at 6:05 PM, Carlos Rey-Moreno
<carlos.r...@gmail.com> wrote:
> I am surprised the configure does not pick up the architecture

What does it mean exactly?
Autoconf is no magic, everything is written in ./configure.ac.
If you want to see your changes incorporated, please submit a pull request.

Carlos Rey-Moreno

unread,
Jun 3, 2014, 11:43:04 PM6/3/14
to asteri...@googlegroups.com

> I am surprised the configure does not pick up the architecture

What does it mean exactly?

The configure reports: 

Architecture: armv7l
  CPU -march: native
      CFLAGS: -O3 -fomit-frame-pointer -march=native -flto -O3 -funroll-loops -marm -mtune=cortex-a7 -Wall  
     LDFLAGS: -fwhole-program
 Codecs impl: Bcg729

i.e., -march=native and is with those flags that it is going to compile. I'd like to compile with march=armv7-a which is the option I have included in the code, why it is get overridden? you know where can I modify this so if anyone else modify further the code in the case and keep on adding architectures the option -march used is considered when compiling instead of native?

thanks
 
Autoconf is no magic, everything is written in ./configure.ac.
If you want to see your changes incorporated, please submit a pull request.
--
You received this message because you are subscribed to the Google Groups "Asterisk G.729" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asterisk-g72...@googlegroups.com.
To post to this group, send email to asteri...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Carlos Rey-Moreno

unread,
Jun 4, 2014, 3:29:44 AM6/4/14
to asteri...@googlegroups.com
Hi, I don't if it's related to the point in the previous email, but after make install, and restarting asterisk g729 row and column appear empty in when doing "core show translation recalc 10".

The codec appears in asterisk modules folder.
$ ls -al /usr/lib/asterisk/modules/codec_g729.so
-rwxr-xr-x 1 root root 14919 Jun  4 08:51 /usr/lib/asterisk/modules/codec_g729.so

Hope you can help. 

Thanks in advance.

carlos

Carlos Rey-Moreno

unread,
Jun 4, 2014, 3:56:27 AM6/4/14
to asteri...@googlegroups.com
It loads now, I just had to create the following symbolik link:
ln -s /usr/local/lib/libbcg729.so.0 /lib/libbcg729.so.0

ldd became very handy

thanks for the support!

carlos

Arkadi Shishlov

unread,
Jun 4, 2014, 4:01:56 AM6/4/14
to asteri...@googlegroups.com

try running ldconfig instead

augus...@tiscali.it

unread,
Jul 3, 2014, 4:25:27 AM7/3/14
to asteri...@googlegroups.com
Hi Carlos,
please could you  help me ? I have compiled by ./configure && make && make install the bcg729 codec and I have the files:

-rw-r--r-- 1 root root 173K Jul  3 10:14 libbcg729.a
-rwxr-xr-x 1 root root  949 Jul  3 10:14 libbcg729.la
lrwxrwxrwx 1 root root   18 Jul  3 10:14 libbcg729.so -> libbcg729.so.0.0.0
lrwxrwxrwx 1 root root   18 Jul  3 10:14 libbcg729.so.0 -> libbcg729.so.0.0.0
-rwxr-xr-x 1 root root 116K Jul  3 10:14 libbcg729.so.0.0.0
drwxr-xr-x 2 root root 4.0K Jul  3 10:14 pkgconfig

but I have any file codec_g729.so in /usr/lib/asterisk/modules, please can explain me how I can obtain the module for asterisk ?

I have installed asterisk manually and fully compiled on my armv7.

Thanks in advance for your help !

Augusto

Arkadi Shishlov

unread,
Jul 3, 2014, 2:10:28 PM7/3/14
to asteri...@googlegroups.com
On Thu, Jul 3, 2014 at 11:25 AM, <augus...@tiscali.it> wrote:
> please could you help me ? I have compiled by ./configure && make && make
> install the bcg729 codec and I have the files:

Very good! Then you download asterisk-g72x release and compile and
install that passing --with-bcg729 to ./configure.
For details read
https://bitbucket.org/arkadi/asterisk-g72x

augusto su tiscali

unread,
Jul 5, 2014, 1:06:51 PM7/5/14
to asteri...@googlegroups.com
Thanks Arkadi. I have codec G729 in my asterisk

Thanks for your Help !

Augusto

poj...@gmail.com

unread,
Aug 26, 2014, 9:24:15 PM8/26/14
to asteri...@googlegroups.com
Привет Arcadi,

Need your help, can't figure out the problem. Trying to compile on FreeBSD10

Installing Bcg729 (after ./configure && make):
[root@pojogas /home/zeus/bcg729-1.0.0]# make install
Making install in src
test -z "/usr/local/lib" || ../build-aux/install-sh -c -d "/usr/local/lib"
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libbcg729.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libbcg729.lai /usr/local/lib/libbcg729.la
libtool: install: /usr/bin/install -c .libs/libbcg729.a /usr/local/lib/libbcg729.a
libtool: install: chmod 644 /usr/local/lib/libbcg729.a
libtool: install: ranlib /usr/local/lib/libbcg729.a
Making install in include
Making install in bcg729
test -z "/usr/local/include/bcg729" || ../../build-aux/install-sh -c -d "/usr/local/include/bcg729"
 /usr/bin/install -c -m 644 encoder.h decoder.h '/usr/local/include/bcg729'
Making install in test
Making install in bin
test -z "/usr/local/lib/pkgconfig" || build-aux/install-sh -c -d "/usr/local/lib/pkgconfig"
 /usr/bin/install -c -m 644 libbcg729.pc '/usr/local/lib/pkgconfig'

Looks good, but when I try to configure asterisk-g72x:
[root@pojogas /home/zeus/asterisk-g72x-1.2]# ./configure --enable-pentium4 --with-asterisk100 --with-bcg729

I get this error:
checking whether C compiler accepts -flto... yes
checking for initBcg729EncoderChannel in -lbcg729... no
configure: error: unable to find Bcg729 library

Спасибо!

Arkadi Shishlov

unread,
Aug 27, 2014, 3:53:29 AM8/27/14
to asteri...@googlegroups.com
On Wed, Aug 27, 2014 at 4:24 AM, <poj...@gmail.com> wrote:
> checking whether C compiler accepts -flto... yes
> checking for initBcg729EncoderChannel in -lbcg729... no
> configure: error: unable to find Bcg729 library

Look into config.log

poj...@gmail.com

unread,
Aug 27, 2014, 10:08:31 AM8/27/14
to asteri...@googlegroups.com
Found the log file (attached), however can't figure out what is wrong or missing :(

May be you can have a look please? Thanks!
config.log

Arkadi Shishlov

unread,
Aug 27, 2014, 2:22:03 PM8/27/14
to asteri...@googlegroups.com
> configure:12230: checking for initBcg729EncoderChannel in -lbcg729
> configure:12255: cc -o conftest -g -O2 -I/usr/local/include conftest.c -lbcg729 >&5
> /usr/bin/ld: cannot find -lbcg729
> cc: error: linker command failed with exit code 1 (use -v to see invocation)

Check you have bcg729 .so symlink in addition to .so.0 symlink in
/usr/local/lib/
Create symlink if absent.
Set LIBRARY_PATH=/usrlocal/lib before invoking ./configure in case
problem persist.
https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html

I'll commit a fix for FreeBSD to repo a little bit later.

poj...@gmail.com

unread,
Aug 27, 2014, 6:33:04 PM8/27/14
to asteri...@googlegroups.com
Ok, I would, but I don't have a bcg729.so file, just these two:

[root@pojogas /home/zeus/asterisk-g72x-1.2]# ls -alh /usr/local/lib/ | grep bcg
-rw-r--r--   1 root  wheel   179K Aug 26 21:16 libbcg729.a
-rwxr-xr-x   1 root  wheel   889B Aug 26 21:16 libbcg729.la

Also this one here:
[root@pojogas /home/zeus/bcg729-1.0.0]# ls -alh /usr/local/lib/pkgconfig/
-rw-r--r--   1 root  wheel   266B Aug 26 21:16 libbcg729.pc

Did I compile Bcg729 incorrectly? Thanks!

Arkadi Shishlov

unread,
Aug 27, 2014, 7:43:47 PM8/27/14
to asteri...@googlegroups.com
On Thu, Aug 28, 2014 at 1:33 AM, <poj...@gmail.com> wrote:
> Ok, I would, but I don't have a bcg729.so file, just these two:
>
> [root@pojogas /home/zeus/asterisk-g72x-1.2]# ls -alh /usr/local/lib/ | grep
> bcg
> -rw-r--r-- 1 root wheel 179K Aug 26 21:16 libbcg729.a

It's ok. Set LIBRARY_PATH, it should work.
Reply all
Reply to author
Forward
0 new messages