<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 21, 2020 at 9:42 AM Yoshiki Ohshima <<a href="mailto:Yoshiki.Ohshima@acm.org">Yoshiki.Ohshima@acm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 21, 2020 at 9:32 AM Yoshiki Ohshima <<a href="mailto:Yoshiki.Ohshima@acm.org" target="_blank">Yoshiki.Ohshima@acm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 20, 2020 at 5:11 PM Yoshiki Ohshima <<a href="mailto:Yoshiki.Ohshima@acm.org" target="_blank">Yoshiki.Ohshima@acm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 20, 2020 at 4:50 PM tim Rowledge <<a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br>
<br>
<br>
> On 2020-11-20, at 3:10 PM, Yoshiki Ohshima <<a href="mailto:Yoshiki.Ohshima@acm.org" target="_blank">Yoshiki.Ohshima@acm.org</a>> wrote:<br>
> <br>
> So I built a new VM with a  fix  for the input method change.  I did not fully test the other things but Scratch on the VM does not do animations. It updates screen only when mouse is moved, or some slower interval:<br>
> <br>
> <a href="https://photos.app.goo.gl/QHgKCeeP2bnQGESu5" rel="noreferrer" target="_blank">https://photos.app.goo.gl/QHgKCeeP2bnQGESu5</a><br>
<br>
That's really weird. I see two systems running at the same time there - same image? Different VM?<br></blockquote><div><br></div><div>Yeah, those are running the same image on different VMs. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> <br>
> I suspect that there might have been some options I needed to pass in to specify some timers?  Can you think of other reasons why this might happen and where to look to fix it?<br>
<br>
I never had any timer related options to worry about, so it shouldn't be anything to do with that.<br>
<br>
What happens if you use the 'new' VM but don't use the compositor/input thing? IIRC I had terrible problems caused by that ibus program and we had to make sure it didn't get into the Raspbian release.<br></blockquote><div><br></div><div>I'll check it out. I wasn't expecting this kind of problem and did not fully test things out.</div></div></div></blockquote><div><br></div><div>Not having compositioninput does not fix the problem. With a non-scratch image and I run BouncingAtomsMorph, the screen update on my VM is one frame per second unless I move the mouse pointer.</div><div><br></div><div>Which function to obtain the current time to tell the VM to run the next event loop? I can check if it is called.</div></div></div></blockquote><div><br></div><div>One datapoint is that making the  argument for aioSleepForUsecs in display_ioRelinquishProcessorForMicroseconds() to be always zero:</div><div><br></div>static sqInt display_ioRelinquishProcessorForMicroseconds(sqInt microSeconds)<br>{<br>   aioSleepForUsecs(handleEvents() ? 0 : 0); // aioSleepForUsecs(handleEvents() ? 0 : 1000); <br>  return 0;<br><div>}  </div><div><br></div><div>makes it run smoothly. So the return value from handleEvents() would have to make sense.</div><div><br></div><div>(still investigating..)</div></div></div></blockquote><div><br></div><div>So the handleEvents() looks like this: </div><div><br></div><div>--------------------</div><div>int handleEvents(void)<br>{<br>  if (recordPendingKeys())<br>    return 0;</div><div><br>  if (!isConnectedToXServer || !XPending(stDisplay)) {<br>    return !iebEmptyP();<br>  }<br><br>  while (XPending(stDisplay))<br>    {<br>      XEvent evt;<br>      XNextEvent(stDisplay, &evt);<br>      handleEvent(&evt);<br>    }<br>  return 1;<br>}<br></div><div><div>--------------------</div><div></div></div><div>but the part that affecting the animation performance is "return !iebEmptyP()". If I take out "!", it tells the caller that it handled an event when (?) not collected to the X server (which is a weird test) or not X event is not pending, check if the input event buffer is empty or not.</div><div><br></div><div>This check may be okay but needs some clarifications.</div><div><br></div><div>But I suspect that aioSleepForUsecs() on this platform may be sleeping given milliseconds and not microseconds. That may be consistent with the symptom of waking up at every second...</div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature">-- Yoshiki<div><br></div></div></div>