TEInstanceStartFrameAtTime() gives TEResultInternalError (6)

Hi there, i am trying to make the TouchEngine sample work. I had to do some changes to make it compile (see below), now i get an error at DocumentWindow::update() after loading the provided sample.tox in an OpenGL window

myLastResult = TEInstanceStartFrameAtTime(myInstance, time, TimeRate, false);

results in myLastResult == TEResultInternalError

Then i added TEInstanceGetErrors with

TEErrorArray* errors = nullptr;
myLastResult = TEInstanceGetErrors(myInstance, &errors);

and the call succeeds (myLastresult == TEResultSuccess (0)) but errors is null. Any idea what is going wrong or how to find out what is going wrong?

  1. I use the opengl window
  2. I disabled (commented) dx11 and dx12 since i do not use it (and the sdk is not installed)
  3. I changed the PlatformToolset to v141
  4. TouchDesigner runs fine on the system and the sample.tox loads nicely there.

Best wishes,
Hendrik

Hi Hendrik - which version of Windows are you on? Is there a reason you are on the 141 toolset rather than something newer?

It’s difficult to guess what’s going wrong based on your description. If you’re able to attach your modified project here, or e-mail it to support@derivative.ca and reference this thread, or push it somewhere like GitHub and share a link - I can take a look.

TEInstanceGetErrors() only returns current component errors - it is normal to have an error result from a function call but an empty array from TEInstanceGetErrors().

Hi Tom,

thank you for your quick reply! I am on Windows10 (dont know which ‘Update’). There is no special reason we use 141, it is just installed across our development systems.

I found a .dmp file (Windows post-mortem dump files) with a stack trace:

STACK_TEXT:
000000fc9e9fca40 00007ffda2cd5f60 : 0000022f9f982070 000000fc9e9fcba0 0000022f9f982070 000000fc9e9fcba0 : libTD!TER_TouchExeBase::getMainApp+0x2ca1bd
000000fc9e9fcaa0 00007ffda2ccfd35 : 0000022f9713b4c0 0000010000000101 0000022fa073a130 0000022f00000000 : libTD!TER_TouchInstance::setAssetDirectory+0x8c0
000000fc9e9fcc00 00007ffda2cc7526 : 3ff0000041400000 0000000000000000 0000022ff98a06e0 0000022ff3a131b0 : libTD!TER_TouchInstance::applyInputLinks+0xb55
000000fc9e9fce20 00007ffda3287672 : 000000fc9e9fd040 0000000000000001 0000022fa0865a10 0000022ffa1115a0 : libTD!TER_TouchInstance::run+0x1916
000000fc9e9fcec0 00007ffda33f69d8 : 0000022f9552fe20 0000000000000001 0000022ff98cd0f0 0000022ffa1115a0 : libTD!NcDataStreamClient::operator=+0x4ca212
000000fc9e9fcef0 00007ffda337b2c3 : 0000000edb7c6a91 000000fc9e9fd270 0000022fa0865a10 0000022ff9cacc10 : libTD!NcDataStreamClient::operator=+0x639578
000000fc9e9fcfb0 00007ffda3284a5e : 000000fc9e9fd270 000000fc9e9fd270 0000022ff9cad402 0000000000000002 : libTD!NcDataStreamClient::operator=+0x5bde63
000000fc9e9fd100 00007ffda328688d : 0000022f00000002 0000022ff83d1f30 0000022ff8d19390 0000022ff86882c8 : libTD!NcDataStreamClient::operator=+0x4c75fe
000000fc9e9fd3f0 00007ffda2ce93ec : 000000fc9e9ff5f0 0000022ff87e73d8 0000000000000006 000000fc9e9ff680 : libTD!NcDataStreamClient::operator=+0x4c942d
000000fc9e9ff540 00007ffda2cc6029 : 0000022ff87e73d8 0000022ff87e7848 0000022ff87e71e0 0000022ff87e71e0 : libTD!TER_TouchExeBase::runMain+0xc
000000fc9e9ff580 00007ff68d4b538c : 0000000ed937d61d 000000fc9e9ff9c9 0000000000989680 0000022ff83a90b0 : libTD!TER_TouchInstance::run+0x419
000000fc9e9ff910 00007ff68d4b2a2c : 00007ff68d4b0000 00007ff68d4b0000 0000000000000000 0000000000000000 : TouchEngine_exe+0x538c
000000fc9e9ffa30 00007ff68d4d6e9e : 0000000000000000 0000000000000000 0000000000000000 0000000000000000 : TouchEngine_exe+0x2a2c
000000fc9e9ffb50 00007ffde70f7604 : 0000000000000000 0000000000000000 0000000000000000 0000000000000000 : TouchEngine_exe+0x26e9e
000000fc9e9ffb90 00007ffde7dc26a1 : 0000000000000000 0000000000000000 0000000000000000 0000000000000000 : kernel32!BaseThreadInitThunk+0x14
000000fc9e9ffbc0 0000000000000000 : 0000000000000000 0000000000000000 0000000000000000 0000000000000000 : ntdll!RtlUserThreadStart+0x21

