×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Failure to take exposure with Starlight SXVR-M25C

  • Posts: 33
  • Thank you received: 0
On windows with the Starlight software says the resolution of the camera is 3000x2000, however the fits images it saves are 3040x2024
  • 3000x2000 - Nope
  • 3032x2016 - Nope
  • 3046x2016 - Nope, does not let me says it is out of bounds.
  • 3040x2024 - Nope, does not let me says it is out of bounds.

sx_ccd_test output:
sx_ccd_test version 1.13
 
sxList: 'SXVR-M25C' #1 [0x1278, 0x325] found
sxList() -> 1
 
testing SXVR-M25C -----------------------------------
 
sxOpen: libusb_open -> OK
sxOpen: libusb_get_config_descriptor -> OK
sxOpen: libusb_claim_interface(1) -> OK
sxOpen() -> 1
 
sxGetCameraModel: libusb_control_transfer -> OK
sxGetCameraModel: libusb_control_transfer -> OK
sxGetCameraModel: NON-INTERLACED MONO model 25
sxGetCameraModel() -> 89
 
sxGetCameraParams: libusb_control_transfer -> OK
sxGetCameraParams: libusb_control_transfer -> OK
sxGetCameraParams: chip size: 3000 x 2000 x 16, pixel size: 7.80 x 7.80, matrix type: fff
sxGetCameraParams: capabilities: STAR2K
sxGetCameraParams: serial ports: 2
sxGetCameraParams(..., 0,...) -> 1
 
sxSetTimer: libusb_control_transfer -> OK
sxSetTimer(900) -> 1
 
sxGetTimer: libusb_control_transfer -> OK
sxGetTimer: libusb_control_transfer -> OK
sxGetTimer() -> 900
 
sxGetTimer: libusb_control_transfer -> OK
sxGetTimer: libusb_control_transfer -> OK
sxGetTimer() -> 0
 
sxClearPixels: libusb_control_transfer -> OK
sxClearPixels(..., 0) -> 1
 
sxLatchPixels: libusb_control_transfer -> OK
sxLatchPixels(..., 0, ...) -> 1
 
sxReadPixels: libusb_control_transfer -> OK
sxReadPixels() -> 1
 
1787 1795 1819 1834 1802 1788 1833 1798 1822 1799 
1815 1805 1787 1829 1802 1821 1811 1795 1810 1849 
1829 1789 1855 1813 1829 1807 1795 1827 1831 1823 
1837 1810 1819 1823 1819 1808 1815 1790 1841 1807 
1793 1807 1832 1811 1797 1839 1818 1813 1821 1810 
1812 1821 1843 1791 1825 1831 1850 1830 1817 1819 
1841 1826 1817 1818 1807 1795 1829 1830 1803 1819 
1789 1791 1795 1807 1835 1838 1801 1811 1828 1815 
1820 1819 1831 1823 1815 1817 1807 1790 1787 1797 
1815 1808 1838 1791 1795 1789 1827 1806 1803 1779 
 
sxClose: libusb_close
sxClose() 
 
4 years 5 months ago #44551

Please Log in or Create an account to join the conversation.

  • Posts: 298
  • Thank you received: 46
Now we get somewhere.. sx_ccd_test recognizes the camera as a "SXVR-M25C" but seems to read the CCD as a "SXV-M25C" and that makes some confusion I guess.. or maybe the error from your first post "Driver indi_sx_ccd: sxReadPixels: libusb_control_transfer -> LIBUSB_ERROR_TIMEOUT" is the cause of this ?
I think Jasem is the guy for this little problem, so I hope he will chime in here and take a look..

/Markku
4 years 5 months ago #44599

Please Log in or Create an account to join the conversation.

  • Posts: 298
  • Thank you received: 46
I checked the driver source and found this.. your cam have usbid the same as the SXVR-M25C so that is a problem, but I don't know how to make a difference between two cams with the same usbid, and that's why it's recognized wrong.

