[GEM-dev] Problem with glitching on OS X at high frame rates

Jack jack at rybn.org
Tue Jul 17 20:54:12 CEST 2012

Le 16/07/2012 19:31, Theo Burt a écrit :
> Hi, me and a friend of mine do a lot of live audio-video performance,
> professionally, all using pd/gem as an environment. We both use
> Macbook Pros (different models), and for the last couple of years
> we've been having a serious problem which we now suspect is something
> to do with GEM/PD, rather than, for example, the graphics cards or
> drivers.
> The problem occurs when running at higher frame rates - it is highly
> preferable for us to run at 60 frames per second, because (1) it syncs
> with the refresh rates of most projectors and seems to produce much
> smoother/more regular movement, and (2) often we are using very
> precise, high frequency flashing, for optical effects, that we need to
> be able to sync exactly with screen refreshes. We are generally
> running the gem window in a second screen (such as a monitor or
> projector), but it happens when running on one screen too.
> As soon as we run at 60 frames per second (or near it), glitching
> starts to occur frequently in the audio, and the audio goes out of
> sync with GEM. While the glitching is occurring, processes in PD and
> GEM jerk along, pausing frequently. To resolve it (temporarily), the
> audio has to be reset in PD (by reselecting the audio device). The
> glitching then goes away and everything runs smoothly, but it returns
> spontaneously after a short time. The glitching is also exacerbated by
> moving windows around on the screen. It might be worth noting that the
> same patch running on the very same machine in Windows XP (using
> bootcamp) does not have this problem.
> We have different GPUs, mine is a Nvidia 9600m GT, and his was an ATI
> of some sort. We are using very simple, geometric graphics, and are
> not approaching the processing limits of the GPUs at all (if I do push
> the graphics card very hard, I notice that frames are skipped rather
> than glitching occurring). I also note that it happens equally when
> there is low CPU activity, so it's not related to that.
> My friend has just purchased a new Macbook Pro, yesterday with a 60%
> more powerful Nvidia GPU, and unfortunately the glitching is still
> occurring. It occurs in OS X Lion, and also was happening in Snow
> Leopard. We've tried disabling power management on the GPU, and this
> doesn't help either.
> I've looked through the gem code in an attempt to try and understand
> what is happening, but I am afraid it is beyond me!
> Does anyone have any idea at all what the problem could be? It would
> make such a huge difference to us if we could resolve it. Thanks very
> much for any help in advance (and for developing GEM in the first place)
> All the best, Theo
> _______________________________________________
> GEM-dev mailing list
> GEM-dev at iem.at
> http://lists.puredata.info/listinfo/gem-dev


Can you provide a small exemple patch with this trouble ?
When you use Gem and sound, it is a good practice to separate these two
process on different cores to avoid glitch.
You have 2 solutions to achieve this :
- use [pd~] (see the help patch)
- use 2 instances of Pd, one for Gem, the other for the sound, and send
data between these two instances with [netsend]/[netreceive] (the system
should manage these two instances on different cores).


More information about the GEM-dev mailing list