Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Canon Mirror Lockup property writable #913

Closed
anjok opened this issue Jun 17, 2023 · 10 comments
Closed

Make Canon Mirror Lockup property writable #913

anjok opened this issue Jun 17, 2023 · 10 comments
Assignees
Labels
Canon tagging canon reports

Comments

@anjok
Copy link

anjok commented Jun 17, 2023

I want to be able to toggle mirror lock for my Canon 6D.

Apparently the customfuncex solution to toggle the lock doesn't work for it.

https://github.com/gphoto/libgphoto2/blob/master/camlibs/ptp2/canon-eos-customfunc.txt

Instead I found this in the debug logs:

ptp (2): event 3: EOS prop d1bf (EOS_MirrorLockupState) info record, datasize is 4
ptp (2): event 3: Unknown EOS property d1bf, datasize is 4
ptp (2): 0: 01 << currently ON, and this one toggles
ptp (2): 1: 00
ptp (2): 2: 00
ptp (2): 3: 00

Unfortunately this property is not writable. it's not in the --list-all-configs and thus can't be used.

Is there a way to make this property writable? Or are the writable props determined by the cam?

@msmeissn
Copy link
Contributor

this is a reporting variable only, setting it will not be possible (although I have not tried).

The customfuncs are specific for each camera and are even less documented than the other codes.

unless we reverse engineer or USB sniff this more we are out of luck.

@anjok
Copy link
Author

anjok commented Jun 18, 2023

Thanks for the reply and the quick PR! I added a comment regarding the label which I think is wrong.

Are there any docs on what makes a property writable? Does the cam report it or how does this work?

And this is not about the customfuncex, which works fine for the 450D, but rather the "EOS prop d1bf (EOS_MirrorLockupState) info record" which seems to have replaced it on the 6D.

I just saw another property 0xd406 which seems to be setable in the "other" section of the indilib driver, so I thought you "just" need to add a setter for 0xd1bf, too.

I'm mentioning it because it's literally named "d406" in the indi window:

image

@anjok
Copy link
Author

anjok commented Jun 18, 2023

And it's setable in EOS Utility 2, so if you tell me how to debug this it can be done:

image

@anjok
Copy link
Author

anjok commented Jun 19, 2023

Here's the 2 log files for ON and OFF state set up in the Canon LCD in the hope they help:

logs.zip

I commented here:

50338bd

For both EOS_MirrorLockupState and EOS_MirrorUpSetting I got "01" values when I enable Mirror lock in the UI and do --get-config and "00" when I disable it. So I'm not sure which one it is, but "Mirror Up Status" is not PTP_DPC_CANON_EOS_MirrorLockupState.

msmeissn added a commit that referenced this issue Jun 20, 2023
hook up 2 other EOS mirror props into config tree.
#913
@msmeissn
Copy link
Contributor

ptp (2): event 227: EOS prop d13a (EOS_MirrorUpSetting) desc record, datasize 8, propxtype 3

this seems settable.

I hooked it up now as "mirrorup" , you can try to set it

@anjok
Copy link
Author

anjok commented Jun 20, 2023

This works great, thanks a lot! I can toggle the lock flag from indi and that's great, as I really can't access the LCD.

A few things though:

  1. I don't know if there are other cams with that sort of setting (probably yes), but something like mirrorlock would make more sense?

  2. The other new flags appear as writable, see below, but I don't know if that makes sense. They should probably have _put_None? Or even remove them, as they appear to be unclear on what they do:

/main/status/mirrorup -> should be mirrorlock or something
/main/status/mirrorlockstatus -> dunno?
/main/status/mirrordownstatus -> dunno? probably temp status of the mirror
  1. is there some doc on how to sanely install the dev version on the raspberry pi? I'm using

wget https://raw.githubusercontent.com/gonzalo/gphoto2-updater/master/gphoto2-updater.sh && chmod +x gphoto2-updater.sh && sudo ./gphoto2-updater.sh

but that puts stuff in /usr/local and I have to sudo apt-get remove gphoto2 and sudo rm -Rf /usr/lib/arm-linux-gnueabihf/libgphoto* for this to work

image

@msmeissn
Copy link
Contributor

i renamed it to mirrorlock.

i add put_None to the others.

@msmeissn
Copy link
Contributor

commit f418c5d

@anjok
Copy link
Author

anjok commented Jun 21, 2023

Works great, I didn't even have to recompile the indi driver. So thanks again!

image

@anjok
Copy link
Author

anjok commented Jun 22, 2023

Closing as fixed

clrpackages pushed a commit to clearlinux-pkgs/libgphoto2 that referenced this issue Sep 28, 2023
…on 2.5.31

Antonio Ceballos Roa (1):
      updated spanish

