Repository navigation
Integrate reviewed upstream work and manual-install packaging - #2
Merged
Merged
Conversation
This reverts commit 8d4a65f.
GetCaptureStatus and GetPreviewImage copy the frame out of the buffer the driver returns in ImageInfo, then drop the pointer on the floor. The driver allocates ImageData and MetaData with CoTaskMemAlloc and hands ownership to us - the usual COM convention, and the one this class already follows for the device-id list in GetDeviceIds - so nothing ever released them and every captured frame leaked its full size. Measured on an a7S (~12 MB ARW) driving NINA 3.3.0.1057 with driver 1.0.1.21: a session left running from 2026-09-15 to 2026-09-18 took 1770 frames over 71.6 hours and reached a 28 GB working set, ~16.2 MB per frame (image plus metadata). It ended when a 12 MB CoTaskMemAlloc inside the driver failed with E_OUTOFMEMORY (hr = 0x8007000e) during a flat sequence and took NINA down mid-exposure. The driver reported the failure because it was the next caller to ask for memory, but the allocation it could not satisfy was ours. Add FreeImageInfo and call it from a finally at all four sites that hand an ImageInfo to the driver. finally rather than a straight-line call because both image paths can throw after the driver has already allocated, and liveview runs GetPreviewImage many times a second. Freeing a null pointer is a no-op, so it is safe whatever the driver populated. Verified on the same rig: 154 full-size frames in 9.4 minutes, where the old build would have grown ~2.44 GB, and memory stayed bounded at ~1.4 GB with no driver errors and no crash dump.
Keep native abort opt-in, reject busy starts, and prevent delayed aborts from cancelling newer captures. Report cancelled and failed captures without downloading stale images. Add 27 capture regression tests, CI checks, and hardware validation notes.
Inject camera communication so the production plugin can run without SonyMTPCamera.dll or hardware. Keep simulation opt-in and share the backend between NINA discovery and automated tests. Exercise timing, failures, profile settings, cancellation, and image routing with a manual clock and actual plugin integration tests.
# Conflicts: # .github/workflows/dotnet.yml # Drivers/CameraDriver.cs
Integrate the shutter readback, manual ISO, native serialization, image consumption, DLL version and focuser improvements proposed in dougforpres#13, while retaining the current capture controller and native image buffer cleanup. Defer automatic USB reconnect, retrying timed-out native workers, and forced busy-capture cancellation. Add regression tests for readout cancellation, timeout exclusion, shutter application and combined RAW temperature reporting. Co-authored-by: Robert Hasson <robert_hasson@yahoo.com>
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.
Summary
All work from this PR is included in the combined 1.0.0.5 release. Original commits and contributor credits are preserved. Current installation instructions.
Record the initial community integration at
413290f, maintaining @dougforpres’s Sony camera plugin in this fork while shared upstream maintenance is being discussed. Preserve original commits, copyright notices, MPL-2.0, and contributor credit.Native timeouts remain blocked until NINA restarts; native cancellation stays opt-in and never interrupts readout/processing. Experimental USB reconnection, retries into a still-running timed-out driver, and forced busy-capture cancellation are deferred. Closed video WIP dougforpres#12 is not included.
Full source links, review findings and issue coverage: upstream review. Installation and rollback replace the existing DLL rather than loading duplicate plugins. Support and release links point to this fork.
Evidence
After: 98 Windows tests pass (59 capture/simulator/native-call/shutter, 24 temperature metadata, 15 actual-plugin integration). Windows CI builds and packages the Release plugin. ZIP/DLL SHA-256 checksums and package contents were independently verified; the plugin and Windows integration project also cross-build on Linux.
Merge Danger
Door: two-way
Manual users can restore their backed-up upstream DLL. The plugin identifier and original copyright notice are retained. This PR does not change NINA’s central plugin catalog or close upstream issues/PRs.
Blast Radius: equipment
Changes affect direct Sony camera capture, aborts, temperature, ISO selection and lens focuser calls. The community release retains explicit validation limits.