ptpCam error "Events receiving error. Capture status unknown." issuing capture request

Greetings all,

I have a question regarding libptp and ptpcam’s capture request using both a Ricoh Theta S and a Ricoh Theta V. I have no problems seeing the device, querying for properties and the like. First off, here is the output I see:

ptpcam -c

Initiating captue…
Events receiving error. Capture status unknown.

ptpcam -L

Listing files…
Camera: RICOH THETA V
Handler: Size: Captured: name:
0x00000028: 2298109 2017-01-01 08:22 R0010027.JPG

ptpcam --get-file=0x00000028
Camera: RICOH THETA V
Saving file: “R0010027.JPG” is done.

The device does capture an image. However, lib ptp doesn’t see the event so it is hard to determine what the object handler that was created is and it always goes into a timeout. gphoto2 doesn’t have this issue with its capture-and-download command. So something is off with lib ptp or ptpcam rather.

When looking at the source and the function:
void capture_image (int busn, int devn, short force)

I traced it to the point of the call : ptp_usb_event_wait → ptp_usb_event and it returns an error when checking the packet length of the usbevent.

CHECK_INT(usbevent, PTP_USB_INT_PACKET_LEN);
if (result<0)
return PTP_ERROR_IO;

It will then return a PTP_ERROR_IO.

Has anyone managed to get this modified? My versions are as such:

ldd /usr/local/bin/ptpcam
linux-vdso.so.1 => (0x00007ffc96bc6000)
libptp2.so.1 => /usr/local/lib/libptp2.so.1 (0x00007f57d2137000)
libusb-0.1.so.4 => /lib/x86_64-linux-gnu/libusb-0.1.so.4 (0x00007f57d1f2e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f57d1b64000)
/lib64/ld-linux-x86-64.so.2 (0x00007f57d234a000)

I appreciate any response in advance,
Thanks

I received this information from a developer in the community.

checked the source code of the libptp2 and found an incorrect reading sequence of PTP event data.

Changing the definition of the PTP_USB_INT_PACKET_LEN

libptp (Picture Transfer Protocol lib) / Code / [r135] /trunk/src/ptp.h

to 28 will solve the problem.

1 Like

I can confirm! Using a packet length of 28 worked on my recompile and am now able to see the PTPContainer correctly filled: when calling ptp_usb_event_wait when doing an InitiateCapture with the Theta. Much appreciated!

Initiating capture …

dev 0 bus 0
Event received 00004002, ret=2001
Object added 0x00000043
Capture completed successfully!

2 Likes

Oh, nice way to start a Monday…!

2 Likes

@Jeston_Furqueron Were you able to make it work with RICOH Theta S as well ?