SYMBOL_NAME: libTD!TER_TouchExeBase::getMainApp+2ca1bd

MODULE_NAME: libTD

IMAGE_NAME: libTD.dll

STACK_COMMAND: ~0s ; .ecxr ; kb

FAILURE_BUCKET_ID: NULL_CLASS_PTR_READ_c0000005_libTD.dll!TER_TouchExeBase::getMainApp

Does this give a hint? Else i can e.g. zip+upload/mail a diff to the TouchEngine 1.9 tag.

If you could upload or e-mail the project - and perhaps include the dmp file - that would be great, thanks.

Hi Tom,
please have a look at

github:
mxwendler/TouchEngine-Windows/tree/mxwendler-debug

The .dmp files are in the Samples/ folder

Best wishes,
Hendrik

Thanks Hendrik - I suspect you may be running on a device with an Intel GPU. Our ability to support TouchEngine with OpenGL on Intel GPUs is limited by missing features in their Vulkan drivers - DirectX and Vulkan have better support. Obviously TouchEngine shouldn’t crash in this case - we will fix that, and I’ll update the SDK example to demonstrate testing for required features.

If you are able to work on a machine with a non-Intel GPU, you shouldn’t hit this problem.

Hi Tom, thanks for the update! Yes, the device has an Intel GPU. I will switch the system and test again. Any idea why the sample.tox runs nicely on the same system in the standalone TouchDesigner?

What is missing here exactly? Something like WGL_NV_DX_interop?

Best wishes,
Hendrik

What is missing here exactly? Something like WGL_NV_DX_interop?

For OpenGL we pass the textures between your process and the TouchEngine process using D3D shared textures. The Intel Vulkan drivers only support importing shared textures using NT shared handles, but the GL interop requires the use of the older global shared handles. If you absolutely have to support Intel GPUs with OpenGL textures, you could do an additional copy between the shared texture types using DirectX, then use the D3D TouchEngine API - however other limitations of these devices may affect other features of TouchDesigner, so you might not consider it worth the effort.

When run in TouchDesigner the textures don’t need to be shareable at all, so none of this is a problem when you do that.

I’ve just updated the TouchEngine SDK and added a function to test for the required capabilities for OpenGL textures (TEOpenGLContextSupportsTexturesForInstance()) which should be called after configuration completes (ie after receiving TEEventInstanceReady). Reporting of errors when TouchEngine does crash is also improved.

I’ve updated the example to use the new function to check before proceeding to use the OpenGL renderer.

The next release of TouchDesigner will have a fix for the crash in TouchEngine.

Thank you for the explanation!

Good news! A bit more descriptive error codes would be great (if possible, of course)

Best wishes,
Hendrik

1 Like