gphoto2 icon indicating copy to clipboard operation
gphoto2 copied to clipboard

gphoto2 --capture-image-and-download fails

Open gonzalobg opened this issue 2 years ago • 1 comments

Describe the bug

With a sony a5100 gphoto2 --capture-image-and-download used to work without any issues, but since updating to gphoto2 and libgphoto2 git versions I get:

*** Error ***
PTP Timeout

*** Error ***
An error occurred in the io-library ('Timeout reading from or writing to the port'): No error description available
ERROR: Could not capture image.
ERROR: Could not capture.

With movie capture I sometimes get:

Capturing preview frames as movie to 'movie.mjpg' for 1 seconds.
ERROR: Movie capture error... Exiting.
Movie capture finished (0 frames)

and sometimes the same PTP error as above.

Sony alpha 5100

Model                          Port
----------------------------------------------------------
Sony Alpha-A5100 (Control)     usb:001,024

Note: gphoto2 --summary sometimes produces the same error as above (PTP timeout), and it sometimes produces:

Camera summary:
Manufacturer: Sony Corporation
Model: ILCE-5100
  Version: 3.0
  Serial Number: 00000000000000003282763003786229
Vendor Extension ID: 0x11 (1.0)
Vendor Extension Description: Sony PTP Extensions

Capture Formats:
Display Formats: JPEG, Unknown(b301), ARW

Device Capabilities:
	File Download, No File Deletion, No File Upload
	No Image Capture, No Open Capture, Sony Capture

Storage Devices Summary:

Device Property Summary:
Compression Setting(0x5004):(readwrite) (type=0x2) Enumeration [1,2,3,16,19,32,35] value: 16
White Balance(0x5005):(readwrite) (type=0x4) Enumeration [2,4,32785,32784,6,32769,32770,32771,32772,32816,32786,32803] value: 0
F-Number(0x5007):(readwrite) (type=0x4) Range [0 - 65535, step 1] value: f/0 (0)
Focus Mode(0x500a):(readwrite) (type=0x4) Enumeration [1,2,3,32772,32773,32774,32775] value: 0
Exposure Metering Mode(0x500b):(readwrite) (type=0x4) Enumeration [4,1,32770] value: 0
Flash Mode(0x500c):(readwrite) (type=0x4) Enumeration [2,1,4,3,5,32769,32771,32817,32818] value: Undefined (0)
Exposure Program Mode(0x500e):(readwrite) (type=0x4) Enumeration [32768,32769,2,3,4,1,32848,32849,32850,32851,32852,32833,7,32785,32789,32788,32786,32787,32790,32791,32792] value: 32849
Exposure Bias Compensation(0x5010):(readwrite) (type=0x3) Enumeration [0,1,2,5000,4700,4500,4300,4000,3700,3500,3300,3000,2700,2500,2300,2000,1700,1500,1300,1000,700,500,300,-300,-500,-700,-1000,-1300,-1500,-1700,-2000,-2300,-2500,-2700,-3000,-3300,-3500,-3700,-4000,-4300,-4500,-4700,-5000] value: 0.0 stops (0)
Still Capture Mode(0x5013):(readwrite) (type=0x4) Enumeration [1,2,32786,32773,32772,32776,32777,33591,34103,33623,34135,33655,34167,33553,33569,33585,33590,34102,33622,34134,33654,34166,33552,33568,33584,32792,32808,32793,32809] value: Single Shot (1)
DOC Compensation(0xd200):(readwrite) (type=0x3) Enumeration [0,1,2,3000,2700,2500,2300,2000,1700,1500,1300,1000,700,500,300,-300,-500,-700,-1000,-1300,-1500,-1700,-2000,-2300,-2500,-2700,-3000] value: 0
DRangeOptimize(0xd201):(readwrite) (type=0x2) Enumeration [1,31,17,18,19,20,21] value: 0
Image size(0xd203):(readwrite) (type=0x2) Enumeration [4,14,15,5,6,7,16,17,18,8,19,9,10,11,20,21,12,23,24,13,1,2,3] value: 0
Shutter speed(0xd20d):(readwrite) (type=0x6) Range [0 - 4294967295, step 1] value: 0
Property 0xd20e:(readwrite) (type=0x2) Enumeration [1,2,3,8,9,10,4,5,6,7] value: 7
Color temperature(0xd20f):(readwrite) (type=0x4) Range [2500 - 9900, step 100] value: 0
CC Filter(0xd210):(readwrite) (type=0x2) Range [121 - 135, step 1] value: 128
AB Filter(0xd21c):(readwrite) (type=0x2) Range [121 - 135, step 1] value: 128
Aspect Ratio(0xd211):(readwrite) (type=0x2) Enumeration [1,2] value: 0
Focus status(0xd213):(readwrite) (type=0x2) Enumeration [1,2,3,5,6,7] value: 1
ISO(0xd21e):(readwrite) (type=0x6) Enumeration [16777215,25,100,125,160,200,250,320,400,500,640,800,1000,1250,1600,2000,2500,3200,4000,5000,6400,8000,10000,12800,16000,20000,25600,102400,16787216] value: 0
Picture Effect(0xd21b):(readwrite) (type=0x4) Enumeration [32768,32769,32770,32771,32772,32773,32784,32800,32801,32816,32832,32848,32849,32850,32851,32864] value: 32768
Property 0xd21d:(readwrite) (type=0x2) Range [0 - 2, step 1] value: 0
Property 0xd21f:(readwrite) (type=0x2) Enumeration [] value: 0
Property 0xd217:(readwrite) (type=0x2) Enumeration [2,1] value: 1
Battery Level(0xd218):(readwrite) (type=0x1) Range [-1 - 100, step 1] value: 90
Sensor Crop(0xd219):(readwrite) (type=0x2) Enumeration [2,1] value: 1
Property 0xd212:(readwrite) (type=0x2) Range [0 - 15, step 1] value: 0
Property 0xd221:(readwrite) (type=0x2) Enumeration [0,1,2] value: 0
Zoom(0xd214):(readwrite) (type=0x6) Range [0 - 4294967295, step 1] value: 4294967295
Objects in memory(0xd215):(readwrite) (type=0x4) Range [0 - 65535, step 1] value: 0
Property 0xd220: error 2002 on query.
Autofocus(0xd2c1):(readwrite) (type=0x4) Enumeration [1,2] value: 1
Capture(0xd2c2):(readwrite) (type=0x4) Enumeration [1,2] value: 1
Property 0xd2c3:(readwrite) (type=0x4) Enumeration [1,2] value: 1
Movie(0xd2c8):(readwrite) (type=0x4) Enumeration [1,2] value: 1
Property 0xd2c5:(readwrite) (type=0x4) Enumeration [1,2] value: 1
Still Image(0xd2c7):(readwrite) (type=0x4) Enumeration [1,2] value: 1

