gphoto library image capturing delay problem and analysis

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

gphoto library image capturing delay problem and analysis

Jianming
Hi Dev,

 From the mailing list, I can see many people had similar image capture
delay problem but it wasn't solved.

So here is the problem.

libgphoto2 version 2.5.4 (latest so far)
Camera, Nikon D5100, shutter speed 1/25.

I'm shooting an object that is driven by a motor that rotates 3 seconds
then pause for 10 seconds, so I have to take shots with an fixed time
interval 13 seconds during the pause to make sure I can capture all the
status of this object. However I found that the image capturing can not
synchronize to the motor pauses, because there's  an accumulated delay
on gp_camera_capture function, like, the first shot takes 1.6 seconds,
then the 38th takes around 12.4 seconds to finish. The problem is I have
more than 100 image to get, that means around a 30 seconds delay will
happen, so it is impossible to synchronize the motor. I present an graph
of 3 tests to show you the delay.

So I'm here to ask to to make sure I can synchronize the camera and motor ?
BTW, formatting the camera card doesn't work, delay remains.

cheers,
Tom



------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user

line_graph.jpg (33K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [gphoto-devel] gphoto library image capturing delay problem and analysis

Marcus Meissner
On Wed, Jul 02, 2014 at 05:14:32PM +0800, Jianming wrote:

> Hi Dev,
>
> From the mailing list, I can see many people had similar image
> capture delay problem but it wasn't solved.
>
> So here is the problem.
>
> libgphoto2 version 2.5.4 (latest so far)
> Camera, Nikon D5100, shutter speed 1/25.
>
> I'm shooting an object that is driven by a motor that rotates 3
> seconds then pause for 10 seconds, so I have to take shots with an
> fixed time interval 13 seconds during the pause to make sure I can
> capture all the status of this object. However I found that the
> image capturing can not synchronize to the motor pauses, because
> there's  an accumulated delay on gp_camera_capture function, like,
> the first shot takes 1.6 seconds, then the 38th takes around 12.4
> seconds to finish. The problem is I have more than 100 image to get,
> that means around a 30 seconds delay will happen, so it is
> impossible to synchronize the motor. I present an graph of 3 tests
> to show you the delay.
>
> So I'm here to ask to to make sure I can synchronize the camera and motor ?
> BTW, formatting the camera card doesn't work, delay remains.

The capture code should always take the same time actually.

Can you tell us how you take the images?

Do you use your own tool?

Ciao, Marcus

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|

Re: [gphoto-devel] gphoto library image capturing delay problem and analysis

Rogier Wolff
On Wed, Jul 02, 2014 at 05:47:55PM +0200, Marcus Meissner wrote:
> On Wed, Jul 02, 2014 at 05:14:32PM +0800, Jianming wrote:
> > image capturing can not synchronize to the motor pauses, because
> > there's  an accumulated delay on gp_camera_capture function, like,
> > the first shot takes 1.6 seconds, then the 38th takes around 12.4

You're saying the delay gets longer the longer your session is
running? Always longer, never shorter?

>  The capture code should always take the same time actually.

IIRC, I wrote that feature... :-)

You (Jianming) should take the pictures with the --interval
option. That means that after taking the picture, the program will
look at the clock and schedule an appropriate delay to wake up at hte
time the next picture is supposed to happen. So as long as taking a
picture doesn't take longer than the interval, it will synchronize.

(Marcus is guesing at: you're using the library, I'm guession you're
using a shell script to get one and then doing a "sleep" for what
you timed would be a reasonable time to get 13 seconds total.

Solution in shell:
#!/bin/sh
while (true) ; do
   (sleep 13;killall sleep ) &
   gphoto2 --capture-image ...
   sleep 60
done

)

        Roger.

--
** [hidden email] ** http://www.BitWizard.nl/ ** +31-15-2600998 **
**    Delftechpark 26 2628 XH  Delft, The Netherlands. KVK: 27239233    **
*-- BitWizard writes Linux device drivers for any device you may have! --*
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|

Re: [gphoto-devel] gphoto library image capturing delay problem and analysis

Rogier Wolff
On Wed, Jul 02, 2014 at 11:01:55PM +0200, Rogier Wolff wrote:
> On Wed, Jul 02, 2014 at 05:47:55PM +0200, Marcus Meissner wrote:
> > On Wed, Jul 02, 2014 at 05:14:32PM +0800, Jianming wrote:
> > > image capturing can not synchronize to the motor pauses, because
> > > there's  an accumulated delay on gp_camera_capture function, like,
> > > the first shot takes 1.6 seconds, then the 38th takes around 12.4
>
> You're saying the delay gets longer the longer your session is
> running? Always longer, never shorter?

Forgot to add: If this is the case, it is an indication that
more-and-more files are accumulating on your SD card. Some gphoto
operatons take more time when there are more files on the SD card.
(especially initializing -> My guess that you're calling a new
gphoto for each capture is gaining credibility).

To prevent this, use capture-and-download, start out with as empty an
SD card as you can (download-and-delete everything you can find when
you start your script?), and use capture-to-SDRAM.

        Roger.

--
** [hidden email] ** http://www.BitWizard.nl/ ** +31-15-2600998 **
**    Delftechpark 26 2628 XH  Delft, The Netherlands. KVK: 27239233    **
*-- BitWizard writes Linux device drivers for any device you may have! --*
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|

Re: [gphoto-devel] gphoto library image capturing delay problem and analysis

Jianming
Thanks so much to all,

I'm actually using gphoto's python binding, called piggyphoto from git hub.

https://github.com/alexdu/piggyphoto

Here's piece of piggyphoto code handling the image capture.

###
  def capture_image(self, destpath = None):
         path = CameraFilePath()
         beforerun = 0.0
         afterrun = 0.0
         afterdownload = 0.0
         ans = 0
         for i in range(1 + retries):
             beforerun = time.time()
             ans = gp.gp_camera_capture(self._cam, GP_CAPTURE_IMAGE,
PTR(path), context)
             afterrun = time.time()
             if ans == 0: break
             else: print "capture_image(%s) retry #%d..." % (destpath, i)
         check(ans)

         if destpath:
             self.download_file(path.folder, path.name, destpath)
             afterdownload = time.time()
             return (beforerun, afterrun, afterdownload)
         else:

             return (path.folder, path.name)
###
The graph I showed is the afterrun minus beforerun.
The following is how I calculate time.
###

while self.currentHorizontalAngle < 360:

                 imageFileName = self.filePrefix + "_%03d" %
self.currentHorizontalAngle
                 imageFileName = os.path.join(self.outputPath,
imageFileName)
                 imageFileName += '.jpg'
                 print "Taking NO. %d Picture %s ..." %
(self.currentImageCount + 1, imageFileName)
                 startExeTime = time.time()
                 (beforerun, afterrun, afterdownload) =
self.C.capture_image(imageFileName)
                 self.currentImageCount += 1
                 self.currentHorizontalAngle = self.currentImageCount *
self.motorIntervalRotation
                 if self.StopButtonClicked:
                     self.StopButtonClicked = False
                     print "Warning! Stop button pressed, thread is
