Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
thakidd
PostPosted: Mar 10, 2009 - 05:44 PM
Newbie


Joined: Mar 10, 2009
Posts: 6


I have been eying the NGW100 and was wondering if it would be possible to install a cut down version of asterisk on it. I realize that I will only be able to squeeze 2-4 lines out of it but that will suite my home needs.

I did take a look at Astlinux and also at this forum. I see 3 people say they are going to do it and one person reporting they gave up.

Is there a reason why there are not more success stories on here about this combo?
 
 View user's profile Send private message  
Reply with quote Back to top
squidgit
PostPosted: Mar 10, 2009 - 11:08 PM
Raving lunatic


Joined: Sep 14, 2003
Posts: 4228
Location: Queanbeyan, Australia

ISTR the main problems were just getting the audio codecs compiled. This is occasionally a problem because the bright spark who wrote them assumed that everyone is running x86 so you may find either "accelerations" using x86 ASM or simply little-endian byte order assumptions which break on the big endianness of an AVR32.

There's no reason I can think of why it can't work in theory, it just turns out that in practice that particular set of software doesn't play nice with cross compilers. If you're ruthless with the --disable-<feature> and --without-<stuff> switches on the command line, limiting the build to exactly what you need, you should be able to get there.

-S.

_________________
Blag: http://www.niasdigital.com/blag
 
 View user's profile Send private message  
Reply with quote Back to top
thakidd
PostPosted: Mar 11, 2009 - 07:02 AM
Newbie


Joined: Mar 10, 2009
Posts: 6


excellent...well, i've been on Linux for 15 yrs and have been playing with smaller devices for 3-4 yrs. I'll give it a shot and see what I can come up with.

Worse case scenario...I have 50 other projects I could use the NGW100 for. Thanks for the input.
 
 View user's profile Send private message  
Reply with quote Back to top
w0067814
PostPosted: Mar 13, 2009 - 10:00 PM
Hangaround


Joined: Oct 09, 2001
Posts: 474
Location: Cambridge, UK

Not AVR32, but shows that it is possible on limited resources...

http://blackfin.uclinux.org/gf/project/asterisk/

Tim
 
 View user's profile Send private message  
Reply with quote Back to top
ponto18
PostPosted: Mar 30, 2009 - 07:09 PM
Newbie


Joined: Oct 10, 2008
Posts: 4


Hi thakidd!

I'm currently building a new kernel using Buildroot and I can't compile asterisk... when the buildroot kernel calls make to compile asterisk it says that i should configure asterisk before running make...

Have you been able to compile it for the NGW100?
 
 View user's profile Send private message  
Reply with quote Back to top
electricpenguin
PostPosted: Jun 30, 2009 - 06:13 PM
Newbie


Joined: Jun 30, 2009
Posts: 2


Hey guys,

So a few days ago I was looking for this exact thing. I know it's a bit late, but I was able to successfully compile Asterisk (albeit slimmed down) for my NGW100. It is now working just fine. That said, the default install (with a lot of excess voice files) is at least 20MB, so I have it running off an SD card, at least until I get some time to go in there and hack out what I don't need.

As squidgit said, there are in fact a couple of problems with certain audio codecs due to "optimizations" Smile -- the GSM codec is written entirely in assembly. The µLaw codec however (the one I needed) worked just fine. Step by steps follow.

