Closed thcipriani closed 2 months ago
Not sure if it is a similar issue, but a user reported failure with Sony DSC-A7r IV (Control) using:
gphoto2 --debug --debug-logfile=gphoto.txt --capture-image-and-download
With this relevant failure:
3.310606 camera_sony_capture [library.c:4936](0): 'ptp_generic_getdevicepropdesc (params, PTP_DPC_CompressionSetting, &dpd)' failed: PTP General Error (0x2002)
3.310620 gp_camera_capture [gphoto2-camera.c:1339](0): 'camera->functions->capture (camera, type, path, context)' failed: -1
ERROR: Could not capture image.
ERROR: Could not capture.
This is using latest libgphoto2 just compiled from master a couple of weeks ago. Full debug output attached.
@knro your problem looks slightly different. The line right before the debug lines you quoted seem to indicate that libgphoto2 can't find property 0x5004 which is most sony alpha cameras' CompressionSetting. So when the camera_sony_capture
function tries to grab the compression setting you get that.
My problem turns out to be not a bug, the A7riii just doesn't allow you to save an image to the camera only. It's described in the AlphaFairy docs:
The solution was to simply read out the buffer into nothingness.
Which is exactly what libgphoto2 does, so success(?)
I wish sony would let me save to the camera only in ptp mode :(
Thank you @thcipriani for the insight. So is the lack of CompressionSetting a fatal failure then? would it be possible to capture without relying on this setting somehow?
You can check out if there is a "capturetarget" setting. this would allow changing the capturetarget to the card on newer Sonys.
I think the A7C and AZR3a have it.
For the compression setting perhaps open a new issue.
You can check out if there is a "capturetarget" setting. this would allow changing the capturetarget to the card on newer Sonys.
I think the A7C and AZR3a have it.
There is a capturetarget
in the gphoto2 config for the a7riii and I have it set to the camera's card via gphoto2 --set-config capturetarget=1
and it persists when I do gphoto2 --get-config
BUT, on the camera itself, under "menu" → "setup4" → "PC Remote Settings" → "Still Image Save Destination" there are only two options "PC Only" and "PC+Camera"
Some models appear to have "Camera Only"; however, in my case (where that option does not appear) it seems I have to read out the camera buffer BEFORE the camera will write to the card :(
The sony a7riii in PC Control Mode can only take one image every two seconds. This is because writing to the memory card seems to requires the
ptp_getobject
function called fromcamera_wait_for_event
insidecamlibs/ptp2/library.c
.This means
gphoto2 --trigger-capture
triggers shutter release, but leaves the camera unable to perform any other commands untilgphoto2 --capture-image
is called (as it subsequently callsptp_getobject
). Capture image seems to be downloading all the images from the cameras sdram into my computer's memory (is that right?), so this limits how fast I can trigger photos.gphoto2 --trigger-capture --wait-event=FILEADDED
also works, but is just as slow.Details
Calling
gphoto2 --trigger-capture
triggers a shutter release, but then there's a memory card status indicator that shows 1 image writing to the memory card. Subsequent calls togphoto2 --trigger-capture
do nothing—they exit successfully without error, but no image capture is triggered, debug output for those calls looks fine—it's sending ptp commands to the camera successfully and thinks it's clicking the shutter.The only way I've found to flush the image from the buffer to the memory card is by calling:
gphoto2 --capture-image
(orgphoto2 --wait-event=FILEADDED
)—this downloads the image to the card without taking a new image (debug indicates it's clicking the shutter—but the camera isn't doing anything).The crux of this seems to be
ptp_getobject
function called fromcamera_wait_for_event
insidecamlibs/ptp2/library.c
—if I return fromcamera_wait_for_event
beforeptp_getobject
, the image is never flushed. If I return right after callingptp_getobject
: capture is written to the sdcard.I worked around this (a bit) by setting continuous release capture mode:
The camera lets you take a bunch of pictures, but then won't let you change camera settings or trigger another shutter release until it's done the camera→computer→camera dance.
Name the camera
libgphoto2 and gphoto2 version
I haven't been able to find any other reports of this issue, so I thought I'd at least document it. Or perhaps there's some setting somewhere I missed. Please let me know if more details are helpful.