Hi,
first of all thanks for the nice work!
I have the following problem. When the shutter of my camera is closed, then gphoto2 --capture-preview works fine. When I call it a second time with an open shutter then the program hangs.
With the API I have a similar problem. If the shutter is closed before I start my program live view works fine (loop of capture_preview calls).
If I start the program with an open shutter it also hangs.
Here some debug info from gphoto2 --capture-preview --debug
0.138909 ptp_usb_sendreq (2): Sending PTP_OC 0x9201 (PTP_OC_NIKON_StartLiveView) request...
0.138916 gp_port_write (3): Writing 12 = 0xc bytes to port...
0.139015 gp_port_write (3): Wrote 12 = 0xc bytes to port: (hexdump of 12 bytes)
0000 0c 00 00 00 01 00 01 92-08 00 00 00 ............
0.139024 ptp_usb_getresp (2): Reading PTP_OC 0x9201 (PTP_OC_NIKON_StartLiveView) response...
0.139030 gp_port_read (3): Reading 1024 = 0x400 bytes from port...
0.139270 gp_port_read (3): Read 12 = 0xc out of 1024 bytes from port: (hexdump of 12 bytes)
0000 0c 00 00 00 03 00 19 20-08 00 00 00 ....... ....
0.139306 ptp_usb_getresp [usb.c:465] (0): PTP_OC 0x9201 receiving resp failed: PTP Device Busy (0x2019)
0.139315 ptp_usb_sendreq (2): Sending PTP_OC 0x90c8 (PTP_OC_NIKON_DeviceReady) request...
0.139320 gp_port_write (3): Writing 12 = 0xc bytes to port...
0.139517 gp_port_write (3): Wrote 12 = 0xc bytes to port: (hexdump of 12 bytes)
0000 0c 00 00 00 01 00 c8 90-09 00 00 00 ............
0.139526 ptp_usb_getresp (2): Reading PTP_OC 0x90c8 (PTP_OC_NIKON_DeviceReady) response...
0.139532 gp_port_read (3): Reading 1024 = 0x400 bytes from port...
0.139642 gp_port_read (3): Read 12 = 0xc out of 1024 bytes from port: (hexdump of 12 bytes)
0000 0c 00 00 00 03 00 01 20-09 00 00 00 ....... ....
0.159720 ptp_usb_sendreq (2): Sending PTP_OC 0x9203 (PTP_OC_NIKON_GetLiveViewImg) request...
0.159743 gp_port_write (3): Writing 12 = 0xc bytes to port...
0.159909 gp_port_write (3): Wrote 12 = 0xc bytes to port: (hexdump of 12 bytes)
0000 0c 00 00 00 01 00 03 92-0a 00 00 00 ............
0.159917 ptp_usb_getdata (2): Reading PTP_OC 0x9203 (PTP_OC_NIKON_GetLiveViewImg) data...
0.159920 gp_port_read (3): Reading 1024 = 0x400 bytes from port...
0.160275 gp_port_read (3): Read 12 = 0xc out of 1024 bytes from port: (hexdump of 12 bytes)
0000 0c 00 00 00 02 00 03 92-0a 00 00 00 ............
0.160286 ptp_usb_getresp (2): Reading PTP_OC 0x9203 (PTP_OC_NIKON_GetLiveViewImg) response...
0.160292 gp_port_read (3): Reading 1024 = 0x400 bytes from port...
0.160515 gp_port_read (3): Read 12 = 0xc out of 1024 bytes from port: (hexdump of 12 bytes)
0000 0c 00 00 00 03 00 0b a0-0a 00 00 00 ............
0.160527 ptp_usb_getresp [usb.c:465] (0): PTP_OC 0x9203 receiving resp failed: Not in Liveview (0xa00b)
0.160545 ptp_usb_sendreq (2): Sending PTP_OC 0x1016 (Set device property value) (0xd10b) request...
0.160551 gp_port_write (3): Writing 16 = 0x10 bytes to port...
0.160764 gp_port_write (3): Wrote 16 = 0x10 bytes to port: (hexdump of 16 bytes)
0000 10 00 00 00 01 00 16 10-0b 00 00 00 0b d1 00 00 ................
0.160772 ptp_usb_senddata (2): Sending PTP_OC 0x1016 (Set device property value) data...
0.160778 gp_port_write (3): Writing 13 = 0xd bytes to port...
0.160877 gp_port_write (3): Wrote 13 = 0xd bytes to port: (hexdump of 13 bytes)
0000 0d 00 00 00 02 00 16 10-0b 00 00 00 01 .............
0.160886 ptp_usb_getresp (2): Reading PTP_OC 0x1016 (Set device property value) response...
0.160891 gp_port_read (3): Reading 1024 = 0x400 bytes from port...
0.161254 gp_port_read (3): Read 12 = 0xc out of 1024 bytes from port: (hexdump of 12 bytes)
0000 0c 00 00 00 03 00 01 20-0b 00 00 00 ....... ....
0.161263 ptp_usb_sendreq (2): Sending PTP_OC 0x9201 (PTP_OC_NIKON_StartLiveView) request...
0.161269 gp_port_write (3): Writing 12 = 0xc bytes to port...
0.161383 gp_port_write (3): Wrote 12 = 0xc bytes to port: (hexdump of 12 bytes)
0000 0c 00 00 00 01 00 01 92-0c 00 00 00 ............
0.161392 ptp_usb_getresp (2): Reading PTP_OC 0x9201 (PTP_OC_NIKON_StartLiveView) response...
0.161397 gp_port_read (3): Reading 1024 = 0x400 bytes from port...
0.161514 gp_port_read (3): Read 12 = 0xc out of 1024 bytes from port: (hexdump of 12 bytes)
0000 0c 00 00 00 03 00 19 20-0c 00 00 00 ....... ....
0.161523 ptp_usb_getresp [usb.c:465] (0): PTP_OC 0x9201 receiving resp failed: PTP Device Busy (0x2019)
0.161531 ptp_usb_sendreq (2): Sending PTP_OC 0x90c8 (PTP_OC_NIKON_DeviceReady) request...
0.161534 gp_port_write (3): Writing 12 = 0xc bytes to port...
0.161632 gp_port_write (3): Wrote 12 = 0xc bytes to port: (hexdump of 12 bytes)
0000 0c 00 00 00 01 00 c8 90-0d 00 00 00 ............
0.161641 ptp_usb_getresp (2): Reading PTP_OC 0x90c8 (PTP_OC_NIKON_DeviceReady) response...
0.161646 gp_port_read (3): Reading 1024 = 0x400 bytes from port...
0.161770 gp_port_read (3): Read 12 = 0xc out of 1024 bytes from port: (hexdump of 12 bytes)
0000 0c 00 00 00 03 00 01 20-0d 00 00 00 ....... ....
0.182826 ptp_usb_sendreq (2): Sending PTP_OC 0x9203 (PTP_OC_NIKON_GetLiveViewImg) request...
0.182847 gp_port_write (3): Writing 12 = 0xc bytes to port...
0.183057 gp_port_write (3): Wrote 12 = 0xc bytes to port: (hexdump of 12 bytes)
0000 0c 00 00 00 01 00 03 92-0e 00 00 00 ............
0.183070 ptp_usb_getdata (2): Reading PTP_OC 0x9203 (PTP_OC_NIKON_GetLiveViewImg) data...
0.183076 gp_port_read (3): Reading 1024 = 0x400 bytes from port...
0.183394 gp_port_read (3): Read 12 = 0xc out of 1024 bytes from port: (hexdump of 12 bytes)
0000 0c 00 00 00 02 00 03 92-0e 00 00 00 ............
0.183404 ptp_usb_getresp (2): Reading PTP_OC 0x9203 (PTP_OC_NIKON_GetLiveViewImg) response...
0.183410 gp_port_read (3): Reading 1024 = 0x400 bytes from port...
0.183643 gp_port_read (3): Read 12 = 0xc out of 1024 bytes from port: (hexdump of 12 bytes)
0000 0c 00 00 00 03 00 0b a0-0e 00 00 00 ............
0.183655 ptp_usb_getresp [usb.c:465] (0): PTP_OC 0x9203 receiving resp failed: Not in Liveview (0xa00b)
0.183665 ptp_usb_sendreq (2): Sending PTP_OC 0x1016 (Set device property value) (0xd10b) request...
0.183671 gp_port_write (3): Writing 16 = 0x10 bytes to port...
0.183761 gp_port_write (3): Wrote 16 = 0x10 bytes to port: (hexdump of 16 bytes)
0000 10 00 00 00 01 00 16 10-0f 00 00 00 0b d1 00 00 ................
Thanks!