Faster Sync Triggering? - page 5 - General Help and Assistance on using CHDK stable releases - CHDK Forum

Faster Sync Triggering?

  • 68 Replies
  • 31750 Views
*

Offline reyalp

  • ******
  • 14126
Re: Faster Sync Triggering?
« Reply #40 on: 10 / January / 2017, 15:54:39 »
Advertisements
surely get-shooting will be true at that point (assuming correct procedure/operation) and the while loop of
function wait_timeout_write_status(func,value,wait,timeout,msg) will never be executed...i.e. zero wait is introduced since we immediately fall through to write_status(true)...or am I missing a trick ?
I guess I should have said there is no reason to call wait_timeout_write_status?

It's probably harmless for the reason you describe, but it surely won't help you understand what it is trying to do if you look at it later.
Don't forget what the H stands for.

Re: Faster Sync Triggering?
« Reply #41 on: 11 / January / 2017, 09:52:10 »
but it surely won't help you understand what it is trying to do if you look at it later.

Very true - especially since I can't now conceive why I may have thought a get_shooting test could possibly have been of any utility at that stage anyway  :blink:   

Re: Faster Sync Triggering?
« Reply #42 on: 08 / April / 2017, 06:12:37 »
In a:

usb_force_active(1)
usb_sync_wait(1)

type shooting scenario, is there any possible way of benefiting from the usbremote menu
  • Enable Synch Delay
  • Synch Delay 0.1ms
functionality?

Using multicam.lua i'd like to delay one group of cameras by 42ms from the same 5v -> 0v transistion.

PS: in the normal chdk remote menu would the synch delay be written as 420 (being 4 times 0.1ms) ?

Edit:

The following sequence works correctly on all three cameras with no disconnections. 

Code: [Select]
$ run -i
___> c
connected: Canon PowerShot A1200, max packet size 512
con> =usb_force_active(1)          -- lock USB communications on (+5V line changes do not disconnect USB)
con 1> =set_config_value(121,1)    -- enable USB switch operations (switch & controller mode already setup)
con 2> =switch_mode_usb(1)         -- switch camera to shooting mode
con 3> =shoot()                    -- take a picture
con 4>
After the usb_force_active(1) is issued,  I can toggle the  +5V inline switch to my heart's content and the connection is not affected.  Once the set_config_value(121,1) is done,  toggling the +5V line causes the camera to take a picture (as expected).  The chdkptp shoot() command also causes a picture to be taken.

Based on that I assume I can forget about:
  • usb_sync_wait(1)
What would the set_config look like (in code) to include a delay?
« Last Edit: 08 / April / 2017, 07:52:44 by andrew.stephens.754365 »

Re: Faster Sync Triggering?
« Reply #43 on: 08 / April / 2017, 10:20:53 »
In a:
usb_force_active(1)
usb_sync_wait(1)
type shooting scenario, is there any possible way of benefiting from the usbremote menu
  • Enable Synch Delay
  • Synch Delay 0.1ms
functionality?

Using multicam.lua i'd like to delay one group of cameras by 42ms from the same 5v -> 0v transistion.
Setting Enable Synch Delay [ * ]  and the setting Synch Delay [  ] to any value > 0 will insert a delay into any of the "sync'd" shooting scenerios (i.e. scripted, USB Remote, chdkptp).

Quote
PS: in the normal chdk remote menu would the synch delay be written as 420 (being 4 times 0.1ms) ?
Yes.  At least in theory.  However, there are very few cameras where setting 420 will actually give 42 mSec.

FWIW, the USB remote code includes a function called kbd_calibrate_synch_delay( ). That function must be used during CHDK development to calibrate an internal constant named synch_delay_tick .  The default value if no calibration is done is just a wild guess of an appropriate starting value, and the actual delay that occurs will change with ARM CPU model and clock speed.

