gphoto / gphoto2

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

tethering blocks shooting #134

Closed under-score closed 3 years ago

under-score commented 6 years ago

With some older Nikon D3 and the most recent gphoto2 I monitor the camera gphoto2 --capture-tethered Works nice but whenever I try to shoot in second terminal (from a webserver) gphoto2 --capture-image-and-download this command is blocked. It works when the camera is not being tethered. Bug, feature or any misunderstanding?

msmeissn commented 6 years ago

Misunderstanding I think ... The USB PTP implementation only allows single session operation, there is just 1 session going over the usb bus and you are trying to have 2.

what is supported is that you can run gphoto2 --capture-tethered

and then in the other thread run "kill -USR1 "

when the gphoto2 --capture-tethered process receives the USR1 signal it will take a picture.

under-score commented 6 years ago

thank you! When running kill -USR1 $PID it tells me "user defined signal 1:" and dies silently under OSX 10.7.5 without shooting. Maybe I need that as also other options like --keep-raw did not work here.

msmeissn commented 6 years ago

hmm, i was mistaken gphoto2 --capture-tethered does not handle -USR1

hmm, gphoto2 --capture-image-and-download -I -1 -F 1000 -1 for inerval means waiting for SIGUSR1 thjis will however not report the events inbetween.

this might need some improvements to the wait-event code, or your own code.

In libgphoto2/examples/sample-photobooth.c I hjave written such an example, with eventchceking loop and SIGUSR1 for triggering a capture.

under-score commented 6 years ago

Thank you so much. Unfortunately I cannot compile the sample code

sample-photobooth.c:224:9: error: duplicate case value 'GP_EVENT_FILE_ADDED'
                        case GP_EVENT_FILE_CHANGED:
                             ^
sample-photobooth.c:202:9: note: previous case defined here
                        case GP_EVENT_FILE_ADDED: {
msmeissn commented 6 years ago

very weird, these are distinct enum values and so this should not appear. :/ i dont see how this can happen...

under-score commented 5 years ago

any chance for an update here? I am still fiddling around here either with gphoto2 --capture-tethered or gphoto2 --capture-image-and-download

msmeissn commented 3 years ago

lost track of this, sorry :/ i hope either solved or worked around now