Bug 392974 - Ekos focuser taking multiple exposures (locking issue?)
Summary: Ekos focuser taking multiple exposures (locking issue?)
Status: RESOLVED WORKSFORME
Alias: None
Product: kstars
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Jasem Mutlaq
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-10 18:28 UTC by James Lancaster
Modified: 2021-10-13 04:35 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Lancaster 2018-04-10 18:28:40 UTC
In Ekos, I use a D5300, a compiled INDI, and OnStep. 

I do sometimes get issues where, when trying to autofocus, it results in multiple requests being issued, rapidly. My guess is this is a threading issue. Usually, it works, but sometimes, I get sequences like the following. Sometimes it's 2-3 images, sometimes, it's a whole screen in small font of them. Usually it's just 1 image. If I wait for it to finish the images, it will continue. 

Example Logs below. (More can be provided, but I had debugging on the whole night, so that file is... not tiny. I don't think this was one where I let it go  on to complete the images.) 

It's possible that the focuserInterface code, is having an impact, but I don't find it likely. 

My guess is that it's related to void Focus::capture(), and the time period between the check for 
    if (captureInProgress)
and setting 
    captureInProgress = true;

However, for that to happen, something would need to be calling capture repeatedly, quickly. I don't immediately see in focus.cpp any place that does that. 

I'm happy to do particular testing. Just let me know. I'll probably look at this more outside of KDE bug tracking. 

From one of my logs (non ekos positions trimmed): 
[2018-04-06T03:17:03.644 CDT DEBG ][     org.kde.kstars.ekos.focus] - Focus newFITS # 1 : Current HFR  1.73739
[2018-04-06T03:17:03.680 CDT DEBG ][     org.kde.kstars.ekos.focus] - ========================================
[2018-04-06T03:17:03.680 CDT DEBG ][     org.kde.kstars.ekos.focus] - Current HFR:  1.73739  Current Position:  268
[2018-04-06T03:17:03.680 CDT DEBG ][     org.kde.kstars.ekos.focus] - Last minHFR:  1.65469  Last MinHFR Pos:  295
[2018-04-06T03:17:03.680 CDT DEBG ][     org.kde.kstars.ekos.focus] - Delta:  "8.27" %
[2018-04-06T03:17:03.680 CDT DEBG ][     org.kde.kstars.ekos.focus] - ========================================
[2018-04-06T03:17:03.680 CDT INFO ][     org.kde.kstars.ekos.focus] - "FITS received. HFR 1.74 @ 268. Delta (8.27%)"
[2018-04-06T03:17:03.683 CDT DEBG ][     org.kde.kstars.ekos.focus] - Setting initial slop to  231  @ HFR  1.7744
[2018-04-06T03:17:03.683 CDT DEBG ][     org.kde.kstars.ekos.focus] - Using slope to calculate target pulse...
[2018-04-06T03:17:03.683 CDT DEBG ][     org.kde.kstars.ekos.focus] - V-Curve Slope  -0.00100039  current Position  268  targetPosition  1136.36
[2018-04-06T03:17:03.683 CDT DEBG ][     org.kde.kstars.ekos.focus] - Limiting target pulse to focus out limit  332
[2018-04-06T03:17:03.683 CDT DEBG ][     org.kde.kstars.ekos.focus] - delta (targetPosition - currentPosition)  64
[2018-04-06T03:17:03.683 CDT DEBG ][     org.kde.kstars.ekos.focus] - Focusing  OUT
[2018-04-06T03:17:03.683 CDT DEBG ][     org.kde.kstars.ekos.focus] - Focus out ( 64 )
[2018-04-06T03:17:03.683 CDT INFO ][     org.kde.kstars.ekos.focus] - "Focusing outward by 64 steps..."
...
[2018-04-06T03:17:03.727 CDT INFO ][     org.kde.kstars.ekos.focus] - "Capturing image..."
[2018-04-06T03:17:03.728 CDT INFO ][     org.kde.kstars.ekos.focus] - "Capturing image..."
[2018-04-06T03:17:03.729 CDT INFO ][     org.kde.kstars.ekos.focus] - "Capturing image..."
[2018-04-06T03:17:03.729 CDT INFO ][     org.kde.kstars.ekos.focus] - "Capturing image..."
[2018-04-06T03:17:03.732 CDT INFO ][     org.kde.kstars.ekos.focus] - "Capturing image..."
[2018-04-06T03:17:03.733 CDT INFO ][     org.kde.kstars.ekos.focus] - "Capturing image..."
...
[2018-04-06T03:17:12.711 CDT INFO ][     org.kde.kstars.ekos.focus] - "Image received."
Comment 1 James Lancaster 2018-04-10 18:33:29 UTC
Just to note, these are from the Ubuntu ppa, with a git compiled INDI. On Ubuntu 17.10. 

(For dependency reasons, namely not having to compile kstars, INDI has been sometimes removed manually and installed clean from git a few times, but usually is just replaced with a make install from git. I don't think this affects this bug, but in the interests of making sure there's nothing left out.)
Comment 2 Jasem Mutlaq 2018-04-10 18:34:20 UTC
Is this with KStars 2.9.4?
Comment 3 James Lancaster 2018-04-11 00:23:40 UTC
Looking at the log, that was with 2.9.3 from the ppa. 

Based on looking at github, where the version bump was, it may already be fixed in this commit, and why it seemed puzzling to me, when I pulled down code ( https://github.com/KDE/kstars/commit/a4dca1023395d32726190ae1fb290232b6ea59b0#diff-f39341be36342731dcb803d6f568f236 )

I've updated since then, I'll see if it happens tonight with 2.9.4 build (2018-04-08T14:20:48Z)
Comment 4 James Lancaster 2018-04-11 20:26:30 UTC
With 2.9.4, the change did work, so I didn't see any multiple attempts last night. 

I do have a lot of calls which would have resulted in it. 

2018-04-10/log_20-44-26.txt:[2018-04-10T20:52:16.293 CDT WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
2018-04-10/log_20-44-26.txt:[2018-04-10T20:52:16.293 CDT WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
2018-04-10/log_20-44-26.txt:[2018-04-10T20:52:16.293 CDT WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
2018-04-10/log_20-44-26.txt:[2018-04-10T20:52:16.293 CDT WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
2018-04-10/log_20-44-26.txt:[2018-04-10T20:52:16.293 CDT WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
2018-04-10/log_20-44-26.txt:[2018-04-10T20:52:16.293 CDT WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
2018-04-10/log_20-44-26.txt:[2018-04-10T20:52:16.293 CDT WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
2018-04-10/log_20-44-26.txt:[2018-04-10T20:52:16.293 CDT WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
2018-04-10/log_20-44-26.txt:[2018-04-10T20:52:16.293 CDT WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
2018-04-10/log_20-44-26.txt:[2018-04-10T20:52:16.293 CDT WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
2018-04-10/log_20-44-26.txt:[2018-04-10T20:52:16.293 CDT WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
2018-04-10/log_20-44-26.txt:[2018-04-10T20:52:16.294 CDT WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
2018-04-10/log_20-44-26.txt:[2018-04-10T20:52:16.294 CDT WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
2018-04-10/log_20-44-26.txt:[2018-04-10T20:52:16.294 CDT WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
Comment 5 Jasem Mutlaq 2018-04-11 20:37:01 UTC
What's the selected focuser?
Comment 6 James Lancaster 2018-04-11 22:29:27 UTC
OnStep using a FocuserInterface which isn't in INDI's github yet.
Comment 7 Jasem Mutlaq 2018-04-11 22:32:54 UTC
Ok, then in needs to be corrected as it is ONLY supposed to send focus position _if_ it changed. But it looks like it is sending it all the time.
Comment 8 Jasem Mutlaq 2021-09-13 08:05:28 UTC
Please check if this issue is reproducible in KStars v3.5.4
Comment 9 Bug Janitor Service 2021-09-28 04:35:50 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 Bug Janitor Service 2021-10-13 04:35:40 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!