×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Kstars crash when trying to take image using DSLR

  • Posts: 17
  • Thank you received: 6
Hi!

I am using Kstars v3.6.7 Stable Windows version and my own custom build of INDI 2.0.4 on Windows/ Cygwin . Means everything runs on Windows.
I also made a custom built of libgphoto2 library and indi-gphoto driver on Cygwin.

I have a Canon EOS 1300D DSLR camera which I tested using gphoto2 command line tool (also built for Cygwin) and it works perfectly: I can take photos, list camera content, etc.

Problem occurs however, when I setup my EKOS profile, add the camera to the profile. Once I start the profile, switch to EKOS Camera module and try to take a preview shot or even some sequences, KSTARS crashes after a few seconds. I tried various camera settings in both EKOS and INDI control panel but unfortunately nothing helped. It always ends up with a crash.
Tried to look into the EKOS/INDI logfiles but there are no info about the crash or at least I was not able to find it.

Any idea, what could be the root cause of crash or how to workaround it? I guess some of the developers, maybe Jasem could give some tips.

Thanks and best regards,

Ladislav
6 months 2 weeks ago #96283

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

  • Posts: 11
  • Thank you received: 0
Hello Ladislav,

I think this might be a general issue with the INDI GPhoto CCD driver, as I have tried to use both Canon EOS 450D and Canon EOS R7, running under both ManjaroLinux and ArchLinux with kstars 3.6.6, both with libindi-2.0.4 and libindi-gphoto 2.0.4.
Connecting the DSLRs works fine, also video preview work using the ' Streaming' 'Stream on' button; but a crash of the INDI GPhoto driver can be reproduced all the time on clicking the 'Record (Frames)' button. After showing a dialog box that the INDI GPhoto driver crashed and a countdown to zero also kstars crashes.

On kstars stdout I see two INDI GPhoto related messages:
  Dispatch command error(-1): INDI: Could not find property DRIVER_INFO in GPhoto CCD
  Dispatch command error(-1): INDI: Could not find property CCD_EXPOSURE in GPhoto CCD

I have re-built kstars from git with debug infos using the AUR (aur.archlinux.org) kstars-git, libindi-git and libindi-gphoto-git recipes:
* kstars 3.6.8 beta (= kstars-git 1:cfc274ad1-1)
* libindi-git v2.0.4.7.gb38785840-1
* libindi-gphoto-git v2.0.4.7.g4056c204-1

