Thanks for your replies, it's appreciated.
Whilst I understand the issue related to ZWO using a maxPacket size of 1024 bit instead of 512 in their standard firmware. I don't believe (however, I may be wrong) that my long exposure RAW16 failure problem is related to USB bandwidth. My Linux application is actually capable of achieving frame rates as high, if not, higher than SharpCap (Windows). For example, I can achieve the following frame rates without any problems and with few dropped frames:
RAW8: 320px x 240px: (Realtime debayering with a High Quality Linear Interpolation algorithm). Frame rates is upwards of 200 fps.
RAW8: 1280px x 960px: (Realtime debayering) Frame rate is around 18 fps.
RAW16: 1280px x 960px (Realtime debayering) Frame rate is around 9 fps.
RGB24: 320px x 240px: Frame rate is upwards of 240 fps.
RGB24: 1280px x 960px: Frame rate is around 18 fps.
My problem seems to stem from the following simple block of code. I have, of course, tested the return code of ASIGetExpStatus() and it always returns ASI_SUCCESS. It's just that the loop terminates, most of the time with ASI_EXP_FAILED. This can happen thousands of times in a row and other times I get perfect exposures each and every time. This fail cycle seems to be random but with the failures occurring most of the time.
I do set the ASI_BANDWIDTHOVERLOAD value to be 40 and set ASI_HIGH_SPEED_MODE to false.
// I doubt this function is using much USB bandwidth
while (status == ASI_EXP_WORKING)
{
ASIGetExpStatus(0, &status);
}
if(status == ASI_EXP_WORKING)
{
continue;
}
// This function will use more USB bandwidth
ASIGetDataAfterExp(0, m_RAW_Buffer, m_Width * m_Height * 2);
I tried another experiment tonight. I removed the code block which checks the exposure status and replaced it with a usleep(exposure_length * 1 second) and got similar results. In the above code example, the data extraction function is the USB bandwidth heavy function but most of the time the execution does not reach that function.
If I can find the time I may try patching my kernel and use ZWO's vanilla firmware. The camera works perfectly on SharpCap (Windows) with the compatible firmware so I don't believe that there is a problem with the hardware. However, it's not impossible that there is a bug in the Linux SDK.
Anyway, thanks for you help so far. I would be very interested to see what a ZWO representative has to say on this issue.
Many thanks
Nikki