terminated."
                     thread.exit()
                 if (time.time() - startExeTime) >=
self.cameraTriggerIntervalTime:
                     print "Warning! Camera is too slow to catch up."
                 else:
                     pauseTime = float(self.cameraTriggerIntervalTime) -
(time.time() - startExeTime )
                     print "Pause... %f seconds, %f, %f, %f " %
(pauseTime, self.cameraTriggerIntervalTime, time.time(), startExeTime)
                     time.sleep(pauseTime)
                     writer.writerow([startExeTime, beforerun, afterrun,
afterdownload, pauseTime, time.time()])
###
So my problem is the pauseTime keeps accumulating, once it is more than
the motor rotation interval, then desynchronization happens.

I indeed tried command-line option, like

gphoto2 --capture-image-and-download --interval=13

but I found that there's still a delay happening on camera, it's like a
random delay, cause it is easy to notice that some of the shots take
longer time. Indeed there's no delay like 12 seconds from the shot is
triggered happened in the python code, but there is still noticeable
system delay accumulating, what I can find is the desynchronization
happens after 30 shots. And from the output of this command, it seems it
doesn't support floating point time.

Maybe I got problem on the motor controller, but it is unlikely, I
believe those analog controller should be very accurate on time.

I just wish to synchronize them for 120 shots, I'm really keen on any
advice you could provide.

Thanks so much again,
Jianming










On 07/03/2014 05:08 AM, Rogier Wolff wrote:

> On Wed, Jul 02, 2014 at 11:01:55PM +0200, Rogier Wolff wrote:
>> On Wed, Jul 02, 2014 at 05:47:55PM +0200, Marcus Meissner wrote:
>>> On Wed, Jul 02, 2014 at 05:14:32PM +0800, Jianming wrote:
>>>> image capturing can not synchronize to the motor pauses, because
>>>> there's  an accumulated delay on gp_camera_capture function, like,
>>>> the first shot takes 1.6 seconds, then the 38th takes around 12.4
>> You're saying the delay gets longer the longer your session is
>> running? Always longer, never shorter?
> Forgot to add: If this is the case, it is an indication that
> more-and-more files are accumulating on your SD card. Some gphoto
> operatons take more time when there are more files on the SD card.
> (especially initializing -> My guess that you're calling a new
> gphoto for each capture is gaining credibility).
>
> To prevent this, use capture-and-download, start out with as empty an
> SD card as you can (download-and-delete everything you can find when
> you start your script?), and use capture-to-SDRAM.
>
> Roger.
>


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|

Re: [gphoto-devel] gphoto library image capturing delay problem and analysis

Jianming
In reply to this post by Rogier Wolff
Now I solved the problem using a bash script since --interval option
doesn't support floating point interval value.I have to use a floating
point interval is because the motor rotation delay is not as accurate as
an integer time.

echo "Start Normal Processing..."

for i in $(seq 1 $NUMBEROFIMAGE)
do
         echo "Processing $i image..."
         NUM=`printf "%03d" $i`
         ELAPSEDTIME=`/usr/bin/time -f "%e" gphoto2
--capture-image-and-download --filename="Image_"$NUM".jpg"
--force-overwrite 2>&1 | tail -1`
         echo "Elapsed Time: $ELAPSEDTIME"
         PAUSETIME=`echo $INTERVAL-$ELAPSEDTIME | bc`
         echo "Sleeping $PAUSETIME seconds..."
         sleep $PAUSETIME
done



On 07/03/2014 05:08 AM, Rogier Wolff wrote:

> On Wed, Jul 02, 2014 at 11:01:55PM +0200, Rogier Wolff wrote:
>> On Wed, Jul 02, 2014 at 05:47:55PM +0200, Marcus Meissner wrote:
>>> On Wed, Jul 02, 2014 at 05:14:32PM +0800, Jianming wrote:
>>>> image capturing can not synchronize to the motor pauses, because
>>>> there's  an accumulated delay on gp_camera_capture function, like,
>>>> the first shot takes 1.6 seconds, then the 38th takes around 12.4
>> You're saying the delay gets longer the longer your session is
>> running? Always longer, never shorter?
> Forgot to add: If this is the case, it is an indication that
> more-and-more files are accumulating on your SD card. Some gphoto
> operatons take more time when there are more files on the SD card.
> (especially initializing -> My guess that you're calling a new
> gphoto for each capture is gaining credibility).
>
> To prevent this, use capture-and-download, start out with as empty an
> SD card as you can (download-and-delete everything you can find when
> you start your script?), and use capture-to-SDRAM.
>
> Roger.
>


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|

[gphoto-devel] Nikon D5100 PTP set-config f-number causes IO-Error

Jianming
In reply to this post by Rogier Wolff
Hi Dev,


I'm coding a GUI interface for my camera control software, so I wanted
to config camera parameters with it.

But I found I can config other parameters using gphoto2 --set-config no
problem, but the f-number (f stop).

gphoto2 --set-config-index /main/capturesettings/f-number=10

This pops up error like,

*** Error ***
PTP I/O error

*** Error ***
An error occurred in the io-library ('Unspecified error'): No error
description available
*** Error (-1: 'Unspecified error') ***

For debugging messages, please use the --debug option.
Debugging messages may help finding a solution to your problem.
If you intend to send any error or debug messages to the gphoto
developer mailing list <[hidden email]>, please run
gphoto2 as follows:

     env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt
--get-config f-number

Please make sure there is sufficient quoting around the arguments.

Then I have to reset the usb connection to be able to use the camera again.

Here is the debug output,

0.606529 ptp2/ptp_usb_getresp(2): reading response
0.606543 ptp2/ptp_usb_getpacket(2): getting next ptp packet
0.606557 gphoto2-port(2): Reading 1024=0x400 bytes from port...
0.606762 gphoto2-port(2): Could only read 12 out of 1024 byte(s)
0.606782 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
0000  0c 00 00 00 03 00 01 20-72 00 00 00              ....... r...

0.606804 gphoto2-widget(2): Setting value of widget 'Change Pic Ctrl
Item' to '0'...
0.606858 gphoto2-widget(2): Setting value of widget 'F-Number' to 'f/14'...
0.607144 set_config(2): usb vendor/product specific path entered
0.607172 set_config(2): usb vendor/product specific path entered
0.607294 camera_set_config(2): Setting property 'F-Number' / 0x5007
0.607314 gphoto2-port(2): Writing 16=0x10 byte(s) to port...
0.607323 gphoto2-port(3): Hexdump of 16 = 0x10 bytes follows:
0000  10 00 00 00 01 00 07 92-73 00 00 00 07 50 00 00 ........s....P..

0.607375 gphoto2-port(2): Writing 13=0xd byte(s) to port...
0.607386 gphoto2-port(3): Hexdump of 13 = 0xd bytes follows:
0000  0d 00 00 00 02 00 07 92-73 00 00 00 ff ........s....