File : sxccdusb.cpp
static struct
{
    int pid;
    const char *name;
    int seq;
} SX_PIDS[] = { { 0x105, "SXVF-M5", 0 },
                { 0x305, "SXVF-M5C", 0 },
                { 0x107, "SXVF-M7", 0 },
                { 0x307, "SXVF-M7C", 0 },
                { 0x308, "SXVF-M8C", 0 },
                { 0x109, "SXVF-M9", 0 },
                { 0x325, "SXVR-M25C", 0 },
                { 0x326, "SXVR-M26C", 0 },
                { 0x115, "SXVR-H5", 0 },
                { 0x119, "SXVR-H9", 0 },  (The list continues to cover rest of the SX cameras..)

The other thing is in the file : sxccd.cpp
Because of this line "else if (isICX453)" the driver reads the cam a wrong way ?? Well, I'm just guessing but Jasem is probably the right guy to sort this out.
void SXCCD::SetupParms()
{
    struct t_sxccd_params params;
    model             = sxGetCameraModel(handle);
    bool isInterlaced = sxIsInterlaced(model);
    bool isICX453     = sxIsICX453(model);
    PrimaryCCD.setInterlaced(isInterlaced);
    sxGetCameraParams(handle, 0, &params);
    if (isInterlaced)
    {
        params.pix_height /= 2;
        params.height *= 2;
        wipeDelay = 130000;
    }
    else if (isICX453)
    {
        params.width = 3032;
        params.height = 2016;
    }
    SetCCDParams(params.width, params.height, params.bits_per_pixel, params.pix_width, params.pix_height);

/Markku
The following user(s) said Thank You: Russell Valentine
4 years 5 months ago #44642

Please Log in or Create an account to join the conversation.

  • Posts: 1067
  • Thank you received: 140
I do t understand any of this, as I have the SXVR M25c and it runs perfectly on my rpi4 with Stellarmate...
4 years 5 months ago #44647

Please Log in or Create an account to join the conversation.

  • Posts: 1067
  • Thank you received: 140
There is nothing wrong with the driver, it took us a while 18 months back to get it to work properly, and it does now, as I have this camera, yours is the SXV mine is the newer SXVR and works fine....there must be an error on your system...
4 years 5 months ago #44648

Please Log in or Create an account to join the conversation.

  • Posts: 33
  • Thank you received: 0
Yeah. I'm not sure what all is the difference between the two cameras but I guess they are slightly incompatible. That would be easy if it is just width and height issue. Can maybe just add a overwrite flag that one can toggle. If I can figure out how to make indi use my own build of the sx driver I could try it. It would be a lot easier if I can take the camera home. The club really didn't want anyone leaving the observatory with it, but maybe I can ask for an exception to play with it for a week during next full moon.

As for an error on my system. I'm up for trying whatever is suggested. I've tried this on two different laptops I have.
Last edit: 4 years 5 months ago by Russell Valentine.
4 years 5 months ago #44653

Please Log in or Create an account to join the conversation.

  • Posts: 1067
  • Thank you received: 140
I think the problem lies with the fact that your camera is the older SXV version, and mine is the SXVR, they have got different resolutions, not sure why yours is not being recognised correctly...
About 18 months to 2 years ago Jasem and Peter (one of the indigo developers) did a lot of work on this driver, as it did not work for me and had similar issues that you are having, but it does now work perfectly on the SXVR version, but I too at that time has issues with incorrect resolutions being displayed...amongst other issues and errors, that in time were all sorted..

You say the PID numbers are the same or different on the two cameras...as they should be different...?.
4 years 5 months ago #44659

Please Log in or Create an account to join the conversation.

  • Posts: 33
  • Thank you received: 0
I agree. If I was using a SXVR I bet there would be no problem.

Yes the PID it shows is 0x325 which I think is the same as the SXVR according to here:
www.sxccd.com/80-support

lsusb with the SXV-M25C
===============================================================
Bus 001 Device 005: ID 1278:0325 Starlight Xpress SXV-M25C
===============================================================

Interesting that in the linux usbids file PID 0325 is the SXV-M25C not SXVR-M25C. I guess because it was first.

Looks like maybe my next step will be to try to get my own build going and understand the driver more.
4 years 5 months ago #44668

Please Log in or Create an account to join the conversation.

  • Posts: 298
  • Thank you received: 46
@AstroNerd
Yes, you are correct, the driver works perfectly for sx cameras and I'm using it too, but I think it should work for his cam too.

@bluthen
I wrote a quick start manual (if it can be called like that) for you so you can do some testing yourself :)
sudo apt install git build-essential cmake libindi-dev libnova-dev libgsl-dev libusb-1.0-0-dev libcfitsio-dev
 
git clone --depth=1 https://github.com/indilib/indi-3rdparty.git  (directory indi-3rdparty will be created)
cd indi-3rdparty
cd indi-sx
mkdir build
cd build
cmake ..                  (if some libs are missing then it tells you what's missing)
make                       (if there is no errors reported go for next command)
indiserver ./indi_sx_ccd    (have your cam connected and run this for testing the new driver)

I hope I didn't miss anything..

/Markku
The following user(s) said Thank You: Russell Valentine
4 years 5 months ago #44676

Please Log in or Create an account to join the conversation.

  • Posts: 33
  • Thank you received: 0
Thank you for the help so far. I've had some success but lets see if I can explain it. In sxccd.cpp I change the resolution but that did not solve the issue. I thought maybe I get a timeout in the read because it is trying to still get too much pixels, so I wanted to see which pixel would it timeout on. So I modified the size of each fetch of data and added that info to the debug log. What I discovered is that pretty much any resolution can work. If it is bigger than the actual size, the data will just be zero for those pixels. What was causing the problem is the chunk size in the usb read.

By default it tries to get all the data in one read. I've found that I can't reliable get the image data if the read chunk size is too big. The size that works for me is pretty darn small actually and I'd assume makes transfers take longer than it normally would (A guess).

1024 I still get time outs toward the end. The value I've been able to reliably use is 512. It also seems like values that are not a power of 2 cause a LIBUSB_ERROR_OVERFLOW. In any case, I'm really happy we've gotten this to work. I'm not sure how many of these older cameras are out there, so not sure if it is worth a patch or a config parameter where you can specify smaller chunk size or something. What do you guys think? Should I also post this as a git issue?

Just in case I also tried commenting out the debug statement in case it was a timing issue, but 512 still works with the debug statement commented out. And size 512 with that debug statement is a lot of statements!

Below is my diff:
diff --git a/indi-sx/sxccdusb.cpp b/indi-sx/sxccdusb.cpp
index 8f08b78..4f89b64 100644
--- a/indi-sx/sxccdusb.cpp
+++ b/indi-sx/sxccdusb.cpp
@@ -736,11 +736,12 @@ int sxReadPixels(HANDLE sxHandle, void *pixels, unsigned long count)
     while (read < count && rc >= 0)
     {
         int size = count - read;
+        size=512;
         if (size > CHUNK_SIZE)
             size = CHUNK_SIZE;
         rc = libusb_bulk_transfer(sxHandle, BULK_IN, (unsigned char *)pixels + read, size, &transferred,
                                   BULK_DATA_TIMEOUT);
-        DEBUG(log(true, "sxReadPixels: libusb_control_transfer -> %s\n", rc < 0 ? libusb_error_name(rc) : "OK"));
+        DEBUG(log(true, "sxReadPixels: libusb_control_transfer -> %s, %lu/%lu t%lu\n", rc < 0 ? libusb_error_name(rc) : "OK", read, count, transferred));
         if (transferred >= 0)
         {
             read += transferred;
4 years 5 months ago #44826

Please Log in or Create an account to join the conversation.

  • Posts: 33
  • Thank you received: 0
On my drive home I was thinking, maybe it isn't about chunk since, maybe this older model is just slower and needs a much much longer timeout. Next time I'll try increasing BULK_DATA_TIMEOUT.
4 years 5 months ago #44838

Please Log in or Create an account to join the conversation.

  • Posts: 1067
  • Thank you received: 140
Chunk size was the issue two years ago with my SXVR M25c, so whatever it is on now in the driver, was the one that worked, so any other setting and mine won’t work, so maybe we are going to need a separate driver..... :(
4 years 5 months ago #44847

Please Log in or Create an account to join the conversation.

Time to create page: 1.435 seconds