gphoto / libgphoto2

The libgphoto2 camera access and control library.
GNU Lesser General Public License v2.1
1.03k stars 324 forks source link

Issue with Gphoto with multiple calls to camera #1038

Open Yuvraj-Dhepe opened 5 days ago

Yuvraj-Dhepe commented 5 days ago

Describe the bug I am using a raspberry pi, with ubuntu in which gphoto is being used. The issue is when calling the camera capture command simultaneously, the gphotos stops communicating with the camera, even if it's visible via lsusb. I am using Sony alpha 6100 ILCE-6100L camera.

Name the camera

Model                          Port                                            
----------------------------------------------------------
USB PTP Class Camera           usb:001,007     

libgphoto2 and gphoto2 version

gphoto2 2.5.27

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.27         gcc, popt(m), exif, cdk, aa, jpeg, readline
libgphoto2      2.5.27         standard camlibs, gcc, ltdl, EXIF
libgphoto2_port 0.12.0         iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi, gcc, ltdl, EXIF, USB, serial without locking

To Reproduce

while [ $ret -gt 0 ] && [ $reps -gt 0 ]; do env LANG=C timeout --signal=9 $timeout gphoto2 --debug --debug-logfile='/tmp/gphoto2log.txt' --trigger-capture --wait-event-and-download=FILEADDED --filename="/home/pi/qocoa-photobox/photos/%Y-%m-%d-%H-%M-%S%f${id}.%C" --port=$port

ret=$?
reps=$(($reps-1))

# Check if the process was killed
if [ $ret -eq 137 ]; then
    echo "Process killed with SIGKILL (signal 9)."
    exit 1  # Exit with an error code for killed process
fi

if [ $ret -gt 0 ]; then
    echo "Repetitions left: $reps"
fi

done


- The error that got raised :
```bash                                                                              
*** Error ***              
PTP Timeout

*** Error ***              
An error occurred in the io-library ('Timeout reading from or writing to the port'): The supplied vendor or product id (0x0,0x0) is not valid.
*** Error (-10: 'Timeout reading from or writing to the port') ***       

For debugging messages, please use the --debug option.
Debugging messages may help finding a solution to your problem.
If you intend to send any error or debug messages to the gphoto
developer mailing list <gphoto-devel@lists.sourceforge.net>, please run
gphoto2 as follows:

    env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --port usb:001,003 --summary

Please make sure there is sufficient quoting around the arguments
Yuvraj-Dhepe commented 5 days ago

Also note the bash killing of timeout is an external killing of whole gphotos, but the internal timeout that happens in the error is something not set by me