0.607490 ptp2/ptp_usb_getresp(2): reading response
0.607498 ptp2/ptp_usb_getpacket(2): getting next ptp packet
0.607507 gphoto2-port(2): Reading 1024=0x400 bytes from port...
0.607621 gphoto2-port(2): Could only read 12 out of 1024 byte(s)
0.607631 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
0000  0c 00 00 00 03 00 06 20-73 00 00 00              ....... s...

0.607640 ptp2/usb_getresp(2): request code 0x9207 getting resp error 0x2006
0.607660 context(0): PTP Parameter Not Supported

*** Error ***
PTP Parameter Not Supported
0.607687 gphoto2-camera(2): Operation failed!
0.607697 context(0): Failed to set new configuration value 10 for
configuration entry /main/capturesettings/f-number.

*** Error ***
Failed to set new configuration value 10 for configuration entry
/main/capturesettings/f-number.
*** Error (-2: 'Bad parameters') ***

0.608418 gp-camera(2): Freeing camera...
0.608430 gphoto2-camera(2): Exiting camera ('Nikon DSC D5100 (PTP mode)')...
0.608442 gphoto2-port(2): Writing 12=0xc byte(s) to port...
0.608451 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
0000  0c 00 00 00 01 00 c7 90-74 00 00 00 ........t...

0.608500 gphoto2-port(2): Could only write 0 out of 12 bytes
0.608509 ptp2/usb_sendreq(2): request code 0x90c7 sending req result 0
0.608522 gphoto2-port(2): Writing 12=0xc byte(s) to port...
0.608531 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
0000  0c 00 00 00 01 00 03 10-75 00 00 00 ........u...

0.608900 gphoto2-port(2): Could only write 0 out of 12 bytes
0.608912 ptp2/usb_sendreq(2): request code 0x1003 sending req result 0
0.608989 gphoto2-port(2): Closing port...
0.609102 gphoto2-filesystem(2): resetting filesystem
0.609116 libgphoto2/gphoto2-filesys.c(2): Clearing fscache LRU list...
0.609124 libgphoto2/gphoto2-filesys.c(2): fscache LRU list already empty
0.609130 gphoto2-filesystem(2): Internally deleting all folders from '/'...
0.609136 gphoto2-filesystem(2): Lookup folder '/'...
0.609143 gphoto2-filesystem(2): Found! / is 0x1279400
0.609149 gphoto2-filesystem(2): Recurse delete folder 0x1279400//
0.609159 gphoto2-port(2): Freeing port...
0.609167 gphoto2-port(2): Closing port...
0.609218 gphoto2-filesystem(2): resetting filesystem
0.609227 libgphoto2/gphoto2-filesys.c(2): Clearing fscache LRU list...
0.609233 libgphoto2/gphoto2-filesys.c(2): fscache LRU list already empty
0.609239 gphoto2-filesystem(2): Internally deleting all folders from '/'...
0.609245 gphoto2-filesystem(2): Lookup folder '/'...
0.609250 gphoto2-filesystem(2): Found! / is 0x1279400
0.609256 gphoto2-filesystem(2): Recurse delete folder 0x1279400//

thanks,
Jianming








------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|

Re: [gphoto-devel] Nikon D5100 PTP set-config f-number causes IO-Error

Marcus Meissner
Hi,

This is a bug in 2.5.4, which will be fixed in 2.5.5.

(Due to the Sony f-number option incorrectly overwriting the generic one used for Nikon.)

Ciao, Marcus
On Wed, Jul 09, 2014 at 12:54:15PM +0800, Jianming wrote:

> Hi Dev,
>
>
> I'm coding a GUI interface for my camera control software, so I wanted
> to config camera parameters with it.
>
> But I found I can config other parameters using gphoto2 --set-config no
> problem, but the f-number (f stop).
>
> gphoto2 --set-config-index /main/capturesettings/f-number=10
>
> This pops up error like,
>
> *** Error ***
> PTP I/O error
>
> *** Error ***
> An error occurred in the io-library ('Unspecified error'): No error
> description available
> *** Error (-1: 'Unspecified error') ***
>
> For debugging messages, please use the --debug option.
> Debugging messages may help finding a solution to your problem.
> If you intend to send any error or debug messages to the gphoto
> developer mailing list <[hidden email]>, please run
> gphoto2 as follows:
>
>      env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt
> --get-config f-number
>
> Please make sure there is sufficient quoting around the arguments.
>
> Then I have to reset the usb connection to be able to use the camera again.
>
> Here is the debug output,
>
> 0.606529 ptp2/ptp_usb_getresp(2): reading response
> 0.606543 ptp2/ptp_usb_getpacket(2): getting next ptp packet
> 0.606557 gphoto2-port(2): Reading 1024=0x400 bytes from port...
> 0.606762 gphoto2-port(2): Could only read 12 out of 1024 byte(s)
> 0.606782 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> 0000  0c 00 00 00 03 00 01 20-72 00 00 00              ....... r...
>
> 0.606804 gphoto2-widget(2): Setting value of widget 'Change Pic Ctrl
> Item' to '0'...
> 0.606858 gphoto2-widget(2): Setting value of widget 'F-Number' to 'f/14'...
> 0.607144 set_config(2): usb vendor/product specific path entered
> 0.607172 set_config(2): usb vendor/product specific path entered
> 0.607294 camera_set_config(2): Setting property 'F-Number' / 0x5007
> 0.607314 gphoto2-port(2): Writing 16=0x10 byte(s) to port...
> 0.607323 gphoto2-port(3): Hexdump of 16 = 0x10 bytes follows:
> 0000  10 00 00 00 01 00 07 92-73 00 00 00 07 50 00 00 ........s....P..
>
> 0.607375 gphoto2-port(2): Writing 13=0xd byte(s) to port...
> 0.607386 gphoto2-port(3): Hexdump of 13 = 0xd bytes follows:
> 0000  0d 00 00 00 02 00 07 92-73 00 00 00 ff ........s....
>
> 0.607490 ptp2/ptp_usb_getresp(2): reading response
> 0.607498 ptp2/ptp_usb_getpacket(2): getting next ptp packet
> 0.607507 gphoto2-port(2): Reading 1024=0x400 bytes from port...
> 0.607621 gphoto2-port(2): Could only read 12 out of 1024 byte(s)
> 0.607631 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> 0000  0c 00 00 00 03 00 06 20-73 00 00 00              ....... s...
>
> 0.607640 ptp2/usb_getresp(2): request code 0x9207 getting resp error 0x2006
> 0.607660 context(0): PTP Parameter Not Supported
>
> *** Error ***
> PTP Parameter Not Supported
> 0.607687 gphoto2-camera(2): Operation failed!
> 0.607697 context(0): Failed to set new configuration value 10 for
> configuration entry /main/capturesettings/f-number.
>
> *** Error ***
> Failed to set new configuration value 10 for configuration entry
> /main/capturesettings/f-number.
> *** Error (-2: 'Bad parameters') ***
>
> 0.608418 gp-camera(2): Freeing camera...
> 0.608430 gphoto2-camera(2): Exiting camera ('Nikon DSC D5100 (PTP mode)')...
> 0.608442 gphoto2-port(2): Writing 12=0xc byte(s) to port...
> 0.608451 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> 0000  0c 00 00 00 01 00 c7 90-74 00 00 00 ........t...
>
> 0.608500 gphoto2-port(2): Could only write 0 out of 12 bytes
> 0.608509 ptp2/usb_sendreq(2): request code 0x90c7 sending req result 0
> 0.608522 gphoto2-port(2): Writing 12=0xc byte(s) to port...
> 0.608531 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> 0000  0c 00 00 00 01 00 03 10-75 00 00 00 ........u...
>
> 0.608900 gphoto2-port(2): Could only write 0 out of 12 bytes
> 0.608912 ptp2/usb_sendreq(2): request code 0x1003 sending req result 0
> 0.608989 gphoto2-port(2): Closing port...
> 0.609102 gphoto2-filesystem(2): resetting filesystem
> 0.609116 libgphoto2/gphoto2-filesys.c(2): Clearing fscache LRU list...
> 0.609124 libgphoto2/gphoto2-filesys.c(2): fscache LRU list already empty
> 0.609130 gphoto2-filesystem(2): Internally deleting all folders from '/'...
> 0.609136 gphoto2-filesystem(2): Lookup folder '/'...
> 0.609143 gphoto2-filesystem(2): Found! / is 0x1279400
> 0.609149 gphoto2-filesystem(2): Recurse delete folder 0x1279400//
> 0.609159 gphoto2-port(2): Freeing port...
> 0.609167 gphoto2-port(2): Closing port...
> 0.609218 gphoto2-filesystem(2): resetting filesystem
> 0.609227 libgphoto2/gphoto2-filesys.c(2): Clearing fscache LRU list...
> 0.609233 libgphoto2/gphoto2-filesys.c(2): fscache LRU list already empty
> 0.609239 gphoto2-filesystem(2): Internally deleting all folders from '/'...
> 0.609245 gphoto2-filesystem(2): Lookup folder '/'...
> 0.609250 gphoto2-filesystem(2): Found! / is 0x1279400
> 0.609256 gphoto2-filesystem(2): Recurse delete folder 0x1279400//
>
> thanks,
> Jianming
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> Gphoto-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gphoto-user
>

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|

