QHYCCD

Explain this

Explain this
« on: March 22, 2021, 05:09:07 AM »
sdk_linux64_21.03.13, Ubuntu 20,  our usual code for getting single frame, QHY600M-aa1c6f4fab9d48eab. Same egfault now recurrent every two or three exposure.

Stack Trace (from fault):
[  0] 0x00007f6893f03c89                        /usr/local/lib/libqhyccd.so+00842889 _ZN6QHYCAM18SWIFT_MSBLSB16BITSEPhjj+00000065
[  1] 0x00007f6893fcc4a5                        /usr/local/lib/libqhyccd.so+01664165 _ZN10QHY600BASE14GetSingleFrameEPvPjS1_S1_S1_Ph+00001131
[  2] 0x00007f6893ef3f83                        /usr/local/lib/libqhyccd.so+00778115
[  3] 0x00007f6893ef4431                        /usr/local/lib/libqhyccd.so+00779313 GetQHYCCDSingleFrame+00000251
[  4] 0x00007f6910227616 /tmp/tp00f65179_b922_451d_a07d_ba955b2fde6c/libqhyccd_t
....

Re: Explain this
« Reply #1 on: March 22, 2021, 08:31:12 PM »
    OK,I will tested it,please wait for some time.
Best Regards,
QinXiaoXu

Re: Explain this
« Reply #2 on: April 21, 2021, 07:52:38 AM »
Stack Trace (from fault):
[  0] 0x00007fdb9541d8e9                    /lib/x86_64-linux-gnu/libc.so.6+01632489
[  1] 0x00007fd97ed93fca                        /usr/local/lib/libqhyccd.so+01294282 _ZN11QHY5IIIBASE20ReadImageInDDR_TitanEPvjjjjiijjPhj+00002272
[  2] 0x00007fd97edeed39                        /usr/local/lib/libqhyccd.so+01666361 _ZN10QHY600BASE14GetSingleFrameEPvPjS1_S1_S1_Ph+00000911
[  3] 0x00007fd97ed17f2a                        /usr/local/lib/libqhyccd.so+00786218
[  4] 0x00007fd97ed183d5                        /usr/local/lib/libqhyccd.so+00787413 GetQHYCCDSingleFrame+00000251

Re: Explain this
« Reply #3 on: April 21, 2021, 08:37:48 PM »
Hi,
    Please try this library and sample.
Best Regards,
QinXiaoXu

Re: Explain this
« Reply #4 on: April 22, 2021, 02:55:09 AM »
That is what I'm using since three weeks. It indeed enables repeated calls of Live sequences within the same session, which was not possible with 21.3.13, but is still riddled by bugs. For one, it crashes the calling application when the camera is powered off, EVEN after QHYCCDQuit, ReleaseQHYCCDResource() AND unloading the dynamic library.

Your computation of the fps in the sample is wrong, anyway, as written earlier. See attached.

More details here.

Re: Explain this
« Reply #5 on: April 22, 2021, 09:08:18 PM »
Hi,
    Thanks for the feedback about FPS.
    About the crash issue,do you mean after camera disconnect the power,call applications will make this issue?And the QHYCCDQuit,is it mean call StopQHYCCDLive and CloseQHYCCD functions or other functions?
    And about swith readmode streammode and BIN BITS Color Mode,this step is a little complex,I'm writing a manual for it,it will also contain method of using CONTROL ID.
Best Regards,
QinXiaoXu

Re: Explain this
« Reply #6 on: April 23, 2021, 08:24:59 AM »
QinXiaoXu, an API segfaulting or hanging applications every third function call, the more so if lots of undocumented functions are not called in a specific order, is not "a little complex", it's poorly designed. Error situations should return error codes, not cause segmentation faults.

As specifically for the delayed application crash after unloading the dynamic library,  I think things boil down to not having called CloseQHYCCD() before unloading, or calling it on a camhandle which became invalid because of the poweroff or of the usb disconnection. Here is a repeatable matlab test, which deceptively hides under four lines of matlab code maybe two dozens of SDK calls. On the other hand, (at least in some earlier version of the sdk according to my notes) CloseQHYCCD itself crashed if called with an invalid camhandle, or if called twice with the same handle, which discouraged calling it "just to be sure".

