SDK Version 0.6.0921

any question related to our SDK and driver

Moderators: yang, ray, chad

SDK Version 0.6.0921

Postby NikkiM » Sun Dec 17, 2017 7:21 pm

Hello everyone,

My software has a function which constantly checks the connected camera to see if the camera is still online. If the software detects that the camera has gone offline then it re-initialises everything without having to disconnect and reconnect the camera or restart my software. This worked perfectly in previous versions of the SDK but not in 0.6.0921.

Once my software detects that the camera is not streaming (offline) it calls a function which forces the closure of the camera before going though the initialisation routine again. If a camera has gone offline (for whatever reason) then the following ZWO functions never return.

    ASIStopVideoCapture(cam_id);
    ASICloseCamera(cam_id);

As I stated above, this worked perfectly with previous SDK versions. If the camera has not gone offline then these functions return normally.

I would be grateful if somebody could comment on this issue.

Kind Regards
Nikki

EDIT:

I have since discovered that ASIGetNumOfConnectedCameras() also does not return if called after the camera has been disconnected and then reconnected after the camera has been initialised. This does not happen in other SDK releases. The only way to get these functions to return is to restart my software.
NikkiM
 
Posts: 11
Joined: Sun Mar 19, 2017 10:01 pm

Re: SDK Version 0.6.0921

Postby yang » Mon Dec 18, 2017 2:09 am

Hi, can you provide the partial code that can help me to reproduce your problem? which API did you use to determine the camera is disconnected?
ZWO software engineer
Location:lon=120.6 lat=31.3
SuZhou China
yang
Site Admin
 
Posts: 204
Joined: Fri Jul 25, 2014 2:43 am

Re: SDK Version 0.6.0921

Postby NikkiM » Sun Dec 24, 2017 2:27 pm

Dear Yang,

Thank you for your reply and I am sorry for the delay in commenting.

As I said in my original post, my software has functionality which continually checks to see if the camera is working correctly. It works something like this:

The main thread creates a worker thread and then the ZWO camera is initialised in the usual way. ASIStartVideoCapture() is then called and the worker thread continually grabs frames from the camera. Each iteration of worker thread loop sends an event back to the main thread which is used to calculate the real-time frame rate.

Once the ZWO is streaming another thread is started which continually checks to see if the worker thread is still sending events. If this thread detects that no events have occurred for a specific amount of time (something like, exposure time > 2 seconds) then I suspect that, for whatever reason, the camera has gone offline. For example, this could be because the user has altered the USB bandwidth setting to a bad value.

If my software detects that the camera is no longer delivering frames then a function is called which closes the camera. This function looks something like this:

Code: Select all
void force_close()
{
    ASIStopVideoCapture(m_ZWO_Camera_ID);
    ASICloseCamera(m_ZWO_Camera_ID);
}


After the function detailed above has completed the camera is then reinitialised in the usual way. When I use 0.6.0921 ASIStopVideoCapture() and ASICloseCamera() never return which causes my software to lockup.

This works perfectly when using previous versions of your SDK but not in 0.6.0921. If I use a previous version of the SDK ASIStopVideoCapture() and ASICloseCamera() return (not lockup) even if the camera has been disconnected).

Many Thanks
NikkiM
NikkiM
 
Posts: 11
Joined: Sun Mar 19, 2017 10:01 pm

Re: SDK Version 0.6.0921

Postby JamesF » Sun Dec 24, 2017 4:48 pm

Is force_close() being called from the same thread as controls the rest of the camera communication? I'm guessing, but perhaps weird things might happen if it isn't.

James
JamesF
 
Posts: 88
Joined: Wed Feb 20, 2013 10:27 pm

Re: SDK Version 0.6.0921

Postby yang » Mon Dec 25, 2017 1:50 am

Please send email to me and I'll tell you how to turn on debug log of our SDK, my email is:
yang.zhou ( at ) zwoptical.com
ZWO software engineer
Location:lon=120.6 lat=31.3
SuZhou China
yang
Site Admin
 
Posts: 204
Joined: Fri Jul 25, 2014 2:43 am

Re: SDK Version 0.6.0921

Postby chad » Fri Jan 19, 2018 6:15 am

Hi NikkiM,
We found the problem.
It should be the result of our recently added lock mechanism. We are trying to solve it.
Before we solve it, you can set a short exposure time before you stop it,then it should be return quickly.
Thanks
chad
ZWO Driver Engineer
Location:lon=120.6 lat=31.3
SuZhou China
User avatar
chad
 
Posts: 148
Joined: Thu Feb 09, 2017 4:58 am


Return to SDK & Driver

Who is online

Users browsing this forum: No registered users and 1 guest