ASI Linux SDK beta version

any question related to our SDK and driver

Moderators: yang, Support@ZWO

minaya
Posts: 11
Joined: Wed May 15, 2013 9:04 pm

Re: ASI Linux SDK beta version

Post by minaya » Sat Jul 13, 2013 9:05 pm

Sam,

bool getImageData(unsigned int* buffer, int bufSize, int waitms);

Is getImageData defined with unsigned char buffer?. What about the 16bits, I think a char (256 values) cannot handle 12/16 bits format.

PS. Any news on the Raspberry / Rikomagic ARM support?

User avatar
Sam
Posts: 2799
Joined: Thu Feb 21, 2013 2:51 am

Re: ASI Linux SDK beta version

Post by Sam » Sun Aug 04, 2013 1:45 am

minaya wrote:Sam,

bool getImageData(unsigned int* buffer, int bufSize, int waitms);

Is getImageData defined with unsigned char buffer?. What about the 16bits, I think a char (256 values) cannot handle 12/16 bits format.

PS. Any news on the Raspberry / Rikomagic ARM support?
Sorry for my later reply.
the buffer pointer is just a memory address. this function will put the data in this address.
it don't care the type.
one pixel need one byte to save if output RAM 8
one pixel need 2 bytes to save if output RAM16

About the ARM platform support, its not done yet.
I will post a thread here if its done. thanks
ZWO Founder
Location:lon=120.6 lat=31.3
SuZhou China

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

Re: ASI Linux SDK beta version

Post by JamesF » Sun Oct 06, 2013 11:14 pm

I've just started coding an application against the Linux SDK. My initial thoughts...

1. The SDK library appears to be in C, but the header file only compiles in C++ for me. I've fixed that as it's fairly trivial to do. If anyone wants a copy they're welcome to it. Just let me know.

2. The SDK only appears to support a single camera at once so, for instance, it appears that it would not be possible to write an application using this SDK that could image using one ASI120 and guide using another.

3. It would be very useful if the functions in the library had names more likely to be unique. Function names such as "getMin()" are quite likely to clash with other code. It would be helpful if all the functions in the library were prefixed by, say, "ASI". So "getMin()" would become "ASIgetMin()", for instance.

James

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

Re: ASI Linux SDK beta version

Post by JamesF » Sun Oct 06, 2013 11:27 pm

Oh, and what does the CONTROL_BANDWIDTHOVERLOAD command do?

James

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

Re: ASI Linux SDK beta version

Post by JamesF » Mon Oct 07, 2013 5:29 pm

It would also be useful if it were possible to have a enum or #defined value for the camera type returned by the library. Yes, I can compare the strings that are returned by the library for the camera names, but that's a bit ugly in terms of programming.

James

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

Re: ASI Linux SDK beta version

Post by JamesF » Mon Oct 07, 2013 10:12 pm

Another question :)

The header file gives a description for getImageData:

Code: Select all

// wait waitms capture a single frame -1 means wait forever, success return true, failed return false   
bool getImageData(unsigned char* buffer, int bufSize, int waitms);
What is the purpose of the bufSize parameter? I know what resolution/RoI and image type I have requested and can calculate the size of the buffer accordingly. The SDK has the same information and therefore knows how large the buffer for a single frame should be. So why pass that information as a parameter here? It doesn't make sense to me that I should want to request part of a frame, so is this intended to allow multiple frames to be collected in one function call? But if that were the case, why not just give the number of frames you require?

Or is the size just there to set a limit on the amount of data returned? For example, "give me this much data or less depending on the frame size, but no more". But if there's no return value to give the amount of data stored, how is that useful? I'd still have to know the frame size, so I can make sure the buffer is big enough.

James

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

Re: ASI Linux SDK beta version

Post by JamesF » Wed Oct 09, 2013 9:47 am

Sam,

I've emailed you about this too, but rather than attach a large sample image there it seemed sensible to show it here...

I have a problem with both the demo application and my own capture program when processing RGB24 frames from the ASI120MC. Sometimes I an receiving frames like this one from the getImage() function. It looks to me as if either the image frame has not been started from the correct place and that I am getting part of the raw image on the right hand side of the frame (part of the image which should actually be on the left), or the buffers for the debayered and raw frames overlap somehow.

This happens in both my own application and the demo (which I have just altered to use RGB24 rather than Y8 for the frame format) and I do not see any problems with data from V4L2-connected cameras, so I'm as sure as I can be that it's not a bug in my code for the time being.

Here's the sample image:

Image

It may of course be that I need to do something else to get RGB24 to work properly, but as there is no demo for RGB24 capture I can't be sure.

James

User avatar
Sam
Posts: 2799
Joined: Thu Feb 21, 2013 2:51 am

Re: ASI Linux SDK beta version

Post by Sam » Wed Oct 09, 2013 9:51 am

the shift problem is because not enough computer resource or USB bandwidth not enough.
there is a "CONTROL_BANDWIDTHOVERLOAD" option to control this.
you can turn it down to get a more stable frame transfer than speed.
this usually happen in a virtual machine.debayer need lots of CPU resource.

there must be bug in the SDK because very few user use it. even me use windows :)
so I am glad to see somebody start to use it under linux.
any problem feel free contact us.
ZWO Founder
Location:lon=120.6 lat=31.3
SuZhou China

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

Re: ASI Linux SDK beta version

Post by JamesF » Wed Oct 09, 2013 10:10 am

I've just had a quick look at the CONTROL_BANDWIDTHOVERLOAD setting.

The minimum value (for the ASI120MC) appears to be 40, and the maximum value is 100. The default value (when the camera is powered up from cold before any value is set) appears to be 1, so it appears that I should at least set some value before trying to capture data.

What do these values represent? If I am having problems with the image splitting, should I be setting this value larger or smaller?

Thanks,
James

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

Re: ASI Linux SDK beta version

Post by JamesF » Wed Oct 09, 2013 11:15 am

Sorry, an error there. The default value for the control is 86.

James

Post Reply