Re-runnind under gdb gave me this stacktrace (which occurs as soon as I clicked on 'Record (Frames)' in the GPhoto CCD 'Streaming' tab:
Thread 1 "kstars" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in  ()
#1  0x0000555555bac6ea in ISD::ConcreteDevice::getNumber(QString const&) const
	(this=this@entry=0x55555a240e80, name=...)
	at /usr/src/debug/kstars-git/kstars/kstars/indi/indiconcretedevice.cpp:107
#2  0x0000555555bc2c7c in ISD::CameraChip::isCapturing() (this=this@entry=0x555558abd3b0)
	at /usr/src/debug/kstars-git/kstars/kstars/indi/indicamerachip.cpp:532
#3  0x0000555555d2d570 in Ekos::Capture::refreshCameraSettings() (this=0x555558fafb50)
	at /usr/src/debug/kstars-git/kstars/kstars/ekos/capture/capture.cpp:708
#4  0x00007ffff4ed0b37 in  () at /usr/lib/libQt5Core.so.5
#5  0x00007ffff4ed2db7 in  () at /usr/lib/libQt5Core.so.5
#6  0x00007ffff4ec35ee in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#7  0x00007ffff5b7893f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#8  0x00007ffff4e9bbf8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#9  0x00007ffff4eea26b in QTimerInfoList::activateTimers() () at /usr/lib/libQt5Core.so.5
#10 0x00007ffff4eea85a in  () at /usr/lib/libQt5Core.so.5
#11 0x00007ffff3cb2f19 in g_main_dispatch (context=0x7fffe8000ec0) at ../glib/glib/gmain.c:3476
#12 0x00007ffff3d112b7 in g_main_context_dispatch_unlocked (context=0x7fffe8000ec0) at ../glib/glib/gmain.c:4284
#13 g_main_context_iterate_unlocked.isra.0
	(context=context@entry=0x7fffe8000ec0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
	at ../glib/glib/gmain.c:4349
#14 0x00007ffff3cb1112 in g_main_context_iteration (context=0x7fffe8000ec0, may_block=1) at ../glib/glib/gmain.c:4414
#15 0x00007ffff4eeaa1c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
	at /usr/lib/libQt5Core.so.5
#16 0x00007ffff4e9a904 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#17 0x00007ffff4e9bda3 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#18 0x0000555555741845 in main(int, char**) (argc=<optimized out>, argv=<optimized out>)
	at /usr/src/debug/kstars-git/kstars/kstars/main.cpp:386
(gdb) 

The logfile looks like this:
INFO    0.002644 sec    : Session log file /home/klaus/.indi/logs/2023-10-08/indi_gphoto_ccd/indi_gphoto_ccd_19:24:33.log
INFO    0.740674 sec    : GPhoto CCD is online.
INFO    0.740713 sec    : Detected Canon.Inc Model Canon EOS R7.
INFO    1.022860 sec    : World Coordinate System is enabled.
INFO    1.023798 sec    : Session log file /home/klaus/.indi/logs/2023-10-08/indi_gphoto_ccd/indi_gphoto_ccd_19:24:33.log
INFO    1.023831 sec    : Upload settings set to client only.
INFO    1.025588 sec    : Capture target set to Internal RAM
INFO    1.025601 sec    : Images downloaded from camera will saved in the camera internal storage.
INFO    1.025619 sec    : Force BULB is enabled. All expsures shall be captured in BULB mode except for subsecond captures.
INFO    68.592097 sec   : Starting the video stream with target exposure 0.100000 s (Max theoritical FPS 10)
INFO    85.002103 sec   : Starting video record (Frame count): 5.
INFO    85.002200 sec   : Record file is /home/klaus/indi_2023-10-08/indi_record_2023-10-08@19-25-58.ser
INFO    85.178698 sec   : Waiting for all buffered frames to be recorded

Maybe that helps in tracking down the problem?

Kind regards,
Klaus
6 months 2 weeks ago #96456

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

  • Posts: 1187
  • Thank you received: 370
Dear Klaus,
I've tried to reproduce the problem, but the crash did not occur. Could you please post /home/klaus/.indi/logs/2023-10-08/indi_gphoto_ccd/indi_gphoto_ccd_19:24:33.log?

And please check whether /home/klaus/indi_2023-10-08/indi_record_2023-10-08@19-25-58.ser exists and is not empty.

My setup is INDI 2.0.4, latest KStars, RaspianOS.

- Wolfgang
6 months 1 week ago #96476

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

  • Posts: 11
  • Thank you received: 0
Hello Wolfgang,
the code block after 'The logfile looks like this' is the complete content of /home/klaus/.indi/logs/2023-10-08/indi_gphoto_ccd/indi_gphoto_ccd_19:24:33.log
And yes, /home/klaus/indi_2023-10-08/indi_record_2023-10-08@19-25-58.ser exists and is not empty: size 9216000 bytes, opening with siril shows that it contains exactly four frames.
Kind regards,
Klaus
6 months 1 week ago #96489

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

  • Posts: 1187
  • Thank you received: 370
Many Thanks Klaus,
the root cause is a crashing gphoto driver, and here we need to find the reason behind. The subsequent KStars crash is annoying, I know, but has lower priority.

I have to check it with the dev group how we could track this down.

-Wolfgang
6 months 1 week ago #96499

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

  • Posts: 11
  • Thank you received: 0
Hello Wolfgang,

I tried to attach gdb to the indi_gphoto_ccd driver directly now and captured gdb backtraces (just) from the driver crash.
To not garble the forum too much I put it as gitlab snippet here:
indi_gphoto_ccd driver crash with EOS R7 below kstars-git cfc274ad1

I also tried to run with the Canon DSLR driver (which did not work in the past for me), but same result:
indi_canon_ccd driver crash with EOS R7 below kstars-git cfc274ad1

Kind regards,
Klaus
6 months 1 week ago #96616

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

  • Posts: 1187
  • Thank you received: 370
Klaus,
I answered on gitlab to your posting. To me it looks like a concurrency issue. It would be great if you could compile the driver with some additional debugging messages.
- Wolfgang
6 months 6 days ago #96627

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

  • Posts: 11
  • Thank you received: 0
Hello Wolfgang,
I added debug statements in GPhotoCCD::StopStreaming() before and after the liveViewThread.join(), it's called only once, after the 30 frames were taken - at the end of the recording.

To rule out that something is broken in my archlinux/manjaro installations (both of them, PC with AMD Ryzen 5700G, Laptop Lenovo T490s show the problem), I tried something else today:
I installed ubuntu-22.04.3-LTS in gnome-boxes, installed kstars/indi and latest EKOS as mentioned in the ubuntu installation instructions (apt add repository, install indi-full gsc kstars-bleeding), apt dist-upgrade to latest versions, rebooted in the virtual machine.
And then tried in the ubuntu virtual machine both first with the Canon EOS R7 (with GPhoto CCD driver) and then with the Canon EOS 450D (with Canon driver, reporting camera as ' Canon DSLR EOS 450D (PTP mode)) - both drivers crash ... at the end of the recording.
My observations: In the Streaming tab, switching on/off the live streaming works, also multiple times, no crash.
Starting recording with 'Record On' , or 'Record (Duration)', or 'Record (Frames)' buttons works - it records even for minutes without problems - but: as soon as the<strong> end of the recording</strong> is reached - either end of given duration, or number of frames reached, or I press 'Record off' - <strong>the driver crashes reproducibly</strong>.

I did another debugging attempt with strace, attaching to the indi_gphoto_ccd driver while also writing the detailed logfile from kstars. Please look at gitlab snippet 3615369 'indi_gphoto_ccd received signal SIGABRT with EOS R7 on pressing 'Record off' button in INDI dialog (with kstars-bleeding 6:3.6.7+202310142136~ubuntu22.04.1 amd64 in ubuntu-22.04.3-LTS gnome-boxes VM)' for the detailed logs.

Any hints on how to debug this further?
Kind regards,
Klaus
Last edit: 6 months 2 days ago by Klaus H.. Reason: add link to additional debug infos in gitlab snippet 3615369
6 months 2 days ago #96728

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

Time to create page: 0.722 seconds