[PD] spread Gem-computation over several dsp-cycles (?) (was: [Gem]: gem-pointer and [list] OR slow [repeat])

Roman Haefeli reduzierer at yahoo.de
Thu Mar 1 12:29:03 CET 2007


hello cyrille

thank you for the adjustments. i think i understand the difference
between measuring the gemhead loop and the time between 2 images. but
the other thing with the optimization still remains unclear to me and it
seems, that it doesn't work here. when i stop the first and start the
second gemhead, the gemwin becomes black. no primitives are drawn. there
is no error in the pd-window (there is only a message '[GEMglNewList]:
mode=4864' when i load the patch).
does the optimization need some flags enabled when compiling gem?

it seems, there is so much about gem, i don't know yet (like all these
objects [GEMgl*] and [GLdefine] and the like, or the message 'FSAA 4').
to understand them, is it needed to know opengl well? are these objects
documented somewhere in the Gem-documentation?

i am not insulted if you don't have the time to answer all these
questions...

cheers
roman
 
 

On Thu, 2007-03-01 at 11:18 +0100, cyrille henry wrote:
> i made some change to this abstraction in order to compute only the time use for the gemhead loop and not the time between 2 images.
> on my computer, it's about 11ms.
> but with the display list optimisation, it fall to 6ms about.
> 
> cyrille
> 
> Roman Haefeli a écrit :
> > as always: i forgot the attachment........
> > 
> > On Wed, 2007-02-28 at 23:24 +0100, Roman Haefeli wrote:
> >> On Wed, 2007-02-28 at 07:14 -0600, chris clepper wrote:
> >>> On 2/28/07, Roman Haefeli <reduzierer at yahoo.de> wrote:
> >>>         
> >>>         
> >>>         i might be wrong but in my eyes it doesn't make sense to do
> >>>         all the work
> >>>         that could be done in 50ms in only 1.45ms. 
> >>>
> >>> What?  GEM doesn't use the DSP clock.  It will take as much time as
> >>> needed to render.  
> >> oops. ok....
> >>  
> >>> For example, the current work I have uses three or four 1080i clips, a
> >>> live feed and records to disk and there is no way that all runs in
> >>> 1.45ms.  It takes about 12-15ms!
> >> anyway, i get dropouts when doing gem-rendering, although 'top' tells me
> >> that pd uses only 20% cpu-time. i don't care much about the audio (as
> >> IOhannes mentioned, i could run two instances of pd). the problem is
> >> that the timing is not nice. i'd like to run the patch with 20 frames
> >> per second. but in praxis each cycle needs 70ms, which gives me a
> >> framerate of 14. 
> >>
> >> is my gpu too slow? what happens, when the gpu is overloaded? can that
> >> cause pd to stuck?
> >>
> >> i attached a little gem-benchmark-test. although you say, gem doesn't
> >> use the dsp-clock, it takes much longer to compute the first block after
> >> a gem-rendering command. why is that? 
> >> and: here on my system, the [realtime] measures up to 70ms, when i go
> >> over [repeat 1400] (under 1400 it's 50ms). the funny thing is, that it
> >> stays around 70ms, even if i set the [repeat] up to 3000 or more. why is
> >> that? here on my system, cpu-time used by pd is always 20%.
> >>
> >> sorry to ask you so much...... but i try to understand things a bit
> >> better.......
> >>
> >> roman
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> 	
> >> 		
> >> ___________________________________________________________ 
> >> Der frhe Vogel fngt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
> >>
> >>
> >> _______________________________________________
> >> PD-list at iem.at mailing list
> >> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
> >>
> >> ------------------------------------------------------------------------
> >>
> >> #N canvas 394 19 736 552 10;
> >> #X obj 26 123 gemwin;
> >> #X obj 26 42 sel 0 1;
> >> #X msg 26 95 0 \, destroy;
> >> #X obj 26 19 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
> >> ;
> >> #X obj 216 102 gemhead;
> >> #X obj 216 152 translateXYZ 1 1 0;
> >> #X obj 23 152 gemhead;
> >> #X obj 23 210 world_light;
> >> #X msg 48 66 perspec -1 1 -1 1 2 2000 \, lighting 1 \, create \, 1
> >> ;
> >> #X obj 23 177 rotateXYZ 30 -54 0;
> >> #N canvas 1115 145 249 311 measure_realtime 0;
> >> #X obj 39 40 t b b;
> >> #X obj 39 256 outlet;
> >> #X obj 39 16 gemhead;
> >> #X obj 39 141 f;
> >> #X obj 39 186 +;
> >> #X obj 39 163 * 9;
> >> #X obj 39 209 * 0.1;
> >> #X obj 39 118 t b f;
> >> #X text 97 155 smooth it a bit;
> >> #X obj 39 62 realtime;
> >> #X connect 0 0 9 0;
> >> #X connect 0 1 9 1;
> >> #X connect 2 0 0 0;
> >> #X connect 3 0 5 0;
> >> #X connect 4 0 6 0;
> >> #X connect 5 0 4 0;
> >> #X connect 6 0 3 1;
> >> #X connect 6 0 1 0;
> >> #X connect 7 0 3 0;
> >> #X connect 7 1 4 1;
> >> #X connect 9 0 7 0;
> >> #X restore 198 339 pd measure_realtime;
> >> #X floatatom 198 368 5 0 0 0 - - -;
> >> #X obj 217 236 rotateXYZ 1 0 0;
> >> #X text 247 370 <- check if it goes higher than 50ms;
> >> #X obj 217 298 cube 0.02;
> >> #X obj 217 211 translateXYZ -0.001 0 0;
> >> #X obj 217 263 translateXYZ 0 0 0.02;
> >> #X obj 31 249 bang~;
> >> #X obj 31 276 t b b;
> >> #X obj 31 300 realtime;
> >> #X obj 31 326 t b f;
> >> #X obj 31 350 f;
> >> #X obj 58 351 + 1;
> >> #X obj 31 379 pack f f;
> >> #X obj 99 245 gemhead;
> >> #X obj 99 270 b;
> >> #X obj 99 293 0;
> >> #X floatatom 31 434 0 0 0 0 - - -;
> >> #X floatatom 85 435 0 0 0 0 - - -;
> >> #X floatatom 127 435 0 0 0 0 - - -;
> >> #X floatatom 171 436 0 0 0 0 - - -;
> >> #X floatatom 214 436 0 0 0 0 - - -;
> >> #X floatatom 255 437 0 0 0 0 - - -;
> >> #X text 37 457 1;
> >> #X text 94 458 2;
> >> #X text 135 458 3;
> >> #X text 180 459 4;
> >> #X text 225 459 5;
> >> #X obj 31 403 route 0 1 2 3 4 5;
> >> #X text 262 459 6;
> >> #X text 28 477 realtime measured lenght of the nth dsp-cycle after
> >> the [gemhead] starts rendering.;
> >> #X obj 216 129 rotateXYZ 0 0 90;
> >> #X obj 216 187 repeat 2000;
> >> #X text 55 17 <- rendering on/off;
> >> #X floatatom 380 146 5 0 0 0 - - -;
> >> #X text 425 143 <- try different 'loads';
> >> #X connect 1 0 2 0;
> >> #X connect 1 1 8 0;
> >> #X connect 2 0 0 0;
> >> #X connect 3 0 1 0;
> >> #X connect 4 0 41 0;
> >> #X connect 5 0 42 0;
> >> #X connect 6 0 9 0;
> >> #X connect 8 0 0 0;
> >> #X connect 9 0 7 0;
> >> #X connect 10 0 11 0;
> >> #X connect 12 0 16 0;
> >> #X connect 15 0 12 0;
> >> #X connect 16 0 14 0;
> >> #X connect 17 0 18 0;
> >> #X connect 18 0 19 0;
> >> #X connect 18 1 19 1;
> >> #X connect 19 0 20 0;
> >> #X connect 20 0 21 0;
> >> #X connect 20 1 23 1;
> >> #X connect 21 0 22 0;
> >> #X connect 21 0 23 0;
> >> #X connect 22 0 21 1;
> >> #X connect 23 0 38 0;
> >> #X connect 24 0 25 0;
> >> #X connect 25 0 26 0;
> >> #X connect 26 0 21 1;
> >> #X connect 38 0 27 0;
> >> #X connect 38 1 28 0;
> >> #X connect 38 2 29 0;
> >> #X connect 38 3 30 0;
> >> #X connect 38 4 31 0;
> >> #X connect 38 5 32 0;
> >> #X connect 41 0 5 0;
> >> #X connect 42 0 15 0;
> >> #X connect 44 0 42 1;
> >>
> >> ------------------------------------------------------------------------
> >>
> >> _______________________________________________
> >> PD-list at iem.at mailing list
> >> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
> plain text document attachment (gem_little_benchmark2.pd)
> #N canvas 21 42 892 721 10;
> #X obj 26 123 gemwin;
> #X obj 26 42 sel 0 1;
> #X msg 26 95 0 \, destroy;
> #X obj 26 19 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
> ;
> #X obj 216 102 gemhead;
> #X obj 216 152 translateXYZ 1 1 0;
> #X obj 23 152 gemhead;
> #X obj 23 210 world_light;
> #X obj 23 177 rotateXYZ 30 -54 0;
> #X obj 216 236 rotateXYZ 1 0 0;
> #X text 537 651 <- check if it goes higher than 50ms;
> #X obj 216 298 cube 0.02;
> #X obj 216 211 translateXYZ -0.001 0 0;
> #X obj 216 263 translateXYZ 0 0 0.02;
> #X obj 31 249 bang~;
> #X obj 31 276 t b b;
> #X obj 31 300 realtime;
> #X obj 31 326 t b f;
> #X obj 31 350 f;
> #X obj 58 351 + 1;
> #X obj 31 379 pack f f;
> #X obj 99 245 gemhead;
> #X obj 99 270 b;
> #X obj 99 293 0;
> #X floatatom 31 434 0 0 0 0 - - -;
> #X floatatom 85 435 0 0 0 0 - - -;
> #X floatatom 127 435 0 0 0 0 - - -;
> #X floatatom 171 436 0 0 0 0 - - -;
> #X floatatom 214 436 0 0 0 0 - - -;
> #X floatatom 255 437 0 0 0 0 - - -;
> #X text 37 457 1;
> #X text 94 458 2;
> #X text 135 458 3;
> #X text 180 459 4;
> #X text 225 459 5;
> #X obj 31 403 route 0 1 2 3 4 5;
> #X text 262 459 6;
> #X text 28 477 realtime measured lenght of the nth dsp-cycle after
> the [gemhead] starts rendering.;
> #X obj 216 129 rotateXYZ 0 0 90;
> #X obj 216 187 repeat 2000;
> #X text 55 17 <- rendering on/off;
> #X floatatom 380 146 5 0 0 0 - - -;
> #X text 425 143 <- try different 'loads';
> #X msg 48 66 perspec -1 1 -1 1 2 2000 \, FSAA 4 \, lighting 1 \, create
> \, 1;
> #X obj 486 558 f;
> #X obj 486 603 +;
> #X obj 486 580 * 9;
> #X obj 486 626 * 0.1;
> #X obj 486 535 t b f;
> #X obj 486 510 realtime;
> #X floatatom 486 651 5 0 0 0 - - -;
> #X obj 537 444 gemhead 99;
> #X obj 486 467 gemhead 1;
> #X obj 486 489 b;
> #X obj 537 489 b;
> #N canvas 192 353 840 624 optimized 0;
> #X obj 37 279 inlet gemlist;
> #X obj 37 384 outlet gemlist;
> #X obj 186 221 GEMglGenLists 1;
> #X obj 156 398 GEMglNewList;
> #X obj 37 322 GEMglCallList;
> #N canvas 0 0 450 300 once 0;
> #X obj 91 62 inlet;
> #X obj 91 266 outlet;
> #X obj 91 150 spigot 1;
> #X obj 91 175 t a b;
> #X msg 121 197 0;
> #X obj 298 57 inlet open;
> #X obj 298 92 t b;
> #X msg 142 128 1;
> #X connect 0 0 2 0;
> #X connect 2 0 3 0;
> #X connect 3 0 1 0;
> #X connect 3 1 4 0;
> #X connect 4 0 2 1;
> #X connect 5 0 6 0;
> #X connect 6 0 7 0;
> #X connect 7 0 2 1;
> #X restore 186 199 pd once;
> #N canvas 0 0 450 300 once 0;
> #X obj 91 62 inlet;
> #X obj 91 266 outlet;
> #X obj 91 150 spigot 1;
> #X obj 91 175 t a b;
> #X msg 121 197 0;
> #X obj 298 57 inlet open;
> #X obj 298 92 t b;
> #X msg 142 128 1;
> #X connect 0 0 2 0;
> #X connect 2 0 3 0;
> #X connect 3 0 1 0;
> #X connect 3 1 4 0;
> #X connect 4 0 2 1;
> #X connect 5 0 6 0;
> #X connect 6 0 7 0;
> #X connect 7 0 2 1;
> #X restore 156 372 pd once;
> #X obj 235 354 loadbang;
> #X obj 235 373 GLdefine GL_COMPILE;
> #X msg 230 178 bang;
> #X obj 156 488 GEMglEndList;
> #X obj 156 425 t a a;
> #X obj 156 113 gemhead 1;
> #X obj 316 267 t b;
> #X obj 156 138 t a a;
> #X obj 286 241 t f b;
> #X obj 165 268 t f f;
> #X msg 305 343 bang;
> #N canvas 0 0 360 251 primitive 0;
> #X obj 37 9 inlet gemlist;
> #X obj 34 68 rotateXYZ 1 0 0;
> #X obj 34 130 cube 0.02;
> #X obj 34 43 translateXYZ -0.001 0 0;
> #X obj 34 95 translateXYZ 0 0 0.02;
> #X connect 0 0 3 0;
> #X connect 1 0 4 0;
> #X connect 3 0 1 0;
> #X connect 4 0 2 0;
> #X restore 186 467 pd primitive;
> #X connect 0 0 4 0;
> #X connect 2 1 15 0;
> #X connect 3 0 11 0;
> #X connect 4 0 1 0;
> #X connect 5 0 2 0;
> #X connect 6 0 3 0;
> #X connect 7 0 8 0;
> #X connect 8 0 3 2;
> #X connect 9 0 5 1;
> #X connect 11 0 10 0;
> #X connect 11 1 18 0;
> #X connect 12 0 14 0;
> #X connect 13 0 6 1;
> #X connect 14 0 6 0;
> #X connect 14 1 5 0;
> #X connect 15 0 16 0;
> #X connect 15 1 13 0;
> #X connect 16 0 4 1;
> #X connect 16 1 3 1;
> #X connect 17 0 8 0;
> #X restore 624 283 pd optimized primitive;
> #X obj 624 168 gemhead;
> #X obj 624 218 translateXYZ 1 1 0;
> #X obj 624 195 rotateXYZ 0 0 90;
> #X obj 624 253 repeat 2000;
> #X floatatom 788 212 5 0 0 0 - - -;
> #X obj 310 101 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
> 1;
> #X obj 624 147 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
> 1;
> #X msg 624 125 0;
> #X obj 624 102 loadbang;
> #X connect 1 0 2 0;
> #X connect 1 1 43 0;
> #X connect 2 0 0 0;
> #X connect 3 0 1 0;
> #X connect 4 0 38 0;
> #X connect 5 0 39 0;
> #X connect 6 0 8 0;
> #X connect 8 0 7 0;
> #X connect 9 0 13 0;
> #X connect 12 0 9 0;
> #X connect 13 0 11 0;
> #X connect 14 0 15 0;
> #X connect 15 0 16 0;
> #X connect 15 1 16 1;
> #X connect 16 0 17 0;
> #X connect 17 0 18 0;
> #X connect 17 1 20 1;
> #X connect 18 0 19 0;
> #X connect 18 0 20 0;
> #X connect 19 0 18 1;
> #X connect 20 0 35 0;
> #X connect 21 0 22 0;
> #X connect 22 0 23 0;
> #X connect 23 0 18 1;
> #X connect 35 0 24 0;
> #X connect 35 1 25 0;
> #X connect 35 2 26 0;
> #X connect 35 3 27 0;
> #X connect 35 4 28 0;
> #X connect 35 5 29 0;
> #X connect 38 0 5 0;
> #X connect 39 0 12 0;
> #X connect 41 0 39 1;
> #X connect 43 0 0 0;
> #X connect 44 0 46 0;
> #X connect 45 0 47 0;
> #X connect 46 0 45 0;
> #X connect 47 0 44 1;
> #X connect 47 0 50 0;
> #X connect 48 0 44 0;
> #X connect 48 1 45 1;
> #X connect 49 0 48 0;
> #X connect 51 0 54 0;
> #X connect 52 0 53 0;
> #X connect 53 0 49 0;
> #X connect 54 0 49 1;
> #X connect 56 0 58 0;
> #X connect 57 0 59 0;
> #X connect 58 0 57 0;
> #X connect 59 0 55 0;
> #X connect 60 0 59 1;
> #X connect 61 0 4 0;
> #X connect 62 0 56 0;
> #X connect 63 0 62 0;
> #X connect 64 0 63 0;
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list




	
		
___________________________________________________________ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de





More information about the Pd-list mailing list