skullmunky
May 14th, 2011, 06:00 AM
I'm using Open Sound Control to glue a couple of programs together, a common enough task, and running into a surprising amount of latency. Both programs run on the same machine, so there's no actual network involved - OSC is just there to get them to talk to each other. Specifically, program A is a small Kinect app in C++ that gets the user's skeleton data from OpenNI/NITE and sends out the joint positions and orientations using LibLo. Program B is a Python/Panda3D game that reads the data using pyliblo and uses it for the game interface.
The lag problem manifests as a delay in the stream of data; motions that the tracker recognizes don't appear in the game engine for several seconds, and the lag increases the longer the apps are running.
I've run into the same problem with OSC in other circumstances before, such as trying to use a Wiimote to control things in Blender. I know OSC gets used for things all the time with much higher throughput in live performance scenarios, so there must be something we're not doing quite right in the way we're writing the networking code.
Or is the overhead of OSC actually an issue? Am I better off with another approach, like shared memory or something for an application like this?
The lag problem manifests as a delay in the stream of data; motions that the tracker recognizes don't appear in the game engine for several seconds, and the lag increases the longer the apps are running.
I've run into the same problem with OSC in other circumstances before, such as trying to use a Wiimote to control things in Blender. I know OSC gets used for things all the time with much higher throughput in live performance scenarios, so there must be something we're not doing quite right in the way we're writing the networking code.
Or is the overhead of OSC actually an issue? Am I better off with another approach, like shared memory or something for an application like this?