Hi,

I'm observing an unexpected behavior that may be a bug, but i'd like to be sure before I file it to the tracker, so please if anybody can show me this is the expected behavior and explain why, or confirm this is a bug, I would be grateful.

In the attached patch I have two gemheads; the first one is used just as a trigger (it is connected to a [t b]). The second one (their render order is relevant) is driving a pix_film.

What I do in the test patch is basically show the following situation:

- while the second gemhead is turned on, I send a frame number to its pix_film, to place it at frame M, which is actually shown
- then I turn off the second gemhead
- the first gemhead is triggering a message with number N which is sent through a spigot to pix_film's inlet, but the spigot is closed, so pix_film is not receiving the frame number and the last it received was M - then I open that spigot so that pix_film will soon receive the number N triggered by the first gemhead. Immediately, I also turn on the second gemhead which is driving the pix_film.

So I would expect the following to happen: at the next frame rendering, first the first gemhead will trigger the number N that will reach pix_film's inlet; then the second gemhead will output the gemlist (for the first time since it has been turned on), causing pix_film to output the new frame N which will show up on the rectangle as soon as it appears.

Instead, what I observe is the following: first the first gemhead triggers the number N that reaches pix_film's inlet; then the second gemhead outputs the gemlist, causing the rectangle to appear, but pix_film doesn't output a new image, so the rectangle appears with frame M as its texture. Only at the next frame, pix_film outputs the new image which is drawn on the rectangle.

So during one frame when the rectangle turns on, you see a flash of a frame you shouldn't see.

The attached patch shows (or I think it shows) that what happens is what I have described, that is, it shows that the order in which gemheads output their gemlists and the numbers are sent are the expected ones, and the unexpected thing is that pix_film outputs the new frame one frame too late.


To test the test patch you need a video called video.mov of at least 100 frames (I used M=100 and N=2). Just click on the bang at the top and watch the console.

Expected output:

.....
=======: 1
G1_GEMLIST: bang
GH2_FRAME: 2
GH2_GEMLIST: gem_state (pointer) (pointer)
GH2_PIX_INFO: 1 0
G1_GEMLIST: bang
GH2_FRAME: 2
GH2_GEMLIST: gem_state (pointer) (pointer)
GH2_PIX_INFO: 0 0
G1_GEMLIST: bang
GH2_FRAME: 2
GH2_GEMLIST: gem_state (pointer) (pointer)
GH2_PIX_INFO: 0 0


Observed output:

.....
=======: 1
G1_GEMLIST: bang
GH2_FRAME: 2
GH2_GEMLIST: gem_state (pointer) (pointer)
GH2_PIX_INFO: 0 0
G1_GEMLIST: bang
GH2_FRAME: 2
GH2_GEMLIST: gem_state (pointer) (pointer)
GH2_PIX_INFO: 1 0
G1_GEMLIST: bang
GH2_FRAME: 2
GH2_GEMLIST: gem_state (pointer) (pointer)
GH2_PIX_INFO: 0 0


Expected behavior when you bang:
You see frame 100,
then the screen goes black for a little while
then suddenly you see frame 2

Observed behaviour:
You see frame 100,
then the screen goes black for a little while
then you suddenly see frame 100 again for an instant (one frame)
then you see frame 2


I cannot reproduce the same problem with only one gemhead. With only one gemhead, if I send pix_film a new number, and immediately turn on the gemhead, as soon as the rectangle appears it already shows the new frame, as I expect.

