Pure data : extension using CLEyeMulticam SDK does’nt load
Posted: 07 January 2010 02:06 PM   [ Ignore ]
New Member
Rank
Total Posts:  13
Joined  2010-01-07

Hi,
I am trying to port my PureData external (pix_ps3eye.dll) from IPS3Eyelib SDK to CLEyeMulticam SDK.
(in PureData, externals/extensions are dlls)

No compilation problem when including new headers and functions.
But PureData says he can’t load my dll.

If I remove in my code any call to the API (but the CLEYEye headers remain) , and then recompile it, the dll is loaded without problem in PureData..

With former SDK, I received messages such as “PS3EyeLib.dll not found”, and I found that I had to copy this dll into PureData bin folder.
But with the new framework, I tried the same method (with CLEyeMulticam.dll) but without any result.

PureData is written in C, I use FLEXT layer for writing my external in C++.
I know the former API was written in C++ and the new is in C.
I don’t know about C/C++ issues on execution time.

I’m using :
windows xp sp3
code blocks IDE + Visual studio express 2008 C++ compiler

Any Idea ?

Profile
 
 
Posted: 07 January 2010 02:16 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17
JYG - 07 January 2010 02:06 PM

Hi,
I am trying to port my PureData external (pix_ps3eye.dll) from IPS3Eyelib SDK to CLEyeMulticam SDK.
(in PureData, externals/extensions are dlls)

No compilation problem when including new headers and functions.
But PureData says he can’t load my dll.

If I remove in my code any call to the API (but the CLEYEye headers remain) , and then recompile it, the dll is loaded without problem in PureData..

With former SDK, I received messages such as “PS3EyeLib.dll not found”, and I found that I had to copy this dll into PureData bin folder.
But with the new framework, I tried the same method (with CLEyeMulticam.dll) but without any result.

PureData is written in C, I use FLEXT layer for writing my external in C++.
I know the former API was written in C++ and the new is in C.
I don’t know about C/C++ issues on execution time.

I’m using :
windows xp sp3
code blocks IDE + Visual studio express 2008 C++ compiler

Any Idea ?

Could you include the code for your new PD wrapper so that we can test it and debug it?
Are you saying that PD cannot load the CLEyeMulticam.dll? Did you link the CLEyeMulticam.lib to your dll?

AlexP

Profile
 
 
Posted: 07 January 2010 03:16 PM   [ Ignore ]   [ # 2 ]
New Member
Rank
Total Posts:  13
Joined  2010-01-07

Hi alex,

Are you saying that PD cannot load the CLEyeMulticam.dll? Did you link the CLEyeMulticam.lib to your dll?

I specified the file \Code Laboratories\CL-Eye Platform SDK\Lib\CLEyeMulticam.lib for the linker.


Here is the minimal wrapper : If I suppress the line containing CLEyeGetCameraCount, the dll can be loaded. With the line included, it fails.

// include flext header
#include <flext.h>

// check for appropriate flext version
#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 500)
#error You need at least flext version 0.5.0
#endif

//  header for Ps3Eye SDK
#include "CLEyeMulticam.h"

class pix_ps3eye:
    public 
flext_base
{
    FLEXT_HEADER_S
(pix_ps3eye,flext_base,setup)

public:
    
// constructor
    
pix_ps3eye(int argc,t_atom *argv);
    
//destructor
    
~pix_ps3eye();

protected:
private:
//setup function : initialise static tables
    
static void setup(t_classid c)
    
{
        post 
("hello setup");
    
}

}
;

// instantiate the class
FLEXT_NEW_V("pix_ps3eye",pix_ps3eye)

// class constructor
pix_ps3eye::pix_ps3eye(int argc,t_atom *argv)
{
    post 
("hello constructor");
    
    
    
post ("nb of detected cams : %d"CLEyeGetCameraCount());
    
    
    
// define inlets
    
AddInAnything();  // add inlet of type anything (index 0)
    
AddOutAnything();

}

//destructor
pix_ps3eye::~pix_ps3eye()
{
    post 
("bye destructor");
File Attachments
pix_ps3eye_failing.zip  (File Size: 75KB - Downloads: 882)
pix_ps3eye_success.zip  (File Size: 75KB - Downloads: 830)
Profile
 
 
Posted: 08 January 2010 01:08 AM   [ Ignore ]   [ # 3 ]
New Member
Rank
Total Posts:  13
Joined  2010-01-07

further investigations :
If I remove “C:\Program Files\Code Laboratories\CL-Eye Platform SDK”, when I launch PureData and try to create a pix_ps3eye object (version with a call to CLEyeGetCameraCount), I get a error dialog-box : CLEyeMulticam.dll not found.
That means that, in normal case, my pix_ps3eye.dll is looking for CLEyeMulticam.dll, and founds it.
the error occurs later.

Profile
 
 
Posted: 08 January 2010 06:57 AM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17
JYG - 08 January 2010 01:08 AM

further investigations :
If I remove “C:\Program Files\Code Laboratories\CL-Eye Platform SDK”, when I launch PureData and try to create a pix_ps3eye object (version with a call to CLEyeGetCameraCount), I get a error dialog-box : CLEyeMulticam.dll not found.
That means that, in normal case, my pix_ps3eye.dll is looking for CLEyeMulticam.dll, and founds it.
the error occurs later.

I looked at your code and everything seems to be correct. One thing I’m interested is if you made the call to CLEyeGetCameraCount from another function than class constructor by setting up FLEXT_CALLBACK like this:

// getcamcount callback method
void m_getcamcount()
{
    post
("nb of detected cams : %d"CLEyeGetCameraCount());
}

static void setup(t_classid c)
{
    FLEXT_CADDMETHOD_
(c,0,"getcamcount"m_getcamcount);
}
FLEXT_CALLBACK
(m_getcamcount

Then in PD you call ‘getcamcount’ manually. Does this crash as well?

AlexP

Profile
 
 
Posted: 08 January 2010 08:36 AM   [ Ignore ]   [ # 5 ]
New Member
Rank
Total Posts:  13
Joined  2010-01-07

I tried to make the call to CLEyeGetCameraCount from another function than class constructor. But the problem remains the same : the pix_pse3eye.dll isnot loaded, the pix object isn’t created in pure data.
everything is ok if I suppress line withe call to CLEyeGetCameraCount .

// include flext header
#include <flext.h>

// check for appropriate flext version
#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 500)
#error You need at least flext version 0.5.0
#endif

//  header for Ps3Eye SDK

#include "CLEyeMulticam.h"



class pix_ps3eye:
    public 
flext_base
{
    FLEXT_HEADER_S
(pix_ps3eye,flext_base,setup)

public:
    
// constructor
    
pix_ps3eye(int argc,t_atom *argv);
    
//destructor
    
~pix_ps3eye();

protected:
 
void GetCameraCount()
        
{
       post 
("nb of detected cams : %d"CLEyeGetCameraCount());
        
}
private:

    
FLEXT_CALLBACK(GetCameraCount)
//setup function 
    
static void setup(t_classid c)
    
{
        post 
("hello setup");

    
}

}
;

// instantiate the class
FLEXT_NEW_V("pix_ps3eye",pix_ps3eye)

// class constructor
pix_ps3eye::pix_ps3eye(int argc,t_atom *argv)
{
    post 
("hello constructor");

    
// define inlets
    
AddInAnything();  // add inlet of type anything (index 0)
    
AddOutAnything();
    
FLEXT_ADDMETHOD_(0,"GetCameraCount",GetCameraCount);
}

//destructor
pix_ps3eye::~pix_ps3eye()
{
    post 
("bye destructor");
Profile
 
 
Posted: 08 January 2010 04:30 PM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17

There is an issue we discovered that occurs only on XP systems under certain conditions. We are working on a fix and the new version of SDK will be out tonight.

AlexP

UPDATE: The new SDK is out that includes the fix for Windows XP. You can get it here.

Profile
 
 
Posted: 09 January 2010 02:45 AM   [ Ignore ]   [ # 7 ]
New Member
Rank
Total Posts:  13
Joined  2010-01-07

Yes it works now.
Thanks for your fast replies.
JYG.
EDIT: Puredata wrapper to download here.

Profile
 
 
 
 


RSS 2.0     Atom Feed