I’m sure most of you have heard of the Raspberry Pi, a $25 ARM computer that runs Linux. We’ve spent quite a bit of time in the last weeks getting libavg to run on this machine, and I’m happy to say that we have a working beta. We render to a hardware-accelerated OpenGL ES surface and almost all tests succeed. Besides full image, text and software video support, that includes all compositing and even offscreen rendering and general support for shader-based FX. We have brief setup instructions at https://www.libavg.de/site/projects/libavg/wiki/RPI. Update: The setup instructions have been updated for cross-compiling (much faster!) and moved to https://www.libavg.de/site/projects/libavg/wiki/RaspberryPISourceInstall.
Most of the work was getting libavg to work with OpenGL ES. We now decide whether to use desktop or mobile OpenGL depending on a configure switch, an avgrc
entry and the hardware capabilities. Along the way, we implemented mobile context support under Linux for NVidia and Intel graphics systems, so we can now test most things without actually running (and compiling!) things on the Raspberry. Speaking of which – compiling for the Raspberry takes a long time. Compiling on it is impossible because there just isn’t enough memory. We currently chroot into a Raspberry file system and compile there (see the notes linked above).
A lot of things are already implemented the way they should be for a mobile system. That means that, for example, bitmaps are loaded (and generated, and read back from texture memory…) in either RGB or BGR pixel formats depending on the flavor of OpenGL used and the vertex arrays are smaller now so we save bandwidth. Still, there’s a lot of optimization to do. Our next step is getting things stable and fast. We want hardware video decoding, compressed textures – and in general, we’ll be profiling to find spots that take more time than they should.
Really appreciate the progress on this, keep up the good work.
What is different between libavg and qt5 ?
If I look for best what should I choose libavg or qt5 ?
I think it depends on what you’re trying to achieve. If you want a full-featured GUI toolkit for traditional WIMP GUIs, by all means use QT. If your application works with a lot of media and has a more experimental, possibly touch-centric user interface, try libavg. libavg has a wealth of features that make rendering complex scenes easy – see https://www.libavg.de/site/projects/libavg/wiki/FeatureList.
Did you try QML in Qt5 ?
it is really magic JS + QML is really good idea
qml and all transitions and animation stuff
plus mixing with pure opengl for game/custom engine for example
I really appreciate your wonderful job…
I just got my RasPI last week and try to put libavg on it.
Unfortunately, no matter what method I used (install precompiled package / compiling libavg from source), I always got error messages when I tried to run the sample firebird.
”
Traceback (most recent call last):
File “firebirds.py”, line 32, in
from libavg import avg, player
File “/usr/local/lib/python2.7/dist-packages/libavg/__init__.py”, line 10, in
from avg import *
ImportError: /usr/local/lib/python2.7/dist-packages/libavg/avg.so: cannot open shared object file: No such file or directory
”
I’m sure avg.so exists, and also every relative library (list from “readelf -d”).
Did I miss something?
Appreciate any comments…
Thank you.
Are you sure that avg.so is in the correct directory? What does “locate avg.so” output? One potential snag is that the build process puts everything in site-packages/, while the Raspberry expects dist-packages/.
Thank you uzadow,
I’m sorry I don’t have the device on my hand right now to copy the output message, but I’m pretty sure avg.so is in the right directory ( /usr/local/lib/python2.7/dist-packages/libavg/ ).
1st time I used precompiled package. Unpacked it into /usr/local and then found the error message.
2nd time I checked out the latest code and followed the steps to build, install, rename the directory and copy to RasPI.
So I’m sure and keep the the directory correctly named “dist-packages”
The only different thing is I did not use the same image file “2012-10-28-wheezy-raspbian.zip” as wiki, but “2012-12-16-wheezy-raspbian.zip”.
Also, I had to include “X11/Xlib.h” and “X11/Xutil.h” in X11Display.h in latest code checked out from SVN or I would get an error during compile time.
Is this cause the issue?
I’ll tried to mount my SD card directly to build libavg.
It should make everything exactly the same…
Hi uzadow,
Finally I made libavg work on my PI.
I think the problem maybe the version mismatch in some of my libraries.
Thank you again for your great jobs.
Cheers,
Paul
Hello,
I want to build libavg on my new RaspberryPi2 for Xibo.
My steps are,
1.) git clone https://github.com/libavg/libavg.git libavg
2.) cd libavg
3.) ./bootstrap
4.) ./configure –enable-rpi –prefix=/home/pi/raspberryPi2/install_release
That results in a error.
CXXLD testgraphics
CXX testgpu.o
CXXLD testgpu
/usr/bin/ld: ./.libs/libgraphics.a(BCMDisplay.o): undefined reference to symbol ‘vc_dispmanx_element_add’
//opt/vc/lib/libbcm_host.so: error adding symbols: DSO missing from command line
collect2: ld returned 1 exit status
Makefile:668: recipe for target ‘testgpu’ failed
make[4]: *** [testgpu] Error 1
make[4]: Leaving directory ‘/home/pi/raspberryPi2/libavg/src/graphics’
Makefile:795: recipe for target ‘all-recursive’ failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory ‘/home/pi/raspberryPi2/libavg/src/graphics’
Makefile:385: recipe for target ‘all-recursive’ failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory ‘/home/pi/raspberryPi2/libavg/src’
Makefile:323: recipe for target ‘all’ failed
make[1]: *** [all] Error 2
make[1]: Leaving directory ‘/home/pi/raspberryPi2/libavg/src’
Makefile:389: recipe for target ‘all-recursive’ failed
make: *** [all-recursive] Error 1
On Stack Overflow a user told me, compile it with -lbcm_hosts. But I don’t know, how. Is that the right way?
Best regards
Nelson
I add -lbcm_host to $LDFLAGS in the configure file.
My line looks like so.
LDFLAGS=”$LDFLAGS -L/opt/vc/lib -lbcm_host”
The build process continues and break on a different file.
I posted it on Stack Overflow.
http://stackoverflow.com/questions/28819097/compiling-libavg-on-raspberry-pi2
The Error came from Hellbender’s makefile. Whitout that file, libavg build’s correctly.
In the modified Makefile libavg is compiled with libbrowsernode support.
Is there a way to do that?