Thanks
m.
#N canvas 529 24 750 754 10;
#X obj 59 675 gemwin;
#X msg 98 637 destroy;
#X obj 85 493 loadbang;
#X obj 90 551 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X obj 89 574 select 1 0;
#X msg 85 518 1;
#X obj 330 829 pix_texture;
#X obj 330 860 rectangle 5.3333 4;
#X obj 332 711 pix_film;
#X obj 209 572 loadbang;
#X obj 370 656 spigot;
#X obj -28 57 gemhead 1;
#X msg 22 598 create \, 1 \, frame 6;
#X msg 252 241 100;
#X obj 398 351 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X msg -28 222 2;
#X msg 287 186 0;
#X obj 404 714 spigot;
#X obj 374 163 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X obj 377 684 t f f;
#X obj 403 555 spigot;
#X obj 332 516 t a a;
#X obj 28 133 spigot;
#X text 330 941 ============;
#X obj 329 765 pix_info . . . .;
#X obj 411 811 spigot;
#X obj -28 100 t b b;
#X obj 435 531 r ddebug;
#X obj 433 684 r ddebug;
#X obj 442 790 r ddebug;
#X obj 59 106 r ddebug;
#X obj 374 187 s ddebug;
#X obj 338 417 t f f;
#X obj 271 18 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 275 85 t b b;
#X msg 361 127 1;
#X obj 259 115 delay 500;
#X obj 259 143 t b b;
#X obj -28 191 spigot 1;
#X obj 530 164 loadbang;
#X msg 527 197 1;
#X obj 385 384 t f f;
#X obj 332 489 gemhead 2;
#X obj 528 227 s gh2_and_spigot;
#X obj 398 328 r gh2_and_spigot;
#X obj 418 656 r direct_to_frame;
#X obj 403 632 r frame_spigot;
#X obj 287 212 s frame_spigot;
#X obj 367 457 s frame_spigot;
#X obj -28 253 s to_frame_through_spigot;
#X obj 370 605 r to_frame_through_spigot;
#X msg 211 601 open video.mov \, auto 0;
#X obj 412 415 print =======;
#X obj 215 186 delay 500;
#X obj 403 577 print GH2_GEMLIST;
#X obj 404 736 print GH2_FRAME;
#X obj 412 837 print GH2_PIX_INFO;
#X obj 215 212 t b b;
#X obj 181 241 delay 500;
#X msg 208 294 0;
#X obj 181 267 t b b;
#X obj 208 320 s gh2_and_spigot;
#X obj 143 293 delay 500;
#X text 295 14 CLICK HERE to start experiment;
#X obj 143 327 t b b;
#X msg 170 354 1;
#X obj 170 378 s gh2_and_spigot;
#X obj 99 354 delay 500;
#X msg 98 382 0;
#X obj 100 406 s ddebug;
#X obj 252 273 s direct_to_frame;
#X obj 27 158 print G1_GEMLIST;
#X connect 1 0 0 0;
#X connect 2 0 5 0;
#X connect 3 0 4 0;
#X connect 4 0 12 0;
#X connect 4 1 1 0;
#X connect 5 0 3 0;
#X connect 6 0 7 0;
#X connect 8 0 24 0;
#X connect 9 0 51 0;
#X connect 10 0 19 0;
#X connect 11 0 26 0;
#X connect 12 0 0 0;
#X connect 13 0 70 0;
#X connect 14 0 41 0;
#X connect 15 0 49 0;
#X connect 16 0 47 0;
#X connect 17 0 55 0;
#X connect 18 0 31 0;
#X connect 19 0 8 1;
#X connect 19 1 17 0;
#X connect 20 0 54 0;
#X connect 21 0 8 0;
#X connect 21 1 20 0;
#X connect 22 0 71 0;
#X connect 24 0 6 0;
#X connect 24 6 25 0;
#X connect 25 0 56 0;
#X connect 26 0 38 0;
#X connect 26 1 22 0;
#X connect 27 0 20 1;
#X connect 28 0 17 1;
#X connect 29 0 25 1;
#X connect 30 0 22 1;
#X connect 32 0 42 0;
#X connect 32 1 48 0;
#X connect 33 0 34 0;
#X connect 34 0 36 0;
#X connect 34 1 35 0;
#X connect 35 0 18 0;
#X connect 36 0 37 0;
#X connect 37 0 53 0;
#X connect 37 1 16 0;
#X connect 38 0 15 0;
#X connect 39 0 40 0;
#X connect 40 0 43 0;
#X connect 41 0 32 0;
#X connect 41 1 52 0;
#X connect 42 0 21 0;
#X connect 44 0 14 0;
#X connect 45 0 19 0;
#X connect 46 0 10 1;
#X connect 50 0 10 0;
#X connect 51 0 8 0;
#X connect 53 0 57 0;
#X connect 57 0 58 0;
#X connect 57 1 13 0;
#X connect 58 0 60 0;
#X connect 59 0 61 0;
#X connect 60 0 62 0;
#X connect 60 1 59 0;
#X connect 62 0 64 0;
#X connect 64 0 67 0;
#X connect 64 1 65 0;
#X connect 65 0 66 0;
#X connect 67 0 68 0;
#X connect 68 0 69 0;
_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to