0. AVR32 libtermcap.
Asterisk requires libtermcap. This is a statically linked library which I added to my buildroot (it won't get copied over). However, if you simply download libtermcap from ftp.gnu.org and configure it as follows, it will get put into your /opt.

Code:

AR=avr32-linux-ar AS=avr32-linux-as LD=avr32-linux-ld NM=avr32-linux-nm CC=avr32-linux-gcc CPP=avr32-linux-cpp \
GCC=avr32-linux-gcc CXX=avr32-linux-g++ RANLIB=avr32-linux-ranlib STRIP=avr32-linux-strip \
./configure --build=i386-pc-linux-gnu --host=avr32-linux-gnu \
--target=avr32-linux --prefix=/opt


Then make/make install it and you should be ready to proceed to the next step.

1. Begin by configuring properly.
Your --with-z should point to the staging directory of your buildroot, and your --prefix should point to where you want to install. In my case this was the SD card mount point. REMEMBER: I was unable to "sudo make install", it wouldn't find avr32-linux-gcc. So I had to make sure that the --prefix was chmod/chown'd and writable. Your --with-termcap may vary. If its in your buildroot it's problably not going to be /opt.

Code:

AR=avr32-linux-ar AS=avr32-linux-as LD=avr32-linux-ld NM=avr32-linux-nm CC=avr32-linux-gcc CPP=avr32-linux-cpp \
GCC=avr32-linux-gcc CXX=avr32-linux-g++ RANLIB=avr32-linux-ranlib STRIP=avr32-linux-strip \
./configure --build=i386-pc-linux-gnu --host=avr32-linux-gnu \
--target=avr32-linux --disable-nls --disable-static \
--without-pwlib --without-ssl \
--with-z=/home/martin/Desktop/Downloads/buildroot-avr32-v2.3.0/build_avr32/staging_dir/ \
--with-termcap=/opt \
--without-curl --without-popt --without-ogg --without-tds --without-sqlite --without-postgres \
--prefix=/media/disk


2. Make menuconfig:
Disable at LEAST:
Codec Translators/codec_gsm (Intel ASM)
Dialplan Functions/func_iconv (No iconv support)
PBX Modules/pbx_dundi (I couldn't make it work)

Disable at your option:
Anything you think you won't use.

Recommend Enabling:
Compiler Flags/LOW_MEMORY

3. Set the right architecture:
Edit makeopts
Change PROC=avr32 to PROC=ap on line 39 col 6
This affects the -march= flag.

4. IF you didn't add res_close to uClibc
edit main/dns.c
I commented out dns.c:292:11 res_close

Since uClibc doesn't include it by default it probably isn't needed right? Just throwing it out there... If I am wrong please feel free to let me know. I just couldn't for the life of me figure out how to add it to the buildroot properly. Linkage errors ensued.

5. Compile and Install
make
make install
[optionally] make samples

6. Stripping asterisk and friends.
As you may have noticed, the "strip" command probably failed. I noticed that this was because it was calling /usr/bin/strip instead of avr32-linux-strip like you told it to. 2 solutions.

a. Run avr32-linux-strip on all the binaries anyway was the default stripping probably would not have been aggressive enough for our tastes.

b. Edit build_tools/strip_nonapi and change line 33 such that it reads as follows, and [re] make/make install. That should work.

Code:

sed -e "s/^/-N /" striplist | xargs -n 40 avr32-linux-strip ${1}


That is the sum of all the knowledge that I acquired over the last 4 days in my spare time Razz Hope that it ends up helping someone. My NGW100 is now running my incoming VOIP line Smile Asterisk requires 2MB base RAM + (100kb RAM and 10-15% CPU)/SIPchannel@muLaw.
===========

Edit: This worked for Asterisk 1.6.1.1
 
 View user's profile Send private message  
Reply with quote Back to top
mattei
PostPosted: Oct 27, 2009 - 10:49 PM
Newbie


Joined: Dec 23, 2008
Posts: 19


Thanks a lot for your post.

I've compile succefully and tomarrow I test it in my NGW100.
 
 View user's profile Send private message  
Reply with quote Back to top
mattei
PostPosted: Dec 08, 2009 - 06:58 PM
Newbie


Joined: Dec 23, 2008
Posts: 19


Hi,

I try to compile asterisk for NGW100 but
in the compiling process it say that miss -ltermcap.

In th config.log there is:

configure:33502: result: no
configure:34203: checking for avr32-linux-gnu-gmime-config
configure:34233: result: no
configure:34243: checking for gmime-config
configure:34273: result: no
configure:34719: checking for tgetent in -ltermcap
configure:34754: /home/mattei/buildroot-avr32-v2.3.0/build_avr32/staging_dir/bin/avr32-linux-gcc -o conftest -g -O2 conftest.c -ltermcap -L/home/mattei/bu\
ildroot-avr32-v2.3.0/build_avr32/staging_dir//lib -lm >&5
/home/mattei/buildroot-avr32-v2.3.0/build_avr32/staging_dir//lib/libtermcap.a(termcap.o): warning: input is not relaxable
configure:34760: $? = 0
configure:34779: result: yes



configure:34974: checking for tgetent in -ltinfo
configure:35009: /home/mattei/buildroot-avr32-v2.3.0/build_avr32/staging_dir/bin/avr32-linux-gcc -o conftest -g -O2 conftest.c -ltinfo -lm >&5
/home/mattei/buildroot-avr32-v2.3.0/build_avr32/staging_dir/usr/bin/avr32-linux-uclibc-ld: cannot find -ltinfo
collect2: ld returned 1 exit status


Thanks in advance
Have a good day

Luigi
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits