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?
Working tiger demo?
16 posts
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.
- Moderator
- Posts: 6468
- Joined: Sat Jul 30, 2011 7:41 pm
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.
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.
- Moderator
- Posts: 3248
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
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...
I'm sure my efforts won't be as polished as the official test version, so probably best to wait for that...
- Posts: 8
- Joined: Thu Jun 14, 2012 1:18 pm
great, @smithnerd. I previously got everything to compile, but was missing the initialization part. Is your code available?
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
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
- Posts: 8
- Joined: Thu Jun 14, 2012 1:18 pm
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
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
Pi count: 4 - File & print server / Wifi Webcam server, XBMC and tinkerPi !
See: viewtopic.php?f=69&t=12575 for an example of using OpenVG to draw random shapes.
ajstarks wrote:See: viewtopic.php?f=69&t=12575 for an example of using OpenVG to draw random shapes.
I've added a version of VG tiger demo to /opt/vc/src/hello_pi/hello_tiger in latest firmware.
- Moderator
- Posts: 3248
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
note that running this demo may lock up your machine -- you cannot Ctrl-C or ssh back in.
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?
- Moderator
- Posts: 3248
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
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.
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
im interested to render Sozi presentations on the Pi, will is this approach working for me?
Sozi: http://sozi.baierouge.fr/wiki/en:welcome
- Posts: 8
- Joined: Fri Jul 27, 2012 9:52 pm