Page 1 of 1
Working tiger demo?
Posted: Tue Jul 10, 2012 1:43 am
by ajstarks
Has anyone managed to get a working tiger demo (see:
http://www.khronos.org/registry/vg/ri/openvg-1.1-ri.zip) on the Raspberry Pi?
My goal is to get a GPU-accelerated SVG implementation. Any clues?
Re: Working tiger demo?
Posted: Tue Jul 10, 2012 2:07 am
by jamesh
Tiger demo is on of the standard ones we run of the Videocore, so it definitely works - it may even be supplied in the distro. You'll need to take a look. Dom might be able to give more information.
Re: Working tiger demo?
Posted: Thu Jul 12, 2012 12:43 pm
by ajstarks
I checked on the wheezy distro, but could not find it.
Re: Working tiger demo?
Posted: Thu Jul 12, 2012 1:19 pm
by dom
We do build it for internal testing, but haven't so far been shipping it.
I had assumed it had some code/assets we couldn't distribute. However looking at the licence file, it looks like it is freely distributable, so I'll look into making our patched version of it available.
Re: Working tiger demo?
Posted: Thu Jul 12, 2012 5:02 pm
by smithnerd
I ported it to my Pi yesterday. It took some effort to understand how to marry the EGL initialisation parts of 'hello_triangle.c' with the windows only parts of the tiger demo 'main.c', but I got there in the end. It seems to render quite quickly at 1280x1024.
I'm sure my efforts won't be as polished as the official test version, so probably best to wait for that...
Re: Working tiger demo?
Posted: Fri Jul 13, 2012 1:27 am
by ajstarks
great, @smithnerd. I previously got everything to compile, but was missing the initialization part. Is your code available?
Re: Working tiger demo?
Posted: Fri Jul 13, 2012 12:19 pm
by smithnerd
Well, I warn you, it's a raw snapshot. A hack on a hack really, and based on skim-reading the Khronos OpenVG reference sheet, not the actual spec. Swap this out for main.c:
http://pastebin.com/raw.php?i=YAcPWmXR
I think I was compiling (on Raspbian) with:
gcc main.c tiger.c -o tiger \
-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads \
-L/opt/vc/lib -lEGL -lGLESv2 -lOpenVG -lbcm_host
Re: Working tiger demo?
Posted: Fri Jul 13, 2012 11:14 pm
by ajstarks
Brilliant! works for me.
Re: Working tiger demo?
Posted: Sat Jul 14, 2012 12:03 am
by ajstarks
Here's an updated main function based on the @smtihnerd's version.
It was size the tiger based on command arguments, and quit then your press [Enter].
int main (int argc, char **argv)
{
int w, h;
bcm_host_init();
memset( state, 0, sizeof( *state ) ); // clear application state
init_ogl(state); // Start OGLES
w = state->screen_width;
h = state->screen_height;
if (argc == 3) {
w = atoi(argv[1]);
h = atoi(argv[2]);
}
tiger = PS_construct(tigerCommands, tigerCommandCount, tigerPoints, tigerPointCount);
render(w, h);
while (getchar() != '\n') {
;
}
exit_func();
return 0;
}
Also, here's the Makefile:
tiger: tiger.o main.o
cc -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads tiger.o main.o -L/opt/vc/lib -lGLESv2 -o tiger
main.o: main.c
cc -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -c main.c
tiger.o: tiger.c
cc -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -c tiger.c
so that you can say:
make && tiger 1024 768
Re: Working tiger demo?
Posted: Sat Jul 21, 2012 9:54 pm
by mikerr
Compiled fine on wheezy too, and here's a video:
http://www.youtube.com/watch?v=34VAez8xC9I
Re: Working tiger demo?
Posted: Fri Jul 27, 2012 4:37 am
by ajstarks
See:
http://www.raspberrypi.org/phpBB3/viewt ... 69&t=12575 for an example of using OpenVG to draw random shapes.
Re: Working tiger demo?
Posted: Thu Aug 30, 2012 10:41 am
by dom
I've added a version of VG tiger demo to /opt/vc/src/hello_pi/hello_tiger in latest firmware.
Re: Working tiger demo?
Posted: Fri Aug 31, 2012 10:05 pm
by ajstarks
note that running this demo may lock up your machine -- you cannot Ctrl-C or ssh back in.
Re: Working tiger demo?
Posted: Fri Aug 31, 2012 10:34 pm
by dom
ajstarks wrote:note that running this demo may lock up your machine -- you cannot Ctrl-C or ssh back in.
Control-c should work fine.
Are you overclocking? What memory split are you on?
Re: Working tiger demo?
Posted: Sat Sep 01, 2012 3:46 am
by ajstarks
Ctrl-C works fine -- to a point. If you let it run for a while, it will continue to run, and then lock your machine. I'm running 128/128, no overclock.
Re: Working tiger demo?
Posted: Sat Dec 08, 2012 8:13 pm
by myzinsky
Hi,
im interested to render Sozi presentations on the Pi, will is this approach working for me?
Sozi:
http://sozi.baierouge.fr/wiki/en:welcome