libavg is a high-level development platform for media-centric applications using Python as scripting language and written in C++.
Bear in mind that are many dependencies with libavg 1.6. I have not built all the libraries required, but instead simply taken the pre-built binaries and header files in the qemu overo image and copied the files as follows:
mkdir mnt
sudo mount -o loop,offset=$[106496*512] overo_sd_alip.img mnt
mkdir ~/edev/beagleboard/libs/lib -p
mkdir ~/edev/beagleboard/libs/include
cp mnt/usr/lib/* ~/edev/beagleboard/libs/lib/ -rf -d
cp mnt/lib/* ~/edev/beagleboard/libs/lib/ -rf -d
cp /mnt/usr/include/* ~/edev/beagleboard/libs/include -rf -d
sudo umount mnt
The -d flag skips the symlink, so we need to recreate then for all library so that the compiler can find libname.so instead of libname.so.12. Save the following scripts to symlinks.sh:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#!/bin/sh liblist=`ls *.so.??` for f in $liblist do echo $f fileres=`echo $f | sed 's/\..\{2\}$//'` ln -s $f $fileres done liblist=`ls *.so.?` for f in $liblist do echo $f fileres=`echo $f | sed 's/\..\{1\}$//'` ln -s $f $fileres done |
and run it where the arm libraries are located (in my case in /home/jaufranc/edev/beagleboard/libs/lib, /home/jaufranc/edev/beagleboard/libs/lib/arm-linux-gnueabi and /home/jaufranc/edev/beagleboard/libs/lib/mesa). This will create symlinks for most libraries, but not all. Some will still have to be created manually, e.g.:
ln -s libboost_thread.so.1.42.0 libboost_thread.so
ln -s libcrypto.so.0.9.8 libcrypto.so
ln -s libssl.so.0.9.8 libssl.so
Also delete the symlink between libjpeg.so and libjpeg.so.8 since we use another version of the library.
If a symlink is missing, we would generally get a warning of the type:
/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../../arm-linux-gnueabi/bin/ld: warning: libGL.so.1, needed by /home/jaufranc/edev/beagleboard/libs/lib/libGLU.so, not found (try using -rpath or -rpath-link)
Once this is done, here are the instructions to cross-compile libavg 1.6 for ARM:
- First build and install MesaLib for ARM (version 7.9.2), as the default Mesa/OpenGL library in the qemu image has more dependencies.
- Download libavg 1.6 source code
wget http://www.libavg.de/raw-attachment/wiki/DownLoad/libavg-1.6.0.tar.gz
- Extract it
tar xzvf libavg-1.6.0.tar.gz
cd libavg-1.6.0 - Install the following development packages:
sudo apt-get install libxml2-dev libpango1.0-dev libgraphicsmagick++1-dev libavformat-dev libavcodec-dev libfaad-dev libgsm1-dev libogg-dev libschroedinger-dev libspeex-dev libswscale-dev libboost-dev libboost-thread-dev
- Remove SSE2 options in configure script:
cat configure | sed s/-msse2// > configure.arm
mv configure.arm configure
chmod 755 configure - There is some x86 assembler in the code, we need to disable it.
Edit src/base/Exception.ccp and comment out the line:asm(“int $3”);
- To prevent testplayer from failing. Edit src/player/Makefile and make sure your replace occurences of -L/usr/include -lSDL, by -L/home/jaufranc/edev/beagleboard/libs/lib and create a symlink for the SDL library:
ln -s libSDL-1.2.so libSDL.so
You may also need to edit the Makefile as above for src/anim and src/wrapper
- Configure, build and install libavg:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
LDFLAGS="-L/home/jaufranc/edev/beagleboard/libs/lib \ -L/home/jaufranc/edev/beagleboard/libs/lib/mesa \ -L/home/jaufranc/edev/beagleboard/libs/lib/arm-linux-gnueabi -lGL -lX11 \ -lXext -lc -lxcb -lXau -lXdmcp -lz -llcms -ltiff -lfreetype -ljasper -ljpeg \ -lpng12 -lwmflite-0.2 -lltdl -lSM -lICE -lbz2 -luuid -lva -lgsm -lspeex \ -ltheoradec -ltheoraenc -lvorbis -lvorbisenc -lschroedinger-1.0 -lorc-0.4 \ -lvpx -logg -lpython2.7 -lcrypto -lssl -lpulse-simple -lpulse \ -lpulsecommon-0.9.22 -lX11-xcb -lXtst -lxcb-atom -ldbus-1 -lwrap -lsndfile \ -lFLAC -ldl -lm -lexpat -lpcre" \ CFLAGS="-I/home/jaufranc/edev/beagleboard/libs/include -I/usr/include" \ CXXFLAGS="-I/home/jaufranc/edev/beagleboard/libs/include -I/usr/include" \ ./configure --target=arm-linux-gnueabi --host=arm-linux-gnueabi \ --prefix=/home/jaufranc/edev/beagleboard/libs \ --includedir=/home/jaufranc/edev/beagleboard/libs/include/ \ BOOST_PYTHON_LIBS="-L/home/jaufranc/edev/beagleboard/libs/lib/arm-linux-gnueabi" \ --disable-v4l2 --disable-dc1394 --disable-sdltest make make install |
This was tested in Ubuntu 11.04 (natty) with linaro gcc toolchain.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
I’ve also cross-compiled it with Sourcery G++ Lite IA32 GNU/Linux TAR package using ARMEL debian squeeze libraries (used for Raspberry Pi) with the following configure script params: CFLAGS=-I/home/jaufranc/edev/raspberry-pi/libs/include CXXFLAGS=-I/home/jaufranc/edev/raspberry-pi/libs/include LDFLAGS="-L/home/jaufranc/edev/raspberry-pi/libs/lib -L/home/jaufranc/edev/raspberry-pi/libs/usr/lib -lGL -lX11 -lXxf86vm -lXdamage -lXfixes -ldrm \ -lXext -lc -lxcb -lXau -lXdmcp -lz -llcms -ltiff -lfreetype -ljasper -ljpeg \ -lpng12 -lwmflite-0.2 -lltdl -lSM -lICE -lbz2 -luuid -lgsm -lspeex \ -ltheoradec -ltheoraenc -lvorbis -lvorbisenc -lschroedinger-1.0 -lorc-0.4 \ -logg -lcrypto -lssl -lpulse-simple -lpulse -lgdbm -lcap -lasyncns \ -lpulsecommon-0.9.21 -lXtst -lxcb-atom -ldbus-1 -lwrap -lsndfile \ -lFLAC -ldl -lm -lexpat -lpcre -lXi -lattr -lgomp -ldirectfb -lfusion -ldirect -ldirac_encoder -lfaad -lopenjpeg -ltheora -lpython2.6" ./configure… Read more »
@Jean-Luc Aufranc (CNXSoft)
Finally, I had to use Sourcery G++ Lite 2010q1-202 for ARM GNU/Linux (an older version) to avoid problems while avg.so loads related to the toolchain having a more recent libstdc++ than the rootfs.
I also had to recompile dirac-1.0.2 and install libdirac_encoder.so to the rootfs.
With recent version of Linux (e.g. Debian Wheezy) , you’ll need to use libavg-1.7 because ffmpeg API has changed and breaks libavg-1.6
Hi @Jean-Luc Aufranc (CNXSoft).
I have a question about that installation parts. When i tried to use the command:
sudo mount -o loop,offset=$[106496*512]beagle_sd_alip_x11.img mnt
I always got the error which is:
mount: can’t find mnt in /etc/fstab or /etc/mtab
If you can give me a hand with that issue i ll be so glad. Thanks in advance.
@ deniztuna
There should be a space between $[106496*512] and beagle_sd_alip_x11.img
Unless you have any particular reason to build libavg 1.6, I would recommend you build the latest version of libavg (1.7). Instructions (using emdebian toolchain) @ http://www.cnx-software.com/2012/01/18/cross-compiling-libavg-1-7-for-arm-on-debian/
@ cnxsoft Thanks for the quick reply. It is ok now. But again I got a problem while trying to use the command: cp mnt/usr/lib/* ~/edev/beagleboard/libs/lib/ -rf -d Terminal is complaining about “cp: cannot stat `mnt/usr/lib/*’: No such file or directory”. I am following your instructions to get Xibo run on arm environment from that link:”http://www.cnx-software.com/2011/10/04/xibo-digital-signage-on-arm-beagleboard-overo/” . I created the folder of mnt but am I supposed to create mnt/usr and so on? About buiding 1.6. I dont know if 1.7 is compatitable with Xibo display so if it is ok I ll take a look at it other then… Read more »
@ deniztuna
Was the mount successful ?
It looks like mnt/usr/lib directory does not exist.
You may have to change 106496 in $[106496*512], following instruction in http://www.cnx-software.com/2011/09/29/how-to-transfer-files-between-host-and-qemu/:
fdisk -lu overo_sd_alip.img | grep overo
BTW, Xibo in ARM is very much work in progress. Do you have a specific ARM board, or do you intend to simply try it in QEMU ?
When I try to remount it again I got a warning which is: “mount: according to mtab /home/vestel/beagle_sd_alip_x11.img is already mounted on /mnt/ as loop” so i guess it is successful? I go over the link that you give and I got the same number too. I have a little info about that linux environment and the reason why I am trying to see the results of Xibo on ARM is we are using arm board on our smart boxes and want to implement a client into them. We got some parts from beagleboard so i ll give it a… Read more »
@ deniztuna
That means you mounted it in /mnt instead of mnt …
I’d be interested to know once you get it work on your board, since I don’t have an ARM board yet.
Yes. I figured it out afterwards too. Wasted a bit time on it tough=). Well I ll give information if i can do it properly.
Thanks for your patience.
Is that using linaro-toolchain-binaries with ubuntu desktop system to cross build libavg better?
@ Peter
I’m not sure if it’s better or not, but a lot of development for ARM is done on Ubuntu, so It might be a better idea.
The instructions above are for libavg 1.6, I’ve posted new ones for libavg 1.7, and if you checkout libavg from svn, it already supports ARM without modifying the code.