AFAIK, the calibration function has never been used and every camera defaults to the same calibration value. In fact, as built today, the value is in part of the CHDK source code that is common to every camera.  There is no way to set it up on a per camera basis. :-[

So you options are to enable the function in source and calibrate yourself for your personal build.  Or, just experiment with the Synch Delay [  ] value.  Set it to 5000 and measure the delay created from shutter release.  Adjust the value until you get five seconds.  Calculate the multiplier necessary to calibrate the value.  Then multiply your 420 value by that factor.  Done.

Quote
Based on that I assume I can forget about:
  • usb_sync_wait(1)
I'm not sure that I understand your question.   

You need to use usb_sync_wait(1)  if you are triggering shots in code (rather than by the USB Remote) and want to have sync functionality - including the sync delay stuff. So you can't forget about it.

Quote
What would the set_config look like (in code) to include a delay?
Code: [Select]
usb_sync_wait(1)
set_config_value(191,1)  --  will set synch_delay_enable[ * ]
set_config_value(192,50000) -- will set the synch_delay_value to 5 seconds (approx)


 
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Faster Sync Triggering?
« Reply #44 on: 08 / April / 2017, 11:47:27 »
I'm not sure that I understand your question.

I had (incorrectly) assumed your statement "toggling the +5V line causes the camera to take a picture (as expected)" to imply a synched shot.

Thanks for the rest of your extremely useful comment.

Does the hook_shoot become ready at the beginning or end of the Synch Delay "loop"?

Correction: 420 (being 4 times 0.1ms) ? -> 420 (being 420 times 0.1ms) ?

Of note:
i'm a bit concerned (on occurrence of camera crash after having set the remote) the need to physically enter the usbremote menu on the camera.

Re: Faster Sync Triggering?
« Reply #45 on: 08 / April / 2017, 12:00:13 »
Does the hook_shoot become ready at the beginning or end of the Synch Delay "loop"?
Actually, earlier than that.  It's inserted immediately prior to the spot where the code starts waiting for the USB signal to go from 5V to GND.  The Sync Delay happens after that event is detected.

Quote
Correction: 420 (being 4 times 0.1ms) ? -> 420 (being 420 times 0.1ms) ?
Sorry - I do not understand what you are trying to say here. 

FWIW, if you set Synch Delay [ 420 ] ,  you are requesting a 42 mSec delay (or 0.042 seconds if you prefer).

Quote
i'm a bit concerned (on occurrence of camera crash after having set the remote) the need to physically enter the usbremote menu on the camera.
Again,  I don't understand.  You are a bit concerned about what exactly?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Faster Sync Triggering?
« Reply #46 on: 08 / April / 2017, 12:51:27 »
Actually, earlier than that.  It's inserted immediately prior to the spot where the code starts waiting for the USB signal to go from 5V to GND.  The Sync Delay happens after that event is detected.

Ok, thanks.

Sorry - I do not understand what you are trying to say here. 

I had originally said:
"PS: in the normal chdk remote menu would the synch delay be written as 420 (being 4 times 0.1ms) ?"

4 times 0.1ms is 0.4ms (not 42ms).

Again,  I don't understand.  You are a bit concerned about what exactly?

If I have enabled the remote and the camera (one of many) subsequently crashes then (after power down / up) the cfg file settings (set by the prior set_config_value(191,1))) will preclude that camera connecting (via ptp) until the usbremote is disabled (physically on the camera)?

That could be a hassle.


A very late edit nearly 2 years later:

If I have enabled the remote and the camera (one of many) subsequently crashes then (after power down / up) the cfg file settings (set by the prior set_config_value(191,1))) will preclude that camera connecting (via ptp) until the usbremote is disabled (physically on the camera)?

That could be a hassle.

"set by the prior set_config_value(191,1)" in above quote should have read as:

"set by the prior set_config_value(121,1)"

That mistake led me to some following misunderstanding / confusion.
« Last Edit: 20 / March / 2018, 16:56:34 by andrew.stephens.754365 »

Re: Faster Sync Triggering?
« Reply #47 on: 08 / April / 2017, 13:01:38 »
If I have enabled the remote and the camera (one of many) subsequently crashes then (after power down / up) the cfg file settings (set by the prior set_config_value(191,1))) will preclude that camera connecting (via ptp) until the usbremote is disabled (physically on the camera)?
Nope -  set_config_value(191,1) has no effect on ptp connectivity.

And if your script runs on startup (normal for multicam rigs) then an immediate usb_force_active(1) will allow ptp communications regardless of the status of Enable Remote [ * ].
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Faster Sync Triggering?
« Reply #48 on: 08 / April / 2017, 13:26:10 »
Nope -  set_config_value(191,1) has no effect on ptp connectivity.

Excellent - thanks!

And if your script runs on startup (normal for multicam rigs) then an immediate usb_force_active(1) will allow ptp communications regardless of the status of Enable Remote [ * ].

All functions I plan are additions to long-running multicam.lua.

In (brief) prior testing I (think I) am locked out of that if I have enabled the remote [edit: let me test though?].
« Last Edit: 08 / April / 2017, 13:27:43 by andrew.stephens.754365 »

Re: Faster Sync Triggering?
« Reply #49 on: 08 / April / 2017, 14:13:58 »
Nope -  set_config_value(191,1) has no effect on ptp connectivity.

So, doing that in script has zero impact on the .cfg, correct ?
« Last Edit: 08 / April / 2017, 14:19:45 by andrew.stephens.754365 »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal