User avatar
ajstarks
Posts: 129
Joined: Fri Jun 22, 2012 2:14 am

Working tiger demo?

Tue Jul 10, 2012 1:43 am

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?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 17760
Joined: Sat Jul 30, 2011 7:41 pm

Re: Working tiger demo?

Tue Jul 10, 2012 2:07 am

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.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

User avatar
ajstarks
Posts: 129
Joined: Fri Jun 22, 2012 2:14 am

Re: Working tiger demo?

Thu Jul 12, 2012 12:43 pm

I checked on the wheezy distro, but could not find it.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5097
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Working tiger demo?

Thu Jul 12, 2012 1:19 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.

smithnerd
Posts: 8
Joined: Thu Jun 14, 2012 1:18 pm

Re: Working tiger demo?

Thu Jul 12, 2012 5:02 pm

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...

User avatar
ajstarks
Posts: 129
Joined: Fri Jun 22, 2012 2:14 am

Re: Working tiger demo?

Fri Jul 13, 2012 1:27 am

great, @smithnerd. I previously got everything to compile, but was missing the initialization part. Is your code available?

smithnerd
Posts: 8
Joined: Thu Jun 14, 2012 1:18 pm

Re: Working tiger demo?

Fri Jul 13, 2012 12:19 pm

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

User avatar
ajstarks
Posts: 129
Joined: Fri Jun 22, 2012 2:14 am

Re: Working tiger demo?

Fri Jul 13, 2012 11:14 pm

Brilliant! works for me.

User avatar
ajstarks
Posts: 129
Joined: Fri Jun 22, 2012 2:14 am

Re: Working tiger demo?

Sat Jul 14, 2012 12:03 am

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

User avatar
mikerr
Posts: 2466
Joined: Thu Jan 12, 2012 12:46 pm
Location: Up north , UK
Contact: Website

Re: Working tiger demo?

Sat Jul 21, 2012 9:54 pm

Compiled fine on wheezy too, and here's a video:

http://www.youtube.com/watch?v=34VAez8xC9I
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
ajstarks
Posts: 129
Joined: Fri Jun 22, 2012 2:14 am

Re: Working tiger demo?

Fri Jul 27, 2012 4:37 am

See: http://www.raspberrypi.org/phpBB3/viewt ... 69&t=12575 for an example of using OpenVG to draw random shapes.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5097
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Working tiger demo?

Thu Aug 30, 2012 10:41 am

ajstarks wrote:See: http://www.raspberrypi.org/phpBB3/viewt ... 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.

User avatar
ajstarks
Posts: 129
Joined: Fri Jun 22, 2012 2:14 am

Re: Working tiger demo?

Fri Aug 31, 2012 10:05 pm

note that running this demo may lock up your machine -- you cannot Ctrl-C or ssh back in.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5097
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Working tiger demo?

Fri Aug 31, 2012 10:34 pm

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?

User avatar
ajstarks
Posts: 129
Joined: Fri Jun 22, 2012 2:14 am

Re: Working tiger demo?

Sat Sep 01, 2012 3:46 am

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.

myzinsky
Posts: 9
Joined: Fri Jul 27, 2012 9:52 pm

Re: Working tiger demo?

Sat Dec 08, 2012 8:13 pm

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

Return to “OpenVG”

Who is online

Users browsing this forum: No registered users and 1 guest