Ball Moving Jittered on Monitor

Hi Chris,

I have a MWorks script that run smoothly on one computer (there is a ball moving on monitor with a certain speed). However, when I copy the same script to another computer, the ball moving trajectory becomes jittered (not smoothly moving) for 60% of the trials. I am not sure how and why it happens because it seems normal for 40% of the trials. Is it something related to monitor sampling frequency?

Thanks a lot,
Chia-Jung

Hi Chris,

I would like to supplement what the warning message from console. I am not sure why it would skip refresh cycles, because it does not have this issue while I run on another computer.

WARNING: Skipped 1 display refresh cycles
01:33:36: WARNING: Skipped 2 display refresh cycles
01:33:36: WARNING: Skipped 2 display refresh cycles
01:33:36: WARNING: Skipped 2 display refresh cycles
01:33:36: WARNING: Skipped 1 display refresh cycles

Hi Chia-Jung,

There are a number of potential explanations for this issue. Can you give me some details about the two computers? Specifically:

  • Model (Mac Pro, Mac mini, etc.)
  • Graphics card
  • Refresh rates of all attached displays

Thanks,
Chris

Hi Chris,

The computer that runs successfully:
OS X 10.9.5
Processor 3.2 GHz Quad-Core Intel Xeon
Memory 6 GB 1066 MHz DDR3 ECC
Cinema HD Display 23-inch Late 2005 (1920 x 1200)
Graphics ATI Radeon HD 5770 1024 MB
Refresh rate: 60 Hz (based on #SYSTEM VARIABLES #mainScreenInfo ‘refresh_rate_hz’)

The computer that fails and has skipped refresh cycles:
OS X 10.9.5
Processor 2.93 GHz Intel Core 2 Duo
Memory 4 GB 1067 MHz DDR3
Built-in iMac Display 24-inch (1920 x 1200)
Graphics ATI Radeon HD 4850 512 MB
Refresh rate: 60 Hz (based on #SYSTEM VARIABLES #mainScreenInfo ‘refresh_rate_hz’)

Hi Chia-Jung,

Thanks for the info. FYI, the refresh_rate_hz value doesn’t (currently) contain the actual refresh rate of the display. It comes from MWorks’ config file, and I believe it was originally intended to set the refresh rate (although I don’t know if it ever did that). Regardless, I suspect both of your displays do in fact run at 60 Hz.

I’m guessing the problem here is simply that your iMac isn’t able to keep up with the display refreshes and is dropping frames. Are you using only the integrated display, or do you have an external display connected, too? Are you running both MWClient and MWServer on the iMac?

Thanks,
Chris

Hi Chris,

Thanks a lot. I am not sure how to know the actual refresh rate for the monitors.

The computer I ran successfully:
I have an external display monitor connected to the computer. I ran both MWClient and MWServer on that computer, and the stimuli display is normal on the external display. I then connected to the Server from other computer to monitor the real-time activity.

The computer (iMac) that had issue:
I firstly ran both MWClient and MWServer on iMac without external display. However, this would produce a blank fullscreen without any stimuli displayed. I have to press Cmd-Q to quit.

I then tried to connect iMac with an external display. The experiment could work, but then I started to see the jittering of the ball trajectory within 60% of the trials, and also saw the warning message on console.

I also tried to remove the external display, and connect iMac remotely. The experiment worked, and I did not see the serious jittering nor warning message on the console. However, the ball moves, it looks like it’s swimming in a wave. Not sure if it is an artifact of the refresh rate or not.

Thanks,
Chia-Jung

Hi Chia-Jung,

I am not sure how to know the actual refresh rate for the monitors.

Yeah, it’s not always easy to find. For external monitors, usually you can find it in the “Displays” section of System Preferences. However, I don’t think that’s true for integrated displays.

I then tried to connect iMac with an external display. The experiment could work, but then I started to see the jittering of the ball trajectory within 60% of the trials, and also saw the warning message on console.

It sounds like your iMac just isn’t up to the task of reliably driving two displays at 60 Hz. Given its hardware specs, this doesn’t surprise me.

I also tried to remove the external display, and connect iMac remotely. The experiment worked, and I did not see the serious jittering nor warning message on the console.

Good, that’s also as I’d expect.

However, the ball moves, it looks like it’s swimming in a wave. Not sure if it is an artifact of the refresh rate or not.

I don’t know what to make of that. Would it be possible for me to stop by your lab and see this in action?

Chris

Hi Chhris,

Thank you so much! Yes, it would be really helpful if you can stop by our lab and take a look at it.

Today before 2:30 pm, or between 3:30-4 pm would be available.
Monday - Friday between 3:30 - 5 pm

Thanks a lot,
Chia-Jung

Hi Chris,

Thanks a lot for dropping by our lab today! I just attached the
experimental file (.xml) along with two figure files (.jpg) and two sound
files (.wav). The path for figure and sound might need to be changed from
/Users/cjchang/MWorks/cjchang/ to a new path.

Thanks again,
Chia-Jung

Attachment: Experiment.zip (103 KB)

Hi Chia-Jung,

Thanks for sharing your experiment. Regarding this:

I also tried to remove the external display, and connect iMac remotely. The experiment worked, and I did not see the serious jittering nor warning message on the console. However, the ball moves, it looks like it’s swimming in a wave. Not sure if it is an artifact of the refresh rate or not.

After some investigation, I believe the “swimming in a wave” effect you’re seeing is due to a combination of display refresh rate and a “persistence of vision” effect.

To demonstrate this, I created a very simplified version of your experiment (attached), which simply plays the moving bar in an infinite loop. To emphasize the effect, I increased the speed of the bar to 128 degrees/second. At that speed, the bar “jumps” many times its own width each frame.

When I run this experiment on a display with a 60Hz refresh rate, I clearly see multiple bars displayed at once, in what looks like a “rolling” stripe pattern. However, when I put a photodiode in front of one of the bars and connect it to an oscilloscope, I can see that the pixels actually light up for only one frame (~16.67ms). This tells me that the striping I see is in fact an optical illusion. As you lower the speed of the bar, the effect becomes less dramatic, and the striping starts to look more like smearing.

So, in summary, it looks like the animation is working as it should, but your brain is tricking you in to thinking it’s not.

Cheers,
Chris

Attachment: infinite_loop.xml (3.75 KB)