Ben Govero (6):
      merged some canon eos pieces from https://github.com/NorthOfYou/libgphoto2
      Nikon put_viewfinder down should do a busy check
      merge over new Sony compression, jpeg quality, save format, save size
      Added Nikon AF-F focus mode value
      Added the 1dx mark ii image format choices
      Added special imageformat handling for the 1DX iii

Daniel (1):
      Fix SHUTTER_SPEED_1_6_SEC (#877)

Daniel Schulte (1):
      camlibs/ptp2: Add support for Panasonic cameras in camera_trigger_capture (#822)

Dmitry D. Chernov (1):
      Fix empty PTP strings not being null-terminated in parse_9301_value() (#830)

Ed Maste (1):
      Update CI FreeBSD image to latest supported release (#915)

Fabio T (1):
      added friulian translation

Gergely Erdélyi (1):
      Add support for Fujifilm X-H2 (#861)

Hans Ulrich Niedermann (23):
      camlib build var cleanup
      gh workflow: actually upgrade the system
      gh workflow: work around libgd-dev dependency problem
      gh workflow: remove apt-get dist-upgrade
      Use LIBGD_* with $(...) instead of @...@
      Use LIBWS232_* with $(...) instead of @...@
      bs: forbid unexapanded LT_ macros in configure
      Find working URL for "Writing shared libraries"
      "Writing shared libraries" URL is available again
      Using _LDFLAGS for libs is wrong, use _LDADD
      Use per-program "noinst_PROGRAMS +=" line
      gh workflow: Update to actions/checkout@v3
      Define main function as "int main(void)" (with void)
      ci: Update indentation and quote names
      ci: Add global LC_ALL and COMMON_CONFIGURE_FLAGS
      ci: Prepare for portable concurrent make
      ci: Update step names
      ci: Prepare for OS specific build flags
      ci: Rename CI build
      ci: Add comment pointing to actionlint
      ci: Add CI build for macOS
      ci: Add Cirrus CI build for FreeBSD
      SECURITY.md: Link to Github private vulnerability reporting

Ingvar Stepanyan (7):
      Fix `GP_UNKNOWN_EVENT` leaks in examples (#833)
      Remove printf leftover (#836)
      Zero-fill CameraFileInfo (#838)
      Fix couple of leaks in virtual camera (#839)
      Allow customizing vcamera directory at runtime (#840)
      Unify & fix file reading in vcamera (#841)
      Fix building virtual camera on macOS (#843)

Kris Slyka (1):
      Fix camera crash caused by digigr8 camlib

Laurent Clévy (1):
      Create canon-eos-discovery.md (#884)

Li kunyu (3):
      Optimize some code statements (#844)
      docupen: Remove redundant semicolons
      serial: Add check after malloc allocation (#878)

Marcus Meissner (121):
      2.5.30.1 development snapshot
      added eos 850d alias
      from gphoto/libgphoto2#792
      added nikon z30
      use the same flags for the 1500D and 2000D, fixes gphoto/libgphoto2#812
      added pentax kp in ptp mode
      olc info ver instead of curoff in check§
      added a "testolc" option to help with EOS OLC size detection
      fix bitmask
      statred to work on new olcsize handling
      merged the v11 olc info we have in 1 github issue
      more debugging output in olc code
      added m6 mark 2 entry, also added powershot sx720hs entry, and some notes on eos 750d/eos 5ds
      note that m10 is also type 8
      updates for EOS 100D
      fixed a too small loop bound value. fixes gphoto/libgphoto2#820
      fixed incorrect size to printf , fixes https://github.com/gphoto/libgphoto2/security/code-scanning/27
      fixes gphoto/libgphoto2#821.
      added olc infos
      extra dist for the olc info document
      added EOS R10
      added eos r5 c
      report only fstype, not fsname ... otherwise might like pths or UUIDs in logfiles
      added another trace to EOS R
      fixed the non-fuzz camera detection in vusb
      fixed an endless loop due to the DCIM being a '' name
      Rewrite the OLC handling logic to be table driven, as we now have too many choices.
      init position_new as an exit condition
      added canon eos r7 gphoto/libgphoto2#832
      added eos r7 debug
      report storereadonly instead of generalerror, as generalerror is ignored in our ptp stack.
      repotr PTP_RC_StoreNotAvailable during capture if we have no image
      remove duplicate code, add some comments
      use the correct error handling method (C_PTP instead of CR)
      remove noisy warning in non-fuzz mode. fixes gphoto/libgphoto2#842
      some Canons have an enum from 0-3 for the battery level instead of going from 0 to 100.
      Hide all the fuzzing code behind a ifdef FUZZING
      filter out more commands on the Nikon S1. gphoto/libgphoto2#845
      use a local PTP event queue in nikon capture to avoid checking interrupts on any event,
      free storedevents after use
      added NEWS
      Wrap unsafe libltdl calls with locking (#848)
      always build gpi_vsnprintf, as we use it unconditionally in libgphoto2
      add a --disable-debug test too
      try to fix 4 codeql warnings
      fix some CodeQL warnings
      try to fix codeql integer expansion warning
      fixed missing arguments in 2 debug functions, spotted by codeql
      convert malloc (overflowing mult) to calloc(x,y) that handles this internally
      convert a malloc(w*h) to calloc(w,h) to avoid overflow issues, found by codeql
      sony manual focus is actually INT16, not UINT16. gphoto/libgphoto2#793
      added gopro hero11 black
      nikon z6 2 workaround, it reports a devicepropchanged 0x501c event, but the property is not avauilable
      added some more z6-2 debug
      if we fail to spot a direction, use single stepping instead.
      added sigma fp l
      fixed 2.5.30.1 dev entry
      updated NEWS to current state
      added canon eos r6 2
      name it R6m2
      canon eos: if half press succeeds, and full press fails, roll back half-press again
      fix WSACleanup condition
      added a missing return code check for ptp_fuji_getdeviceinfo (Coverity)
      fixed ptp_debug parameters (Coverity)
      make it clear we only use 32bit of time_t (Coverity)
      use unsigned long for time_t usage (Coverity)
      avoid uninitialized variable when setting non standard values (Coverity)
      switch debug print of a time_t based variable to long int (Coverity)
      handle time_t as long (Coverity)
      added x-t5
      aded z30 dsate
      fixed one superflous argument to debug (Coverity)
      added some apparent missijng include unistd.h to make it build for mingw/llvm . fixes gphoto/libgphoto2#890
      break out of the setter loop if we reached the correct state
      remove incorrect superflous exit code. is handled below
      mark when the put function already set the value in the camera,
      added sony ilce-1 , gphoto/libgphoto2#892
      use uint32_t instead of unsigned int
      added Ricoh GR IIIx
      make it default fuzz ptp ... so --enable-vusb will give us a camera
      synthesize a capturecomplete event for panasonic cameras, as they dont send on on their own
      allow trigger capture for panasonic
      disable checking on the 0x80 flag as success, mightz not be correct
      more debug in ptp_sigma_fp_getcapturestatus
      added ILCE-7M3 to the sony wait logic.
      added sonly ilce 7m3 debug
      decoce mirrorlock up state for EOS, as mirrorstatus for config. gphoto/libgphoto2#913
      allow writing to mirrorup state
      decode 1 more EOS mirror prop as uitn32.
      renamed mirrorupstatus to mirrorup on EOS; it seems this is the settable option
      rename mirrorup -> mirrorlock, disable writeability of status props
      added PTP_DPC_CANON_EOS_StroboDispState with 32bit
      also decode EOS_LvCFilterKind as 32bit
      added somre more uint32 ones
      aded gopro hero11 black mini
      also adjust liveview size to be 32bit
      added nikon z8
      decode nikon autoiso
      fixed liveview size being 32bit now
      enable OLYMPUS OM-1 for capture
      also allow OMSYSTEM as OLYMPUS equivalent
      updatgd news
      on newer EOS, OLC shutterspeed is at byte offset 7
      merge over some knowledge from git@github.com:NorthOfYou/libgphoto2.git on newer sony cameras
      mark some more props as uint32 for now
      fix typo
      moved to other section
      merged from libmtp
      another mtp id
      updated
      year is 2023
      add sony mode 300 detection and initialization (from NorthOfYou fork)
      added georgian
      added friulian
      added sony a7s mark 3 aka ILCE-7SM3
      increment the wait for the new sony to 3 seconds again. better debuggin
      updated NEWS
      disable uuilock/unlocking around pcchdd capacity setting.
      do not uilock around pcchdcpacity, as this breaks EOS 2000D/1500D for some reason
      synced music-plaers.h from libmtp
      2.5.31 release

Mark Watson (3):
      Add 2 new settings metadata for Sony A7R3 (#872)
      Only format log messages when a log function is registered for given log level. (#871)
      Add properties to control Sony focus assist magnification, useful for remotely dialing in focus using live view / preview. (#883)

Omri Sarig (1):
      Fix pointer issues in local PTP event queue in Nikon capture (#849)

Ryan Heimbuch (1):
      added fuji focuspoints, focuspoint and zoompos values

Sebastian Rasmussen (2):
      updated svensk
      updated swedish

Temuri Doghonadze (2):
      added georgian translation
      added georgian

paolodepetrillo (1):
      Fix string overflow in camera_summary (#910)
icheered pushed a commit to icheered/libgphoto2-testing that referenced this issue Oct 9, 2023
icheered pushed a commit to icheered/libgphoto2-testing that referenced this issue Oct 9, 2023
hook up 2 other EOS mirror props into config tree.
gphoto#913
icheered pushed a commit to icheered/libgphoto2-testing that referenced this issue Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Canon tagging canon reports
Projects
None yet
Development

No branches or pull requests

2 participants