libgphoto2 and gphoto2 version output of: gphoto2 --version

gphoto2 2.5.28.1

Copyright (c) 2000-2021 Marcus Meissner and others

gphoto2 comes with NO WARRANTY, to the extent permitted by law. You may
redistribute copies of gphoto2 under the terms of the GNU General Public
License. For more information about these matters, see the files named COPYING.

This version of gphoto2 is using the following software versions and options:
gphoto2         2.5.28.1       gcc, popt(m), exif, no cdk, aa, jpeg, readline
libgphoto2      2.5.29.1       standard camlibs, gcc, no ltdl, EXIF
libgphoto2_port 0.12.0         iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi, gcc, no ltdl, EXIF, USB, serial without locking

To Reproduce Steps to reproduce the behavior:

If its a camera misbehavior, attach debug output using --debug --debug-logfile=debug.log (if considered useful).

https://gist.github.com/gonzalobg/ec6ebb6e00efc0602644c5a2dc9187de

gonzalobg avatar Mar 20 '22 10:03 gonzalobg

it reports ptp session not opened and then an out of sync ptp transaction id.

I think this probably is the gvfs gphoto2 tools already using your camera. you need to disable the gvfs gphoto2 tools.

ps auxw|grep gphoto2

to gvfs umount: gio mount -s gphoto2

ps auxw|grep gphoto2 -> should not show anything with both gvfs and gphoto in the name.

replugin camera (try ps again just for safety)

and then try gphoto stuff

msmeissn avatar Mar 20 '22 11:03 msmeissn