Bug 430127 - KStars Crash When Imaging with ASI6200MC-Pro
Summary: KStars Crash When Imaging with ASI6200MC-Pro
Status: RESOLVED FIXED
Alias: None
Product: kstars
Classification: Applications
Component: general (other bugs)
Version First Reported In: 3.5.0
Platform: Other Linux
: NOR critical
Target Milestone: ---
Assignee: Jasem Mutlaq
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-07 23:22 UTC by MountainAirCA
Modified: 2022-10-10 07:52 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Crash log (38.08 KB, text/plain)
2020-12-16 05:25 UTC, MountainAirCA
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MountainAirCA 2020-12-07 23:22:34 UTC
SUMMARY

KStars running on RPi4 (Stellarmate) seems to crash 3-4 images into an imaging sequence with this large-format camera.  A single image shows memory use climb from 33 to 66%, but as KStars continues to image, this climbs to 100%.  Then CPU pegs at 100% as well.  At this point either KStars crashes, or it does not crash and the entire machine locks up and must be power-cycled.

STEPS TO REPRODUCE
1. Connect ASI6200MC-P.  Monitor CPU/memory via VNC or Stellarmate app.
2. Configure capture module to take 100 frames binned 1x1.
3. 3-4 frames in, KStars will fail.  

OBSERVED RESULT

KStars crashes or machine hangs.


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Stellarmate 1.5.5
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

I wonder if RPi4 is just not powerful enough (especially the 4GB memory limit) for these huge images.  However, is there a way to turn off the FITS viewer to avoid that memory overhead?  Hopefully there's no memory leak there, but I did notice that after each frame, the %memory increased higher than the previous frame.
Comment 1 MountainAirCA 2020-12-07 23:40:10 UTC
Note:  RPi4 was not overheating.  It has a cooling fan, and it is in a refrigerator at 34°F (I'm taking darks for this new camera).

Also, this crash/hang seems to happen even if I am just looping images.  Also, adding a delay of 5 seconds between exposures didn't seem to help (I was thinking capturing one image while trying to load another into FITS Viewer was just too much).

These are 113 MByte image files, but RPi 4 has 3GB free memory when I start.  I'm confused why this is causing a problem.
Comment 2 MountainAirCA 2020-12-14 08:07:56 UTC
I was able to capture successfully using KStars on macOS Big Sur running on a Mac mini with 16GB RAM.  However, that is undesired because it is not as stable as Linux (6 crashes last night) and I'm not crazy about strapping a $1000 Mac mini to my pier at a remote site.

QUESTION 1:  Is this a software bug that might be fixed, or do I really need more than 4GB RAM for these 13MB images?

QUESTION 2:  If I connect to RPI4 via KStars/Ekos running on my laptop (connecting to Indi Server on the RPI4), would it consume less memory/CPU?  I can't try this as we're clouded over.

QUESTION 3:  Do you think an RPI4 board with 8GB RAM would help, or would we still have a high CPU utilization problem?

Note, I did not enable features that consume more memory/CPU.  I try to keep the config as default as possible for troubleshooting purposes.

I am ready to buy an 8GB RPi4 if you think it will help.  Alternatively, I might opt for a more powerful Mini PC running Linux, but I prefer StellarMate's pre-configured design.
Comment 3 MountainAirCA 2020-12-16 05:23:55 UTC
Unfortunately the 8GB version of the RPi4 did not resolve this issue.  While I never saw memory climb much above 3.3GB according to the task manager, KStars continued to crash after 3-5 frames.  I am attaching the logs.  Note, after several attempts I could not get any exposures from the camera until I rebooted the RPi.  On the Mac Mini, I was able to capture almost 3000 exposures (building libraries for the new camera) with no crashes.

Until this is resolved, I think you need to put a warning on the KStars/Stellarmate FAQs so people know this camera (or perhaps all high-megapixel cameras) might not be reliable.  I would also warn them that buying a RPi 8GB won't necessarily help.  I learned that $95 lesson the hard way.  :-)
Comment 4 MountainAirCA 2020-12-16 05:25:49 UTC
Created attachment 134107 [details]
Crash log
Comment 5 Jasem Mutlaq 2020-12-16 14:56:43 UTC
Thank you for the update, the log shows it stops when reading the file. It would be better to arrange for teamviewer session to debug the rpi4 in more detail. Once teamviewer is installed, please share the details privately to my email or send me private message on INDI forum.
Comment 6 MountainAirCA 2020-12-29 21:55:02 UTC
Just a note for the ticket, Jasem was able to connect and noted that as soon as KStars approached 2GB RAM, it crashed.  It should be able to use 3GB in this x86 kernel, so it's a mystery that he is researching.  +1 for full 64-bit support!   :-)
Comment 7 Jasem Mutlaq 2021-01-05 19:54:39 UTC
Btw, I'm still checking why we can't use the supposedly 3GB limit for App. 3GB would be more than enough.
Comment 8 MountainAirCA 2021-01-19 00:29:31 UTC
Another full-frame camera has graced my doorstep, so this issue will now affect both my RPis.  Hopefully we can find a solution for this mystery.
Comment 9 Jasem Mutlaq 2021-01-19 20:24:25 UTC
I started investigating this issue in depth now.
Comment 10 MountainAirCA 2021-02-05 17:21:46 UTC
I believe this just happened with my new ASI294MM-Pro in 1x1 binning mode.  I'll try to reproduce again, but I'm not sure I'll be using this camera tonight.
Comment 11 Jasem Mutlaq 2022-10-10 06:12:55 UTC
Please check against KStars 3.6.1 and report back.
Comment 12 MountainAirCA 2022-10-10 07:51:34 UTC
Unfortunately I don't believe I'll be able to conveniently test this, but in the more than year and a half since reporting the issue I'm sure others have had some experience with the issue.  Please close.