supplierdeeply

USBremote - sync test issue

  • 11 Replies
  • 797 Views
USBremote - sync test issue
« on: 21 / October / 2017, 10:58:18 »
Advertisements
Using:
a2500-100a-1.5.0-4922-full_ALPHA.zip

from http://mighty-hoernsche.de/trunk/

with
Enable Remote [selected]
Switch Type [TwoPush]
Control Mode [Normal]
Enable Synch [selected]

using a remote switch, focus occurred with first pulse but shot occurred after rising edge of 2nd pulse but before its falling edge (and well within the 10 sec timeout).

Same result for  sx150is-100a-1.5.0-4922-full.zip

Associated reference:
http://chdk.wikia.com/wiki/USB_Remote
« Last Edit: 21 / October / 2017, 11:01:23 by andrew.stephens.754365 »

Re: USBremote - sync test issue
« Reply #1 on: 21 / October / 2017, 11:08:35 »
using a remote switch, focus occurred with first pulse but shot occurred after rising edge of 2nd pulse but before its falling edge (and well within the 10 sec timeout).
AFAIK, that's pretty much how it is supposed to work.



What were you expecting?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: USBremote - sync test issue
« Reply #2 on: 21 / October / 2017, 11:47:31 »
Issue is not that the post focus/exposure shooting process begins with the 2nd rising edge but that the exposure has finished before the falling 2nd edge (the lcd has returned to live scene view before that edge occurs).  The image on SD card is of where I had the camera pointed at the 2nd rising edge & not the 2nd falling edge.

From the Wiki:

Quote
If the Enable Sync option is set in CHDK then each camera will wait for the final transition of the USB signal ( 5V to 0V ) before shooting.  Note : the camera will wait a maximum of 10 seconds for the sync signal.  Waiting any longer results in unpredictable bad camera behaviour.
« Last Edit: 21 / October / 2017, 11:59:14 by andrew.stephens.754365 »

Re: USBremote - sync test issue
« Reply #3 on: 21 / October / 2017, 12:09:25 »
Issue is not that the post focus/exposure shooting process begins with the 2nd rising edge but that the exposure has finished before the falling 2nd edge (the lcd has returned to live scene view before that edge occurs).  The image on SD card is of where I had the camera pointed at the 2nd rising edge & not the 2nd falling edge.
Just tested on my trusty G10.  The resulting image on SD card is from where the camera was pointing at the 2nd falling edge as expected.  Checking the USB remote code,  that's actually what is supposed to happen. Not sure why you are seeing something different.

I'll take a close look later and retest on my A1200. 
« Last Edit: 21 / October / 2017, 12:12:15 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


Re: USBremote - sync test issue
« Reply #4 on: 21 / October / 2017, 16:40:27 »
I'll take a close look later and retest on my A1200. 
A1200 test complete. And again, the resulting image is from where the camera was pointing at the 2nd falling edge as expected.

This leads me to suspect the
Code: [Select]
BL      wait_until_remote_button_is_releasedin capt_seq.c is not correctly placed for the A2500.

Here's a simple test.  Use :

Enable Remote [ * ]
Switch Type [OnePush]
Control Mode [Normal]
Enable Synch [ *]

When shooting in this mode,  on the rising edge of the trigger pulse the camera should focus and then the display will go dark.  On the falling edge of the trigger pulse, the display turns back on and an image will be captured.

If the shot trigger right away then the wait_until_remote_button_is_released is in the wrong place.  Likewise, if the display fails to go dark something is wrong.



Ported :   A1200    SD940   G10    Powershot N    G16

Re: USBremote - sync test issue
« Reply #5 on: 22 / October / 2017, 11:19:21 »
Yes, I had already tried one-push synch. It is in error on both A2500 &  SX150IS and on an SX220hs I have borrowed.

Does Assembla allow you to view all the files and changes in any previous build? I vaguely remember something called trac did allow that.

Difficult to believe sync has never worked on these three cameras.


Perhaps not the best place to mention this but the issue above has made me realise i'm a bit confused about ptp sync via function:
Code: [Select]
cmds.shoot_hook_sync() ->  hook_shoot.continue()
in multicam.lua

http://chdk.wikia.com/wiki/Script_Shooting_Hooks

Code: [Select]
hook_shoot

Executes very shortly before the shutter would open, in wait_until_remote_button_is_released (prior to the actual remote check)

&
Code: [Select]
hook.continue()
Allows the shooting process to continue from the hook point.


since we are not, in this case, waiting on a usb voltage transistion I assume
wait_until_remote_button_is_released is not involved in the ptp sync version. If that is the case is it safe to assume that once the hook has been released (and, for conversation only, assume that release time was the same instant on a host of cameras) there is no particular reason to expect very synchronised image capture by this method?

Re: USBremote - sync test issue
« Reply #6 on: 22 / October / 2017, 12:40:40 »
Yes, I had already tried one-push synch. It is in error on both A2500 &  SX150IS and on an SX220hs I have borrowed.
Please tell us in detail what happens when you test one-push sync.  Especially what is "in error".

