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

Issue with Gphoto with multiple calls to camera #1038

Open
Yuvraj-Dhepe opened this issue Oct 9, 2024 · 1 comment
Open

Issue with Gphoto with multiple calls to camera #1038

Yuvraj-Dhepe opened this issue Oct 9, 2024 · 1 comment

Comments

@Yuvraj-Dhepe
Copy link

Yuvraj-Dhepe commented Oct 9, 2024

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

  • Execute the following bash script multiple times one after the other, and one should encounter that after around 10 to 12 clicks the gphoto2 will not be able to connect to the camera
ret=1
timeout=20
reps=1
port=$1
id=$2

while [ $ret -gt 0 ] && [ $reps -gt 0 ]; do
    env LANG=C timeout --signal=9 $timeout gphoto2 --debug --debug-logfile='/tmp/gphoto2_log.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 :
*** 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 <[email protected]>, 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
  • Extra Notes:

    • As soon as I plug out the usb of the camera and plug it back in, it starts working as normal again. Maybe the usb state is resetting in the camera or so.
    • I am saying camera because, when this error was thrown, unbinding and rebinding the port was tried on pi, however, after rebinding same timeout error was raised from above.
    • Another thing is reset of the usb port on the pi, this also didn't help
  • Few Questions:

    • Is there some mechanism, like in gphoto2 when such a time-out error is raised, it asks the camera to reconnect again or resets the camera so that it goes to the same state, as when I plug out the camera usb and plug it back again?
@Yuvraj-Dhepe
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant