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…
Handler: Size: Captured: name:
0x00000028: 2298109 2017-01-01 08:22 R0010027.JPG

ptpcam --get-file=0x00000028
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.

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 => (0x00007ffc96bc6000) => /usr/local/lib/ (0x00007f57d2137000) => /lib/x86_64-linux-gnu/ (0x00007f57d1f2e000) => /lib/x86_64-linux-gnu/ (0x00007f57d1b64000)
/lib64/ (0x00007f57d234a000)

I appreciate any response in advance,

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

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!


Oh, nice way to start a Monday…!


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