Re: [gphoto-devel] gphoto library image capturing delay problem and analysis

Marcus Meissner-4
In reply to this post by Jianming
Hi,

As I am not familar with python programming can you send
a complete reproducer .py file for use with piggyphoto bindings?

Then I can try this with my D7000.


I however do not see a immediate issue with the code snippets below.

I tried
        gphoto2 --capture-image-and-download -F 60 -I 13
and it seesm to keep the time, in both SDRAM and CARD capture.

Is the program perhaps blowing up memory size wise which makes
it slower? (check with "ps" or "top").

Ciao, Marcus
On Thu, Jul 03, 2014 at 10:57:53AM +0800, Jianming wrote:

> Thanks so much to all,
>
> I'm actually using gphoto's python binding, called piggyphoto from git hub.
>
> https://github.com/alexdu/piggyphoto
>
> Here's piece of piggyphoto code handling the image capture.
>
> ###
>   def capture_image(self, destpath = None):
>          path = CameraFilePath()
>          beforerun = 0.0
>          afterrun = 0.0
>          afterdownload = 0.0
>          ans = 0
>          for i in range(1 + retries):
>              beforerun = time.time()
>              ans = gp.gp_camera_capture(self._cam, GP_CAPTURE_IMAGE,
> PTR(path), context)
>              afterrun = time.time()
>              if ans == 0: break
>              else: print "capture_image(%s) retry #%d..." % (destpath, i)
>          check(ans)
>
>          if destpath:
>              self.download_file(path.folder, path.name, destpath)
>              afterdownload = time.time()
>              return (beforerun, afterrun, afterdownload)
>          else:
>
>              return (path.folder, path.name)
> ###
> The graph I showed is the afterrun minus beforerun.
> The following is how I calculate time.
> ###
>
> while self.currentHorizontalAngle < 360:
>
>                  imageFileName = self.filePrefix + "_%03d" %
> self.currentHorizontalAngle
>                  imageFileName = os.path.join(self.outputPath,
> imageFileName)
>                  imageFileName += '.jpg'
>                  print "Taking NO. %d Picture %s ..." %
> (self.currentImageCount + 1, imageFileName)
>                  startExeTime = time.time()
>                  (beforerun, afterrun, afterdownload) =
> self.C.capture_image(imageFileName)
>                  self.currentImageCount += 1
>                  self.currentHorizontalAngle = self.currentImageCount *
> self.motorIntervalRotation
>                  if self.StopButtonClicked:
>                      self.StopButtonClicked = False
>                      print "Warning! Stop button pressed, thread is
> terminated."
>                      thread.exit()
>                  if (time.time() - startExeTime) >=
> self.cameraTriggerIntervalTime:
>                      print "Warning! Camera is too slow to catch up."
>                  else:
>                      pauseTime = float(self.cameraTriggerIntervalTime) -
> (time.time() - startExeTime )
>                      print "Pause... %f seconds, %f, %f, %f " %
> (pauseTime, self.cameraTriggerIntervalTime, time.time(), startExeTime)
>                      time.sleep(pauseTime)
>                      writer.writerow([startExeTime, beforerun, afterrun,
> afterdownload, pauseTime, time.time()])
> ###
> So my problem is the pauseTime keeps accumulating, once it is more than
> the motor rotation interval, then desynchronization happens.
>
> I indeed tried command-line option, like
>
> gphoto2 --capture-image-and-download --interval=13
>
> but I found that there's still a delay happening on camera, it's like a
> random delay, cause it is easy to notice that some of the shots take
> longer time. Indeed there's no delay like 12 seconds from the shot is
> triggered happened in the python code, but there is still noticeable
> system delay accumulating, what I can find is the desynchronization
> happens after 30 shots. And from the output of this command, it seems it
> doesn't support floating point time.
>
> Maybe I got problem on the motor controller, but it is unlikely, I
> believe those analog controller should be very accurate on time.
>
> I just wish to synchronize them for 120 shots, I'm really keen on any
> advice you could provide.
>
> Thanks so much again,
> Jianming
>
>
>
>
>
>
>
>
>
>
> On 07/03/2014 05:08 AM, Rogier Wolff wrote:
> > On Wed, Jul 02, 2014 at 11:01:55PM +0200, Rogier Wolff wrote:
> >> On Wed, Jul 02, 2014 at 05:47:55PM +0200, Marcus Meissner wrote:
> >>> On Wed, Jul 02, 2014 at 05:14:32PM +0800, Jianming wrote:
> >>>> image capturing can not synchronize to the motor pauses, because
> >>>> there's  an accumulated delay on gp_camera_capture function, like,
> >>>> the first shot takes 1.6 seconds, then the 38th takes around 12.4
> >> You're saying the delay gets longer the longer your session is
> >> running? Always longer, never shorter?
> > Forgot to add: If this is the case, it is an indication that
> > more-and-more files are accumulating on your SD card. Some gphoto
> > operatons take more time when there are more files on the SD card.
> > (especially initializing -> My guess that you're calling a new
> > gphoto for each capture is gaining credibility).
> >
> > To prevent this, use capture-and-download, start out with as empty an
> > SD card as you can (download-and-delete everything you can find when
> > you start your script?), and use capture-to-SDRAM.
> >
> > Roger.
> >
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> Gphoto-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gphoto-devel
>

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|