Re: Explain this
« Reply #7 on: April 24, 2021, 09:45:10 PM »
Hi,
    Yes,after calling CloseQHYCCD function,the handle will be not available,you need get handle again.I will add this and other matters need attentions to manual.
Best Regards,
QinXiaoXu

Re: Explain this
« Reply #8 on: April 27, 2021, 04:59:15 AM »
Stack Trace (from fault):
[  0] 0x00007f6ec094a1be                        /usr/local/lib/libqhyccd.so+00852414 _ZN6QHYCAM18SWIFT_MSBLSB14BITSEPhjj+00000054
[  1] 0x00007f6ec09d29a7                        /usr/local/lib/libqhyccd.so+01411495 _ZN14QHY5III367BASE14GetSingleFrameEPvPjS1_S1_S1_Ph+00001015
[  2] 0x00007f6ec0939f2a                        /usr/local/lib/libqhyccd.so+00786218
[  3] 0x00007f6ec093a3d5                        /usr/local/lib/libqhyccd.so+00787413 GetQHYCCDSingleFrame+00000251
[

Re: Explain this
« Reply #9 on: April 27, 2021, 04:59:58 AM »
Stack Trace (from fault):
[  0] 0x00007f413fdbae95                        /usr/local/lib/libqhyccd.so+00790165 SetQHYCCDBinMode+00000108

Re: Explain this
« Reply #10 on: April 28, 2021, 09:04:51 AM »
[  0] 0x00007f0da15e018b                    /lib/x86_64-linux-gnu/libc.so.6+00287115 gsignal+00000203
[  1] 0x00007f0da15bf859                    /lib/x86_64-linux-gnu/libc.so.6+00153689 abort+00000299
[  2] 0x00007f0da15bf729                    /lib/x86_64-linux-gnu/libc.so.6+00153385
[  3] 0x00007f0da15d0f36                    /lib/x86_64-linux-gnu/libc.so.6+00225078
[  4] 0x00007f0da1d3a179              /lib/x86_64-linux-gnu/libpthread.so.0+00090489
[  5] 0x00007f0da1d2fb09              /lib/x86_64-linux-gnu/libpthread.so.0+00047881
[  6] 0x00007f0b8a06905a              /lib/x86_64-linux-gnu/libusb-1.0.so.0+00041050 libusb_cancel_transfer+00000058
[  7] 0x00007f0b8a12dba0                        /usr/local/lib/libqhyccd.so+00732064 _Z15StopAsyQCamLivePv+00000406
[  8] 0x00007f0b8a21180c                        /usr/local/lib/libqhyccd.so+01665036 _ZN10QHY600BASE16StopLiveExposureEPv+00000028
[  9] 0x00007f0b8a13bdc7                        /usr/local/lib/libqhyccd.so+00789959 StopQHYCCDLive+00000255

Re: Explain this
« Reply #11 on: April 28, 2021, 09:07:02 AM »
[  0] 0x00007f867ee6b18b                    /lib/x86_64-linux-gnu/libc.so.6+00287115 gsignal+00000203
[  1] 0x00007f867ee4a859                    /lib/x86_64-linux-gnu/libc.so.6+00153689 abort+00000299
[  2] 0x00007f867eebd45a                    /lib/x86_64-linux-gnu/libc.so.6+00623706
[  3] 0x00007f867eebfabf                    /lib/x86_64-linux-gnu/libc.so.6+00633535
[  4] 0x00007f867eec0913                    /lib/x86_64-linux-gnu/libc.so.6+00637203
[  5] 0x00007f867eec250a                    /lib/x86_64-linux-gnu/libc.so.6+00644362 __libc_malloc+00000682
[  6] 0x00007f8466e82a15                        /usr/local/lib/libqhyccd.so+01645077 _Z15alloc_transfersPv+00000085
[  7] 0x00007f8466da38ff                        /usr/local/lib/libqhyccd.so+00731391 _Z16BeginAsyQCamLivePv+00000172
[  8] 0x00007f8466e86f2b                        /usr/local/lib/libqhyccd.so+01662763 _ZN10QHY600BASE17BeginLiveExposureEPv+00000205
[  9] 0x00007f8466db1855                        /usr/local/lib/libqhyccd.so+00788565 BeginQHYCCDLive+00000347