gphoto / gphoto2

The gphoto2 commandline tool for accessing and controlling digital cameras.
GNU General Public License v2.0
718 stars 116 forks source link

Canon EOS 550D - Parallel captures are sometimes slow and can break PTP #568

Open mkstickx opened 1 year ago

mkstickx commented 1 year ago

We have the following setup:

Host: Raspberry Pi 4 Cameras: 2 x Canon EOS 550D Version: gphoto2 2.5.27 ( installed via apt)

We run capture and download on both cameras in parallel, triggered via a bash script. This takes somewhere between 4 seconds and up to >60 seconds. I assume there is some general timing issue / conflict with the USB going on here? Sometimes this seems to result in one camera basically "breaking", as far as i understand the PTP seems to be permanently stuck at some point.

No gvfs processes are running.

I was able to capture the point where one of the cameras stopped working. I piped the debug logs of booth cameras into one file as I hoped this might help with tracing the timing (sorry if this is actually just confusing). I also included (separate) logs for running the same command on the cameras after one of them stopped working.

logs.zip

I would be grateful for any pointers that might help me avoid this bug. Thanks in advance.

mkstickx commented 1 year ago

Further note: To some degree the described variations in time also happen if I run the captures in serial.

msmeissn commented 1 year ago

Usually two usb devices would not conflict, but they take bandwith from each other on the usb bus, so it might run into timeouts.

With the failing log you provided, the device does no react at all anymore, so it likely is in a inconsistent state, as we aborted.

(you can try a gphoto2 --port ... --reset , but it might not help to unstuck the camera)

can you try to capture the log where this happens (e.g. by rotating logfiles and getting the one where the error happens)?

mkstickx commented 1 year ago

So we installed gphoto2 build from git:

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

This somehow changed our problem:

In cases where the camera still behaves like mentioned above the (new) --reset flag seems to do the job. But now the new problem is that the cameras tend to completely stop communicating via USB after a some time. They are not listed via lsub and they only reappear after switching them off and on again.