Re: [gphoto-devel] Nikon D5100 PTP set-config f-number causes IO-Error

happycam
In reply to this post by Marcus Meissner
Good news!

Could you tell when the version 2.5.5 will be released?

 

> Date: Wed, 9 Jul 2014 07:50:41 +0200

> From: [hidden email]
> To: [hidden email]
> CC: [hidden email]; [hidden email]
> Subject: Re: [Gphoto-user] [gphoto-devel] Nikon D5100 PTP set-config f-number causes IO-Error
>
> Hi,
>
> This is a bug in 2.5.4, which will be fixed in 2.5.5.
>
> (Due to the Sony f-number option incorrectly overwriting the generic one used for Nikon.)
>
> Ciao, Marcus
> On Wed, Jul 09, 2014 at 12:54:15PM +0800, Jianming wrote:
> > Hi Dev,
> >
> >
> > I'm coding a GUI interface for my camera control software, so I wanted
> > to config camera parameters with it.
> >
> > But I found I can config other parameters using gphoto2 --set-config no
> > problem, but the f-number (f stop).
> >
> > gphoto2 --set-config-index /main/capturesettings/f-number=10
> >
> > This pops up error like,
> >
> > *** Error ***
> > PTP I/O error
> >
> > *** Error ***
> > An error occurred in the io-library ('Unspecified error'): No error
> > description available
> > *** Error (-1: 'Unspecified error') ***
> >
> > For debugging messages, please use the --debug option.
> > Debugging messages may help finding a solution to your problem.
> > If you intend to send any error or debug messages to the gphoto
> > developer mailing list <[hidden email]>, please run
> > gphoto2 as follows:
> >
> > env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt
> > --get-config f-number
> >
> > Please make sure there is sufficient quoting around the arguments.
> >
> > Then I have to reset the usb connection to be able to use the camera again.
> >
> > Here is the debug output,
> >
> > 0.606529 ptp2/ptp_usb_getresp(2): reading response
> > 0.606543 ptp2/ptp_usb_getpacket(2): getting next ptp packet
> > 0.606557 gphoto2-port(2): Reading 1024=0x400 bytes from port...
> > 0.606762 gphoto2-port(2): Could only read 12 out of 1024 byte(s)
> > 0.606782 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> > 0000 0c 00 00 00 03 00 01 20-72 00 00 00 ....... r...
> >
> > 0.606804 gphoto2-widget(2): Setting value of widget 'Change Pic Ctrl
> > Item' to '0'...
> > 0.606858 gphoto2-widget(2): Setting value of widget 'F-Number' to 'f/14'...
> > 0.607144 set_config(2): usb vendor/product specific path entered
> > 0.607172 set_config(2): usb vendor/product specific path entered
> > 0.607294 camera_set_config(2): Setting property 'F-Number' / 0x5007
> > 0.607314 gphoto2-port(2): Writing 16=0x10 byte(s) to port...
> > 0.607323 gphoto2-port(3): Hexdump of 16 = 0x10 bytes follows:
> > 0000 10 00 00 00 01 00 07 92-73 00 00 00 07 50 00 00 ........s....P..
> >
> > 0.607375 gphoto2-port(2): Writing 13=0xd byte(s) to port...
> > 0.607386 gphoto2-port(3): Hexdump of 13 = 0xd bytes follows:
> > 0000 0d 00 00 00 02 00 07 92-73 00 00 00 ff ........s....
> >
> > 0.607490 ptp2/ptp_usb_getresp(2): reading response
> > 0.607498 ptp2/ptp_usb_getpacket(2): getting next ptp packet
> > 0.607507 gphoto2-port(2): Reading 1024=0x400 bytes from port...
> > 0.607621 gphoto2-port(2): Could only read 12 out of 1024 byte(s)
> > 0.607631 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> > 0000 0c 00 00 00 03 00 06 20-73 00 00 00 ....... s...
> >
> > 0.607640 ptp2/usb_getresp(2): request code 0x9207 getting resp error 0x2006
> > 0.607660 context(0): PTP Parameter Not Supported
> >
> > *** Error ***
> > PTP Parameter Not Supported
> > 0.607687 gphoto2-camera(2): Operation failed!
> > 0.607697 context(0): Failed to set new configuration value 10 for
> > configuration entry /main/capturesettings/f-number.
> >
> > *** Error ***
> > Failed to set new configuration value 10 for configuration entry
> > /main/capturesettings/f-number.
> > *** Error (-2: 'Bad parameters') ***
> >
> > 0.608418 gp-camera(2): Freeing camera...
> > 0.608430 gphoto2-camera(2): Exiting camera ('Nikon DSC D5100 (PTP mode)')...
> > 0.608442 gphoto2-port(2): Writing 12=0xc byte(s) to port...
> > 0.608451 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> > 0000 0c 00 00 00 01 00 c7 90-74 00 00 00 ........t...
> >
> > 0.608500 gphoto2-port(2): Could only write 0 out of 12 bytes
> > 0.608509 ptp2/usb_sendreq(2): request code 0x90c7 sending req result 0
> > 0.608522 gphoto2-port(2): Writing 12=0xc byte(s) to port...
> > 0.608531 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> > 0000 0c 00 00 00 01 00 03 10-75 00 00 00 ........u...
> >
> > 0.608900 gphoto2-port(2): Could only write 0 out of 12 bytes
> > 0.608912 ptp2/usb_sendreq(2): request code 0x1003 sending req result 0
> > 0.608989 gphoto2-port(2): Closing port...
> > 0.609102 gphoto2-filesystem(2): resetting filesystem
> > 0.609116 libgphoto2/gphoto2-filesys.c(2): Clearing fscache LRU list...
> > 0.609124 libgphoto2/gphoto2-filesys.c(2): fscache LRU list already empty
> > 0.609130 gphoto2-filesystem(2): Internally deleting all folders from '/'...
> > 0.609136 gphoto2-filesystem(2): Lookup folder '/'...
> > 0.609143 gphoto2-filesystem(2): Found! / is 0x1279400
> > 0.609149 gphoto2-filesystem(2): Recurse delete folder 0x1279400//
> > 0.609159 gphoto2-port(2): Freeing port...
> > 0.609167 gphoto2-port(2): Closing port...
> > 0.609218 gphoto2-filesystem(2): resetting filesystem
> > 0.609227 libgphoto2/gphoto2-filesys.c(2): Clearing fscache LRU list...
> > 0.609233 libgphoto2/gphoto2-filesys.c(2): fscache LRU list already empty
> > 0.609239 gphoto2-filesystem(2): Internally deleting all folders from '/'...
> > 0.609245 gphoto2-filesystem(2): Lookup folder '/'...
> > 0.609250 gphoto2-filesystem(2): Found! / is 0x1279400
> > 0.609256 gphoto2-filesystem(2): Recurse delete folder 0x1279400//
> >
> > thanks,
> > Jianming
> >
> >
> >
> >
> >
> >
> >
> >
> > ------------------------------------------------------------------------------
> > Open source business process management suite built on Java and Eclipse
> > Turn processes into business applications with Bonita BPM Community Edition
> > Quickly connect people, data, and systems into organized workflows
> > Winner of BOSSIE, CODIE, OW2 and Gartner awards
> > http://p.sf.net/sfu/Bonitasoft
> > _______________________________________________
> > Gphoto-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gphoto-user
> >
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> Gphoto-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gphoto-user

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|

Re: [gphoto-devel] Nikon D5100 PTP set-config f-number causes IO-Error

Marcus Meissner-4
On Wed, Jul 09, 2014 at 11:00:11AM +0000, Lihuijun wrote:
> Good news!
> Could you tell when the version 2.5.5 will be released?

I was planning it, but did not make it.

As some PTP code has been rewritten a bit, I will need to let it
settle a bit.

Also Nikon preview capture is one of the things I wanted to have,
but wireless sniffing turns out harder than I thought in 802.11n.

Ciao, Marcus
 
 

> > Date: Wed, 9 Jul 2014 07:50:41 +0200
> > From: [hidden email]
> > To: [hidden email]
> > CC: [hidden email]; [hidden email]
> > Subject: Re: [Gphoto-user] [gphoto-devel] Nikon D5100 PTP set-config f-number causes IO-Error
> >
> > Hi,
> >
> > This is a bug in 2.5.4, which will be fixed in 2.5.5.
> >
> > (Due to the Sony f-number option incorrectly overwriting the generic one used for Nikon.)
> >
> > Ciao, Marcus
> > On Wed, Jul 09, 2014 at 12:54:15PM +0800, Jianming wrote:
> > > Hi Dev,
> > >
> > >
> > > I'm coding a GUI interface for my camera control software, so I wanted
> > > to config camera parameters with it.
> > >
> > > But I found I can config other parameters using gphoto2 --set-config no
> > > problem, but the f-number (f stop).
> > >
> > > gphoto2 --set-config-index /main/capturesettings/f-number=10
> > >
> > > This pops up error like,
> > >
> > > *** Error ***
> > > PTP I/O error
> > >
> > > *** Error ***
> > > An error occurred in the io-library ('Unspecified error'): No error
> > > description available
> > > *** Error (-1: 'Unspecified error') ***
> > >
> > > For debugging messages, please use the --debug option.
> > > Debugging messages may help finding a solution to your problem.
> > > If you intend to send any error or debug messages to the gphoto
> > > developer mailing list <[hidden email]>, please run
> > > gphoto2 as follows:
> > >
> > >      env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt
> > > --get-config f-number
> > >
> > > Please make sure there is sufficient quoting around the arguments.
> > >
> > > Then I have to reset the usb connection to be able to use the camera again.
> > >
> > > Here is the debug output,
> > >
> > > 0.606529 ptp2/ptp_usb_getresp(2): reading response
> > > 0.606543 ptp2/ptp_usb_getpacket(2): getting next ptp packet
> > > 0.606557 gphoto2-port(2): Reading 1024=0x400 bytes from port...
> > > 0.606762 gphoto2-port(2): Could only read 12 out of 1024 byte(s)
> > > 0.606782 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> > > 0000  0c 00 00 00 03 00 01 20-72 00 00 00              ....... r...
> > >
> > > 0.606804 gphoto2-widget(2): Setting value of widget 'Change Pic Ctrl
> > > Item' to '0'...
> > > 0.606858 gphoto2-widget(2): Setting value of widget 'F-Number' to 'f/14'...
> > > 0.607144 set_config(2): usb vendor/product specific path entered
> > > 0.607172 set_config(2): usb vendor/product specific path entered
> > > 0.607294 camera_set_config(2): Setting property 'F-Number' / 0x5007
> > > 0.607314 gphoto2-port(2): Writing 16=0x10 byte(s) to port...
> > > 0.607323 gphoto2-port(3): Hexdump of 16 = 0x10 bytes follows:
> > > 0000  10 00 00 00 01 00 07 92-73 00 00 00 07 50 00 00 ........s....P..
> > >
> > > 0.607375 gphoto2-port(2): Writing 13=0xd byte(s) to port...
> > > 0.607386 gphoto2-port(3): Hexdump of 13 = 0xd bytes follows:
> > > 0000  0d 00 00 00 02 00 07 92-73 00 00 00 ff ........s....
> > >
> > > 0.607490 ptp2/ptp_usb_getresp(2): reading response
> > > 0.607498 ptp2/ptp_usb_getpacket(2): getting next ptp packet
> > > 0.607507 gphoto2-port(2): Reading 1024=0x400 bytes from port...
> > > 0.607621 gphoto2-port(2): Could only read 12 out of 1024 byte(s)
> > > 0.607631 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> > > 0000  0c 00 00 00 03 00 06 20-73 00 00 00              ....... s...
> > >
> > > 0.607640 ptp2/usb_getresp(2): request code 0x9207 getting resp error 0x2006
> > > 0.607660 context(0): PTP Parameter Not Supported
> > >
> > > *** Error ***
> > > PTP Parameter Not Supported
> > > 0.607687 gphoto2-camera(2): Operation failed!
> > > 0.607697 context(0): Failed to set new configuration value 10 for
> > > configuration entry /main/capturesettings/f-number.
> > >
> > > *** Error ***
> > > Failed to set new configuration value 10 for configuration entry
> > > /main/capturesettings/f-number.
> > > *** Error (-2: 'Bad parameters') ***
> > >
> > > 0.608418 gp-camera(2): Freeing camera...
> > > 0.608430 gphoto2-camera(2): Exiting camera ('Nikon DSC D5100 (PTP mode)')...
> > > 0.608442 gphoto2-port(2): Writing 12=0xc byte(s) to port...
> > > 0.608451 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> > > 0000  0c 00 00 00 01 00 c7 90-74 00 00 00 ........t...
> > >
> > > 0.608500 gphoto2-port(2): Could only write 0 out of 12 bytes
> > > 0.608509 ptp2/usb_sendreq(2): request code 0x90c7 sending req result 0
> > > 0.608522 gphoto2-port(2): Writing 12=0xc byte(s) to port...
> > > 0.608531 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> > > 0000  0c 00 00 00 01 00 03 10-75 00 00 00 ........u...
> > >
> > > 0.608900 gphoto2-port(2): Could only write 0 out of 12 bytes
> > > 0.608912 ptp2/usb_sendreq(2): request code 0x1003 sending req result 0
> > > 0.608989 gphoto2-port(2): Closing port...
> > > 0.609102 gphoto2-filesystem(2): resetting filesystem
> > > 0.609116 libgphoto2/gphoto2-filesys.c(2): Clearing fscache LRU list...
> > > 0.609124 libgphoto2/gphoto2-filesys.c(2): fscache LRU list already empty
> > > 0.609130 gphoto2-filesystem(2): Internally deleting all folders from '/'...
> > > 0.609136 gphoto2-filesystem(2): Lookup folder '/'...
> > > 0.609143 gphoto2-filesystem(2): Found! / is 0x1279400
> > > 0.609149 gphoto2-filesystem(2): Recurse delete folder 0x1279400//
> > > 0.609159 gphoto2-port(2): Freeing port...
> > > 0.609167 gphoto2-port(2): Closing port...
> > > 0.609218 gphoto2-filesystem(2): resetting filesystem
> > > 0.609227 libgphoto2/gphoto2-filesys.c(2): Clearing fscache LRU list...
> > > 0.609233 libgphoto2/gphoto2-filesys.c(2): fscache LRU list already empty
> > > 0.609239 gphoto2-filesystem(2): Internally deleting all folders from '/'...
> > > 0.609245 gphoto2-filesystem(2): Lookup folder '/'...
> > > 0.609250 gphoto2-filesystem(2): Found! / is 0x1279400
> > > 0.609256 gphoto2-filesystem(2): Recurse delete folder 0x1279400//
> > >
> > > thanks,
> > > Jianming
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > ------------------------------------------------------------------------------
> > > Open source business process management suite built on Java and Eclipse
> > > Turn processes into business applications with Bonita BPM Community Edition
> > > Quickly connect people, data, and systems into organized workflows
> > > Winner of BOSSIE, CODIE, OW2 and Gartner awards
> > > http://p.sf.net/sfu/Bonitasoft
> > > _______________________________________________
> > > Gphoto-user mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/gphoto-user
> > >
> >
> > ------------------------------------------------------------------------------
> > Open source business process management suite built on Java and Eclipse
> > Turn processes into business applications with Bonita BPM Community Edition
> > Quickly connect people, data, and systems into organized workflows
> > Winner of BOSSIE, CODIE, OW2 and Gartner awards
> > http://p.sf.net/sfu/Bonitasoft
> > _______________________________________________
> > Gphoto-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gphoto-user
>      

> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft

> _______________________________________________
> Gphoto-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gphoto-user


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|

Re: [gphoto-devel] Nikon D5100 PTP set-config f-number causes IO-Error

happycam
Thanks for your explanation.

As for preview, more and more DSLRs have the function to set focus point in LCD live view mode and shoot, I wish the libgphoto could make this function available too. :)



> Date: Wed, 9 Jul 2014 22:29:08 +0200

> From: [hidden email]
> To: [hidden email]
> CC: [hidden email]; [hidden email]
> Subject: Re: [Gphoto-user] [gphoto-devel] Nikon D5100 PTP set-config f-number causes IO-Error
>
> On Wed, Jul 09, 2014 at 11:00:11AM +0000, Lihuijun wrote:
> > Good news!
> > Could you tell when the version 2.5.5 will be released?
>
> I was planning it, but did not make it.
>
> As some PTP code has been rewritten a bit, I will need to let it
> settle a bit.
>
> Also Nikon preview capture is one of the things I wanted to have,
> but wireless sniffing turns out harder than I thought in 802.11n.
>
> Ciao, Marcus
>
>
> > > Date: Wed, 9 Jul 2014 07:50:41 +0200
> > > From: [hidden email]
> > > To: [hidden email]
> > > CC: [hidden email]; [hidden email]
> > > Subject: Re: [Gphoto-user] [gphoto-devel] Nikon D5100 PTP set-config f-number causes IO-Error
> > >
> > > Hi,
> > >
> > > This is a bug in 2.5.4, which will be fixed in 2.5.5.
> > >
> > > (Due to the Sony f-number option incorrectly overwriting the generic one used for Nikon.)
> > >
> > > Ciao, Marcus
> > > On Wed, Jul 09, 2014 at 12:54:15PM +0800, Jianming wrote:
> > > > Hi Dev,
> > > >
> > > >
> > > > I'm coding a GUI interface for my camera control software, so I wanted
> > > > to config camera parameters with it.
> > > >
> > > > But I found I can config other parameters using gphoto2 --set-config no
> > > > problem, but the f-number (f stop).
> > > >
> > > > gphoto2 --set-config-index /main/capturesettings/f-number=10
> > > >
> > > > This pops up error like,
> > > >
> > > > *** Error ***
> > > > PTP I/O error
> > > >
> > > > *** Error ***
> > > > An error occurred in the io-library ('Unspecified error'): No error
> > > > description available
> > > > *** Error (-1: 'Unspecified error') ***
> > > >
> > > > For debugging messages, please use the --debug option.
> > > > Debugging messages may help finding a solution to your problem.
> > > > If you intend to send any error or debug messages to the gphoto
> > > > developer mailing list <[hidden email]>, please run
> > > > gphoto2 as follows:
> > > >
> > > > env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt
> > > > --get-config f-number
> > > >
> > > > Please make sure there is sufficient quoting around the arguments.
> > > >
> > > > Then I have to reset the usb connection to be able to use the camera again.
> > > >
> > > > Here is the debug output,
> > > >
> > > > 0.606529 ptp2/ptp_usb_getresp(2): reading response
> > > > 0.606543 ptp2/ptp_usb_getpacket(2): getting next ptp packet
> > > > 0.606557 gphoto2-port(2): Reading 1024=0x400 bytes from port...
> > > > 0.606762 gphoto2-port(2): Could only read 12 out of 1024 byte(s)
> > > > 0.606782 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> > > > 0000 0c 00 00 00 03 00 01 20-72 00 00 00 ....... r...
> > > >
> > > > 0.606804 gphoto2-widget(2): Setting value of widget 'Change Pic Ctrl
> > > > Item' to '0'...
> > > > 0.606858 gphoto2-widget(2): Setting value of widget 'F-Number' to 'f/14'...
> > > > 0.607144 set_config(2): usb vendor/product specific path entered
> > > > 0.607172 set_config(2): usb vendor/product specific path entered
> > > > 0.607294 camera_set_config(2): Setting property 'F-Number' / 0x5007
> > > > 0.607314 gphoto2-port(2): Writing 16=0x10 byte(s) to port...
> > > > 0.607323 gphoto2-port(3): Hexdump of 16 = 0x10 bytes follows:
> > > > 0000 10 00 00 00 01 00 07 92-73 00 00 00 07 50 00 00 ........s....P..
> > > >
> > > > 0.607375 gphoto2-port(2): Writing 13=0xd byte(s) to port...
> > > > 0.607386 gphoto2-port(3): Hexdump of 13 = 0xd bytes follows:
> > > > 0000 0d 00 00 00 02 00 07 92-73 00 00 00 ff ........s....
> > > >
> > > > 0.607490 ptp2/ptp_usb_getresp(2): reading response
> > > > 0.607498 ptp2/ptp_usb_getpacket(2): getting next ptp packet
> > > > 0.607507 gphoto2-port(2): Reading 1024=0x400 bytes from port...
> > > > 0.607621 gphoto2-port(2): Could only read 12 out of 1024 byte(s)
> > > > 0.607631 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> > > > 0000 0c 00 00 00 03 00 06 20-73 00 00 00 ....... s...
> > > >
> > > > 0.607640 ptp2/usb_getresp(2): request code 0x9207 getting resp error 0x2006
> > > > 0.607660 context(0): PTP Parameter Not Supported
> > > >
> > > > *** Error ***
> > > > PTP Parameter Not Supported
> > > > 0.607687 gphoto2-camera(2): Operation failed!
> > > > 0.607697 context(0): Failed to set new configuration value 10 for
> > > > configuration entry /main/capturesettings/f-number.
> > > >
> > > > *** Error ***
> > > > Failed to set new configuration value 10 for configuration entry
> > > > /main/capturesettings/f-number.
> > > > *** Error (-2: 'Bad parameters') ***
> > > >
> > > > 0.608418 gp-camera(2): Freeing camera...
> > > > 0.608430 gphoto2-camera(2): Exiting camera ('Nikon DSC D5100 (PTP mode)')...
> > > > 0.608442 gphoto2-port(2): Writing 12=0xc byte(s) to port...
> > > > 0.608451 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> > > > 0000 0c 00 00 00 01 00 c7 90-74 00 00 00 ........t...
> > > >
> > > > 0.608500 gphoto2-port(2): Could only write 0 out of 12 bytes
> > > > 0.608509 ptp2/usb_sendreq(2): request code 0x90c7 sending req result 0
> > > > 0.608522 gphoto2-port(2): Writing 12=0xc byte(s) to port...
> > > > 0.608531 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
> > > > 0000 0c 00 00 00 01 00 03 10-75 00 00 00 ........u...
> > > >
> > > > 0.608900 gphoto2-port(2): Could only write 0 out of 12 bytes
> > > > 0.608912 ptp2/usb_sendreq(2): request code 0x1003 sending req result 0
> > > > 0.608989 gphoto2-port(2): Closing port...
> > > > 0.609102 gphoto2-filesystem(2): resetting filesystem
> > > > 0.609116 libgphoto2/gphoto2-filesys.c(2): Clearing fscache LRU list...
> > > > 0.609124 libgphoto2/gphoto2-filesys.c(2): fscache LRU list already empty
> > > > 0.609130 gphoto2-filesystem(2): Internally deleting all folders from '/'...
> > > > 0.609136 gphoto2-filesystem(2): Lookup folder '/'...
> > > > 0.609143 gphoto2-filesystem(2): Found! / is 0x1279400
> > > > 0.609149 gphoto2-filesystem(2): Recurse delete folder 0x1279400//
> > > > 0.609159 gphoto2-port(2): Freeing port...
> > > > 0.609167 gphoto2-port(2): Closing port...
> > > > 0.609218 gphoto2-filesystem(2): resetting filesystem
> > > > 0.609227 libgphoto2/gphoto2-filesys.c(2): Clearing fscache LRU list...
> > > > 0.609233 libgphoto2/gphoto2-filesys.c(2): fscache LRU list already empty
> > > > 0.609239 gphoto2-filesystem(2): Internally deleting all folders from '/'...
> > > > 0.609245 gphoto2-filesystem(2): Lookup folder '/'...
> > > > 0.609250 gphoto2-filesystem(2): Found! / is 0x1279400
> > > > 0.609256 gphoto2-filesystem(2): Recurse delete folder 0x1279400//
> > > >
> > > > thanks,
> > > > Jianming
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > ------------------------------------------------------------------------------
> > > > Open source business process management suite built on Java and Eclipse
> > > > Turn processes into business applications with Bonita BPM Community Edition
> > > > Quickly connect people, data, and systems into organized workflows
> > > > Winner of BOSSIE, CODIE, OW2 and Gartner awards
> > > > http://p.sf.net/sfu/Bonitasoft
> > > > _______________________________________________
> > > > Gphoto-user mailing list
> > > > [hidden email]
> > > > https://lists.sourceforge.net/lists/listinfo/gphoto-user
> > > >
> > >
> > > ------------------------------------------------------------------------------
> > > Open source business process management suite built on Java and Eclipse
> > > Turn processes into business applications with Bonita BPM Community Edition
> > > Quickly connect people, data, and systems into organized workflows
> > > Winner of BOSSIE, CODIE, OW2 and Gartner awards
> > > http://p.sf.net/sfu/Bonitasoft
> > > _______________________________________________
> > > Gphoto-user mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/gphoto-user
> >
>
> > ------------------------------------------------------------------------------
> > Open source business process management suite built on Java and Eclipse
> > Turn processes into business applications with Bonita BPM Community Edition
> > Quickly connect people, data, and systems into organized workflows
> > Winner of BOSSIE, CODIE, OW2 and Gartner awards
> > http://p.sf.net/sfu/Bonitasoft
>
> > _______________________________________________
> > Gphoto-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gphoto-user
>

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|

