Repository navigation
Andor: hold one SDK lock across camera selection and SDK calls (slicecam L frame showing R's image) - #493
Open
cfremling wants to merge 1 commit into
Open
Andor: hold one SDK lock across camera selection and SDK calls (slicecam L frame showing R's image)#493cfremling wants to merge 1 commit into
cfremling wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
cfremling
added a commit
that referenced
this pull request
Oct 28, 2026
Reverts e5953dd (BGSUB), 722c8f1 (DATASEC median subtraction) and 044b658 (Andor SDK lock). CF 2026-10-28: see what the slicecam frames look like on main's code. The subtraction did not level L: L's DATASEC starts well left of its illuminated columns, so its median is not L's lit level. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cfremling
force-pushed
the
fix/andor-sdk-camera-race
branch
from
October 28, 2026 19:15
c8d391a to
6fedcbf
Compare
6 tasks
Collaborator
Author
|
Tested on sky 2026-10-28/29 UT using branch cf/summit-20261020: the Andor lock ran from 18:20 UT, 0 swapped L/R frames in a 30-minute watch of /tmp/slicecam.fits (193 frames, temperature polls every 60 s) and none seen by the observers through the night; the sky-level display subtraction ran from 19:21 UT and the observers judged it good on the night sky. |
The Andor SDK has one current camera per process. acquire_one() selected its camera only when starting the exposure, then waited (WaitForAcquisitionTimeOut) and read (GetAcquiredData16) on whatever camera was current seconds later. slicecamd's 60 s temperature thread selects L then R; when it ran during L's exposure, L's wait returned at once and L read R's last frame, so the slicecam L image (also used by fine acquisition) showed R's. - Interface::sdk_mtx (static, recursive) is held from select_camera() through the SDK calls in every method, and never while taking image_data_mutex. - acquire_one(): start under the lock, wait by handle without it, then select and read the data and temperature under it. - wait_for_acquisition() and get_image_data() no longer select a camera. - close() selects its camera before ShutDown(); open() and set_image() release the lock around image_data_mutex. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cfremling
force-pushed
the
fix/andor-sdk-camera-race
branch
from
November 5, 2026 18:55
6fedcbf to
8df99d5
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Andor SDK has one current camera per process.
acquire_one()selected its camera only when starting the exposure, then waited (WaitForAcquisitionTimeOut) and read (GetAcquiredData16) on whatever camera was current seconds later. slicecamd's 60 s temperature thread selects L then R; when it ran during L's exposure, L's wait returned at once and L read R's last frame, so the slicecam L image showed R's. Fine acquisition centroids on that same image.Interface::sdk_mtx(static, recursive) is held fromselect_camera()through the SDK calls in every method, and never while takingimage_data_mutex.acquire_one(): start under the lock, wait by handle (WaitForAcquisitionByHandleTimeOut) without it, then select and read the data and temperature under it.wait_for_acquisition()andget_image_data()no longer select a camera.close()selects its camera beforeShutDown();open()andset_image()release the lock aroundimage_data_mutex.The display-level change (sky level subtracted from the displayed image, BGSUB) is now #512.
Rebuild, restart slicecamd and acamd. Tested on sky using branch cf/summit-20261020 on 2026-10-28/29 (no swapped frame in a 30-minute watch of 193 frames, none seen all night) and using branch cf/summit-20261030 on 2026-11-03.
Jira: PAL-178.
🤖 Generated with Claude Code