Repository navigation
Conversation
Leaving tether mode only cleared flags and never joined the event thread, and live view could be orphaned the same way. Stop live view first while the event thread can still release the preview handshake, then join the event thread, drain leftover jobs, and use full gphoto destroy when a mounted camera disappears so the device is released.
Canon bodies often return 0x2019 while live view is opening and properties settle. Treating every PTP-tagged error as a dead connection forced a remount. Ignore Device Busy, block property combobox write-back when the camera itself pushed the change, and skip no-op property sets.
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
Leaving tether mode did not join the camera event or live-view threads, so teardown could race and leave the USB device claimed. Enabling live view on Canon (tested on EOS 7D Mark II and 1300D) could hit PTP Device Busy and be treated as a lost connection, forcing a remount. Tether leave now stops and joins those threads cleanly, unplug uses full gphoto teardown, and Device Busy during live view no longer kills the session; camera-driven property updates are not written back to the camera.
Checklist
git rebase --exec 'cmake --build build'master to check this.src/tests/integration/where the pixelpipe is touched, ordarktable-clias a headless smoke test._(), new preferences are registered indata/darktableconfig.xml.in.RELEASE_NOTES.mdentry was added (only needed if fixing an issue in a release). Do not reference GitHub issues.Test instructions
Manual tests with a tether-capable camera (Canon EOS 7D Mark II and 1300D
here),
darktable -d camctl.These are the checks that show the old behavior was wrong. A plain
enter/leave without live view often looks fine on master too — that is
not the regression.
A. Live view remount (Device Busy) — main user-visible break
tether bails even though frames may have started.
-d camctlmay logignoring transient PTP errorinstead of tearingthe session down.
B. Leave tether with live view still on — thread shutdown
LV off first.
LV only clears a flag).
disabling tether mode→Stopping live view→exiting camera thread→ unlock. No hang.C. Remount in the same session after tether
without restarting the app.
teardown / claimed device).
Smoke only (not a before/after proof): enter/leave tether with LV off.
That path often “works” on master; do not treat it as evidence the fix
is a no-op.
Not verified: non-Canon bodies; automated tests for this path.