Page 1 of 1

Spout to MM > Jittery Output / Spout to Spout Receiver > Smooth Output

Posted: Wed Sep 11, 2019 12:46 pm
by Adam_NOVAK
Hi all,

We are running an app built in Unity that is outputting via Spout to MadMapper and then outputting to a 4K projector.
When we do this, we get jittery playback.

When viewing the Spout output via Spout Receiver the playback is smooth and fine.

Our system is:

MadMapper 3.7.1

Razer Blade 15
Intel Core i7-9750 2.60GHz
16GB RAM
NVIDIA RTX 2060

Any suggestions as to why this is happening? And how we might be able to fix it?

Re: Spout to MM > Jittery Output / Spout to Spout Receiver > Smooth Output

Posted: Mon Sep 16, 2019 12:18 pm
by mad-matt
Hi,
The problem is that there's no sync mechanism inside spout. We cannot know when the texture was updated (see http://spout.zeal.co/forums/topic/sender-receiver-sync/). With Syphon we get a callback when the texture has been updated so synchronization is easy. We get a new syphon frame => we produce a new frame based on this new texture.
With Spout, we're not aware a texture was updated. When using a spout source, we produce a new frame at the frequency of the screen/projector attached to first projector in MadMapper (in youur case, your 4k screen, at 60 FPS I suppose). We're not sure that the other process already published the spout update. Depending on the driver, the OpenGL swap will be blocking or not and synchronization will be better or worst.
Maybe it will be improved by some developments we're working on to get a better VBL synchronization on Windows.
Actually testing with another OpenGL application => SpoutReceiver, I also see glitches, without MadMapper involved.
Maybe Unity => SpoutReceiver works better because both are D3D based.
At the moment you can try to tweak using SpoutSettings to switch to DirectX9, or change the Share mode. If you see anything better changing those settings, let us know.
Thanks
Matt - MM team

Re: Spout to MM > Jittery Output / Spout to Spout Receiver > Smooth Output

Posted: Wed Sep 18, 2019 2:08 pm
by Adam_NOVAK
Hi,
The problem is that there's no sync mechanism inside spout. We cannot know when the texture was updated (see http://spout.zeal.co/forums/topic/sender-receiver-sync/). With Syphon we get a callback when the texture has been updated so synchronization is easy. We get a new syphon frame => we produce a new frame based on this new texture.
With Spout, we're not aware a texture was updated. When using a spout source, we produce a new frame at the frequency of the screen/projector attached to first projector in MadMapper (in youur case, your 4k screen, at 60 FPS I suppose). We're not sure that the other process already published the spout update. Depending on the driver, the OpenGL swap will be blocking or not and synchronization will be better or worst.
Maybe it will be improved by some developments we're working on to get a better VBL synchronization on Windows.
Actually testing with another OpenGL application => SpoutReceiver, I also see glitches, without MadMapper involved.
Maybe Unity => SpoutReceiver works better because both are D3D based.
At the moment you can try to tweak using SpoutSettings to switch to DirectX9, or change the Share mode. If you see anything better changing those settings, let us know.
Thanks
Matt - MM team
Hi Matt, many thanks for clarifying this. I will try some of your suggested tweaks and let you know how I get on.

Re: Spout to MM > Jittery Output / Spout to Spout Receiver > Smooth Output

Posted: Thu Sep 19, 2019 2:03 pm
by mad-matt
Seems like next spout release could improve synchronization. We'll do some testing soon.