Quote
Does Assembla allow you to view all the files and changes in any previous build? I vaguely remember something called trac did allow that.
assembla is the hosting site.   trac was a system for providing svn version control that assembla moved away from.

You can use standard svn commands to compare current and previous file versions. If sync is not working, the only likely candidate is the capt_seq.c file for each camera - the rest of the code is standard to all cameras and the most recent version still works correctly on my cameras.

Quote
Difficult to believe sync has never worked on these three cameras.
Sorry - I guess that suggests something in your test method or understanding of what is supposed to happen? You could try a 1.3 version just to be sure.

Quote
Perhaps not the best place to mention this but the issue above has made me realise i'm a bit confused about ptp sync via function:
<snip>
If that is the case is it safe to assume that once the hook has been released (and, for conversation only, assume that release time was the same instant on a host of cameras) there is no particular reason to expect very synchronised image capture by this method?
reyalp has been over the ptp sync accuracy assumptions many times so I won't comment or try to find links to the relevant posts.

EDIT :  I have assumed you are using a USB remote switch to toggle the +5V line to the camera's USB port.  Is that correct? In other words, you are not trying to use CHDKptp commands to shoot when you are testing?
« Last Edit: 22 / October / 2017, 13:08:13 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: USBremote - sync test issue
« Reply #7 on: 22 / October / 2017, 15:37:23 »
Quote
Difficult to believe sync has never worked on these three cameras.

True, since it has worked, as recorded in my test here:
https://chdk.setepontos.com/index.php?topic=6953.msg120316#msg120316
 
The latest issue reported as a problem seems to have been caused by the switch I was using. When I replace that with a powered hub with 5V port switch (not connected to PC) one & two push work fine on both SX150IS & A2500.

Thanks for SVN info.
 
I no longer have the SX220HS.

Apologies for red herring.


*

Offline reyalp

  • ******
  • 11490
Re: USBremote - sync test issue
« Reply #8 on: 22 / October / 2017, 15:59:31 »
Does Assembla allow you to view all the files and changes in any previous build? I vaguely remember something called trac did allow that.
Yes, see
https://app.assembla.com/spaces/chdk/subversion/commits/list

If you actually check out the source with an svn client (I suggest tortoisesvn for windows) you will get much more flexible tools. View log to see a list of commits, "blame" on a file to see which revision last changed a particular line, and diff to compare versions.

Perhaps not the best place to mention this but the issue above has made me realise i'm a bit confused about ptp sync via function:
Code: [Select]
cmds.shoot_hook_sync() ->  hook_shoot.continue()
in multicam.lua

http://chdk.wikia.com/wiki/Script_Shooting_Hooks

Code: [Select]
hook_shoot

Executes very shortly before the shutter would open, in wait_until_remote_button_is_released (prior to the actual remote check)

&
Code: [Select]
hook.continue()
Allows the shooting process to continue from the hook point.


since we are not, in this case, waiting on a usb voltage transistion I assume
wait_until_remote_button_is_released is not involved in the ptp sync version.
This is not correct. hook_shoot is called from wait_until_remote_button_is_released (AKA "the remote hook"), immediately before where the hardware remote check is done. The name is somewhat misleading because it predates the introduction of the Lua hooks.

The lower precision shoot_hook sync vs hardware remote is due to the fact that Lua doesn't have access to high precision timing and implementation details of how various parts of the process are scheduled and coordinated between tasks.
Don't forget what the H stands for.

Re: USBremote - sync test issue
« Reply #9 on: 23 / October / 2017, 09:08:07 »

This is not correct.

Ok - let me see if I do understand that:


A few notes:
The "remote" hook runs before the actual wait for the remote signal. I'm not sure if it would ever make sense to use the actual remote with this hook


So, in multicam.lua  function cmds.shoot_hook_sync()
Code: [Select]
wait_tick(tonumber(mc.args))
hook_shoot.continue()

just continues the shooting process, after
hook_shoot.continue(), never entering the tight loop which monitors the fall of the 5V->0V on the usb line ... seems obvious (since there's no 5V line involved) but I have to ask? ::)

i.e. the time between the hook_shoot.continue and the start of exposure (over many repetitions) is likely to have much greater difference (between the lowest & greatest of those times) than the variability reported here (camera dependent), for the red "sync" case, between the fall of the usb line to 0V & exposure start:

https://chdk.setepontos.com/index.php?topic=8312.msg107601#msg107601

In that experiment:
sync variability was, say 62-40 = 22ms
&
no sync variability was, say 106-78 = 28ms

Or, could the inclusion of the
hook_shoot.continue be expected to improve upon (or worsen) the 28ms "no sync" variability?   

Thanks for svn info.


« Last Edit: 23 / October / 2017, 09:35:17 by andrew.stephens.754365 »

 

Related Topics