Receiver ReceiveTexture failure

Home Forums Spout Developer Receiver ReceiveTexture failure

This topic contains 8 replies, has 2 voices, and was last updated by  leadedge 4 months, 1 week ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #3979

    leonzhx
    Participant

    I’m experiencing LockInteropObject function call failed with error invalid handle in spoutGLDXinterop::ReadGLDXtexture function, create receiver and texture succeeded, but ReceiveTexture failed with above reason.

    I’m running Spout DX11 sender.

    Any hit on how I can solve this error?

    Thanks in advance.

    #3980

    leadedge
    Keymaster

    I need more information before suggesting anything. I assume you are you building your own program to find the error.

    Your graphics details will help. In the demo sender Help>Diagnostics copy and paste here.

    And your system. Is it a laptop with Optimus graphics? What operating system?

    #3981

    leonzhx
    Participant

    Spout Sender (Vers 2.018)
    DirectX 9.0c available
    NVIDIA GeForce GTX 1070 Ti (Display)
    Microsoft Basic Render Driver (Secondary)
    Current adapter : NVIDIA Corporation
    NV_DX_interop extension available
    DirectX 11 Texture share mode

    Windows 10
    I am using OpenGL texture to receive texture which same as in ofSpoutExample project.

    #3982

    leadedge
    Keymaster

    The hardware looks OK, so it is difficult to know what is causing this error.

    There are only two textures that can cause the Invalid Handle error. The OpenGL texture is generated internally in the Spout SDK, so it is possibly a DirectX shared texture problem. Try changing to DirectX 9 using the “SpoutDXmode” program.

    The other thing you could try is to use a dll for the Spout functions. There are pre-built library files in https://github.com/leadedge/Spout2/tree/master/SpoutSDK/Source/VS2012/Binaries or you could build the dll yourself to confirm the same error.

    I assume that the demo sender and receiver work OK together and that this is not a laptop with Optimus graphics.

    #3983

    leonzhx
    Participant

    My code is very simple:

    
    		strcpy(_senderName,"SpoutDefSender");
    		
    	//
    	if (_spoutreceiver.CreateReceiver(_senderName, _width, _height, true)) {
    		//
    		glGenTextures(1, (GLuint *)&_spoutTextureId);
    
    		glBindTexture(GL_TEXTURE_2D, _spoutTextureId);
    		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLint)_width, (GLint)_height, 0, GL_RGBA, GL_UNSIGNED_INT, 0);  // init to black...
    
    	
    		glBindTexture(GL_TEXTURE_2D, 0);
    		_inited=true;
    	}
    

    receiver is been successfully created, and then do receive

    
    if(_inited){
    		if(_spoutreceiver.ReceiveTexture(_senderName, _width, _height, _spoutTextureId
    			, _spoutTextureTarget)) {
    		}
    	}
    

    which _spoutreceiver.ReceiveTexture failed in spoutGLDXinterop::LockInteropObject function’s wglDXLockObjectsNV call with GetLastError return 0xc0070006.

    #3984

    leonzhx
    Participant

    And I have added spout as external dependent project in my solution, and it’s been built to dll.

    #3985

    leadedge
    Keymaster

    When you create your texture use GL_UNSIGNED_BYTE rather than GL_UNSIGNED_INT. Also refer to here and scroll down to “Creating a complete texture” which explains that the texture is not complete. You can try to include :

    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 

    I don’t think this is related to the problem but you can try it.

    The other thing you can do is to call ReceiveTexture without including your receiving texture, just to find out whether there is still an error.

    _spoutreceiver.ReceiveTexture(_senderName, _width, _height)

    After doing that please confirm whether setting “Directx 9” on or off SpoutDXmode changes anything. Also please confirm that this is not a laptop with Optimus graphics and that there is only one graphics adapter.

    #3986

    leonzhx
    Participant

    _spoutreceiver.ReceiveTexture(_senderName, _width, _height)

    succeeded.

    And tried setting “Directx 9” on or off SpoutDXmode, but error remains.

    • This reply was modified 4 months, 1 week ago by  leonzhx.
    #3988

    leadedge
    Keymaster

    OK, we seem to be narrowing this down.

    If ReceiveTexture works, there is a received OpenGL texture available within the Spout SDK. To trace the problem further, you might be able to do something with :

    BindSharedTexture() < -- code -- > UnBindSharedTexture();

    or try DrawSharedTexture()

    Have you changed your texture creation? There is code that works in the ofSpoutSender/Graphics example.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.