shooting script using Canon basic ? - page 6 - General Discussion and Assistance - CHDK Forum

shooting script using Canon basic ?

  • 51 Replies
  • 21319 Views
*

Offline srsa_4c

  • ******
  • 3815
Re: shooting script using Canon basic ?
« Reply #50 on: 15 / March / 2019, 15:19:03 »
Advertisements
I played something with the script today. It seems a timing problem. On the one hand I used a newer, faster SD card and put the camera on MF.
On the first run (only RAW), the camera took only three pictures :)
On the second and third runs the cam took 7 Pictures.
If I set the camera to only JPG, then the cam always make the 4 pictures (the first picture twice).
Have you tried only RAW?
I only made some test runs, nothing comprehensive.
It makes no sense trying the - obviously malfunctioning - script over and over again. It clearly needs to be changed or rewritten.

Quote
But basically, I still have problems starting scripts (like the firmware dump). I have the problem synonymous with the new SD card. Sometimes I have to start the camera 10 times. Is there a specific timing at power on?
I recall having problems starting scripts from time to time on various cameras. But unfortunately, I don't know what's behind that.

Quote
If there are threading problems like that maybe we can try to move some of the script's functionality to native code...
What does that mean?
The script relies on Canon Basic global variables that are written and read in different tasks. I have a feeling that this isn't working well enough, especially not on multiprocessor cameras.

The script has a main loop (mytask()) that runs in its own task.
The mycontroller() function is called from the firmware's CtrlSrv task, it is used for intercepting the keyboard.
The functions shoot_pre(), shoot_beforeexpo(), shoot_complete() are called from the firmware's shooting related tasks.

As a first try, global variables used in more than one task could be turned into pointers and they could point to a piece of memory that has no caching issues (uncached memory, for example).

If that's not enough, the functions listed above (those that run in firmware tasks) could be replaced with ARM code. But doing this is not trivial (loading code at runtime and making sure there are no caching and similar issues).

*

Offline reyalp

  • ******
  • 11747
Re: shooting script using Canon basic ?
« Reply #51 on: 15 / March / 2019, 16:01:15 »
As a first try, global variables used in more than one task could be turned into pointers and they could point to a piece of memory that has no caching issues (uncached memory, for example).
If this is the problem, the various semaphore etc functions are generally available as eventprocs. OTOH, if the script engine itself isn't thread safe that wouldn't help.
Don't forget what the H stands for.

 

Related Topics