Re: [gphoto-devel] gphoto library image capturing delay problem and analysis

Marcus Meissner-4
In reply to this post by Jianming
On Wed, Jul 02, 2014 at 05:14:32PM +0800, Jianming wrote:

> Hi Dev,
>
> From the mailing list, I can see many people had similar image
> capture delay problem but it wasn't solved.
>
> So here is the problem.
>
> libgphoto2 version 2.5.4 (latest so far)
> Camera, Nikon D5100, shutter speed 1/25.
>
> I'm shooting an object that is driven by a motor that rotates 3
> seconds then pause for 10 seconds, so I have to take shots with an
> fixed time interval 13 seconds during the pause to make sure I can
> capture all the status of this object. However I found that the
> image capturing can not synchronize to the motor pauses, because
> there's  an accumulated delay on gp_camera_capture function, like,
> the first shot takes 1.6 seconds, then the 38th takes around 12.4
> seconds to finish. The problem is I have more than 100 image to get,
> that means around a 30 seconds delay will happen, so it is
> impossible to synchronize the motor. I present an graph of 3 tests
> to show you the delay.
>
> So I'm here to ask to to make sure I can synchronize the camera and motor ?
> BTW, formatting the camera card doesn't work, delay remains.

I think I might have found the issue here.

gp_camera_capture goes throught the event list looking for ones itr handles
and pushes back events it does not handle.

After a while this list gets very long and this process takes longer and longer
in a linear progression.

You probably need to drain the event queue between captures, otherwise events
will accumulate.

gp_wait_for_event(.... ) with minimum delay until a timeout event is returned.

see
libgphoto2/examples/sample-tether.c
how this works.

Please report if this helps.

I will see that I change libgphoto2 code not do this agressively.

Ciao, MArcus

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|

[gphoto-devel] what camera model with gphoto has the fastest shutter response ?

Jianming
In reply to this post by Jianming
Hi All,

I'm looking to replace the camera in my current camera system with gphoto library.

What I need is a recent camera model which has faster gphoto signal response under linux. My current Nikon D7100 and D5100 are not fast enough since there are about 200ms unstable delay between signal send and the camera reaction.

So I'm looking for some model can do stable shutter reaction within 50ms +-5ms, maybe I cannot use a DSLR with the mechanical shutter, but a compact camera. The stability is more important than fast response but unstable, which means I can accept 500ms +- 5ms, but not 5ms +- 500ms.

Thanks,
Jianming

------------------------------------------------------------------------------

_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user