ST-I guide camera very slow under Linux

Discussion in 'Scripting and Programming' started by Colin Aspin, Sep 17, 2016.

  1. Colin Aspin

    Colin Aspin Standard User

    Joined:
    Sep 15, 2016
    Messages:
    10
    Location:
    HIlo, HI
    I am using some C++ code to grab an image from my ST-I guide camera but it takes over 50 seconds to perform the grab (writing to disk in FITS format is a second or less). The same code runs well on a STF-8300M and grabs an image in a second or so. Anybody got any suggestions? Both are USB and both are connected to a Linux box.

    Also, the image that eventually comes back has horizontal lines through it, increasing in frequency with y-axis position, see attached screen grab, doesn't happen with the STF-8300M.
     

    Attached Files:

  2. Adam Robichaud

    Adam Robichaud Staff Member

    Joined:
    Sep 29, 2014
    Messages:
    776
    Location:
    Ottawa
    Looks like it could be improperly set image dimensions... SBIGUDrv's command timeout is 10 seconds, and it looks like you have a repeating pattern of 5-6 junk packets at the end of the image. You might be requesting more data than the camera can provide.
     
  3. Colin Aspin

    Colin Aspin Standard User

    Joined:
    Sep 15, 2016
    Messages:
    10
    Location:
    HIlo, HI
    Hi Adam, Thanks for the reply. I've tried various image dimensions but still get the lines and the slowness. ST-I should be 640x480, this is the run of the testapp for that setting:

    ubuntu:~/LinuxDevKit/x86/c/testapp> date ; ./testapp ./ FITS 1 DF 0 1x1 0 0 640 480 1 0;date
    Tue Sep 20 11:24:02 HST 2016
    Input parameters : filePath = ./, bFitsType = 1, numOfImages = 1, bLightFrame = 0, exposure time = 0, readout mode = 0, top = 0, left = 0, width = 640, height = 480, bFastReadout = 1, bDualChannelMode = 0
    Link established to : ST-i
    Taking dark frame no.: 1
    File saved as : ./DF_2016-09-20T11:24:51.913.fits
    The End...
    Tue Sep 20 11:24:51 HST 2016

    As you can see, it takes 49 seconds to take the data. Data storage to FITS is quick, it seems like the problem is with the acquisition. If I specify SBIG format, it still takes ~50 secs.
     
  4. Adam Robichaud

    Adam Robichaud Staff Member

    Joined:
    Sep 29, 2014
    Messages:
    776
    Location:
    Ottawa
    We strongly advise using the dimensions provided by CC_GET_CCD_INFO, since that guarantees you don't get into any region of the chip that isn't considered the active area. I also advise you wrap your calls to CC_READOUT_LINE in a timing measurement as a sanity check, and log any errors received from the calls to SBIGUnivDrvCommand() (See the PAR_ERROR enum for more details). Full-frame ST-I readout should be under a second, and it really sounds like you're getting timeouts.
     
  5. Colin Aspin

    Colin Aspin Standard User

    Joined:
    Sep 15, 2016
    Messages:
    10
    Location:
    HIlo, HI
    Well, I'm just using the testapp in the LinuxDevKit provided on your software site. I don't know how to use CC_GET_CCD_INFO. I program in python mostly not cpp...

    OK, I decided to run the ST8300M using testapp and it produces good images with no lines and in a couple of seconds from the command:

    ubuntu:~/LinuxDevKit/x86/c/testapp> ./testapp ./ FITS 1 DF 0 1x1 0 0 0 0 1 0
    Input parameters : filePath = ./, bFitsType = 1, numOfImages = 1, bLightFrame = 0, exposure time = 0, readout mode = 0, top = 0, left = 0, width = 0, height = 0, bFastReadout = 1, bDualChannelMode = 0
    Link established to : ST-8300
    Taking dark frame no.: 1
    File saved as : ./DF_2016-09-21T09:34:54.967.fits
    The End...

    The same exact command with the ST-I produces the horizontal lines and takes 49 seconds to acquire... Something wrong somewhere with the ST-I.
     
    Last edited: Sep 21, 2016
  6. Adam Robichaud

    Adam Robichaud Staff Member

    Joined:
    Sep 29, 2014
    Messages:
    776
    Location:
    Ottawa
    Am I correct in assuming you didn't write the C++ code mentioned in your first post, then? I've been operating under the assumption that you're developing that application, and had access to (at least) a wrapper of SBIGUDrv in your language of choice. If that's not the case, then we need to change up tactics.

    Unfortunately, our LinuxDevKit sample code is intended for instructional purposes only, and isn't guaranteed to be bug free (we haven't made any modifications to that code since we initially acquired SBIG).

    Do you have access to a Windows PC? It would help narrow things down if you can reproduce the issue on that platform, since then we can take debug logs, and diagnose the issue more effectively.
     
  7. Colin Aspin

    Colin Aspin Standard User

    Joined:
    Sep 15, 2016
    Messages:
    10
    Location:
    HIlo, HI
    I just ran the ST-I under Windows 7 using CCDOPs5 and it took a frame in 0.31 secs and it had no lines. Looks like it is just Linux.
     
  8. Colin Aspin

    Colin Aspin Standard User

    Joined:
    Sep 15, 2016
    Messages:
    10
    Location:
    HIlo, HI
    I'm just trying to get the ST-I camera reading out as it should using the LinuxDevKit testapp under Linux, that's the state. I do have other code that does the same as the testapp but just getting down from a 49 sec per image to 1 sec per image using testapp is all I need now.

    By the way, test app had some commands commented out, one was a frame/sec count, if I uncomment that I get 0.02 fps from ST-I and 0.12 fps from ST8300M.
     
  9. Jan Soldan

    Jan Soldan Cyanogen Customer

    Joined:
    Oct 11, 2014
    Messages:
    239
    Location:
    Czech Republic
    Colin,
    did your STi work correctly in the time we delivered this linux stuff to you a few years ago or is this the first time you use your STi camera with Ubuntu ? I use STi with Debian ARM under Linux with that two years old linux driver and have no problem with it. I can get rougly 5-6 fps on Java client - server application.
    Jan
     
  10. Colin Aspin

    Colin Aspin Standard User

    Joined:
    Sep 15, 2016
    Messages:
    10
    Location:
    HIlo, HI
    Hi Jan,

    The ST-I is new, bought it a few weeks ago. The ST8300M I bought several years ago has worked well so far. I get the same 0.2fps from the ST-I using the LinuxDevKit testapp and the code I used for the ST8300M. I'm going to look into reloading the firmware from the Windows SBIGDriverChecker64 I now have on Windows 7.

    Thanks,
    Colin
     
  11. Colin Aspin

    Colin Aspin Standard User

    Joined:
    Sep 15, 2016
    Messages:
    10
    Location:
    HIlo, HI
    By the way, Adam, Jan, here is the output from CC_GET_CCD_INFO using the ST-I, seems like there is an error (20) at the top.
     

    Attached Files:

  12. Colin Aspin

    Colin Aspin Standard User

    Joined:
    Sep 15, 2016
    Messages:
    10
    Location:
    HIlo, HI
    OK, I've given up on the ST-I, I'm returning it. It just doesn't work under Linux for me. I checked the firmware and it said it was the latest but it still take 49 seconds per image.
     
  13. Jan Soldan

    Jan Soldan Cyanogen Customer

    Joined:
    Oct 11, 2014
    Messages:
    239
    Location:
    Czech Republic
    Colin,
    if your sti works under Windows, it should be ok, right ?
    If you have 64 bit Ubuntu installed, than I could compile old code and send you an updated linux driver, ie. libsbigudrv.so library, so you could test it. Please let me know if you are possibly interrested, becase I could do that next week only and , of course, I can't guarantee it will work due to two years old stuff. But as I said, it works fine on my linux machines, although they are installed on ARM processors only. BTW, listing above shows horrible values, this looks like there is a problem with the driver. Unfortunately, I do not remember for which cameras we have sent the linux stuff to you a few year ago. Was this for your st 8300 you have mentioned above?

    Jan
     
    graham.bell.77770 likes this.
  14. Colin Aspin

    Colin Aspin Standard User

    Joined:
    Sep 15, 2016
    Messages:
    10
    Location:
    HIlo, HI
    Jan, Thanks for the offer but Adam from Diffraction Limited is looking into the problem and will hopefully find the problem very soon. Yes, we used the ST8300M under Linux successful, with your help.
     
  15. Jan Soldan

    Jan Soldan Cyanogen Customer

    Joined:
    Oct 11, 2014
    Messages:
    239
    Location:
    Czech Republic
    Colin,
    this is the best solution to get the latest sbig linux driver.
    Jan
     

Share This Page