FPS control - page 2 - General Discussion and Assistance - CHDK Forum

FPS control

  • 36 Replies
  • 8365 Views
*

Offline reyalp

  • ******
  • 11900
Re: FPS control
« Reply #10 on: 07 / April / 2013, 19:21:58 »
Advertisements
1) digic.lua: this one is for investigation - it will try to autodetect the memory area where DIGIC registers are mirrored (this is needed for reading the current values) and will save a log with all register values from the C0F0xxxx range. If you try it, I'd like to ask you to post the log file, it may be useful in better understanding the FPS timers.
Tried on a540 (digic II, vxworks), crashed with data abort in tPhySw, probably meaning the script ran off the end of ram. Faulting address probably 0x02006008

Quote
Known bug: the function "restore" in fps.lua doesn't get called when the script is interrupted (according to http://chdk.wikia.com/wiki/Script_commands#restore it should, not sure what's wrong)
restore needs to be defined before the script is interrupted, above the while loop.

edit:
D10 (digic IV) gives "DIGIC mirror not found :("
« Last Edit: 07 / April / 2013, 20:05:50 by reyalp »
Don't forget what the H stands for.

*

Offline genie

  • *
  • 43
Re: FPS control
« Reply #11 on: 08 / April / 2013, 02:23:08 »
Hi,

this is the log file for SX230HS 1.00c.
No errors.

genie
Sorry for my bad English.I am a Bavarian and German is the only foreign language i speak.

*

Offline a1ex

  • *****
  • 671
  • ML dev
Re: FPS control
« Reply #12 on: 08 / April / 2013, 03:23:46 »
Thanks for feedback.

On SX230, the relevant section is:
Code: [Select]
406008 c0f06008 => b0f0b0f
40600c c0f0600c => b0f0b0f
406010 c0f06010 => b0f
406014 c0f06014 => 2cf
so, timer A is 2832 and B is 720. The main clock should be timerA * timerB * FPS and it's usually a round value, but here I can't guess a good value. Do you know what FPS was used by Canon when you ran the script? (e.g. movie FPS selected in Canon menu if you ran it in movie mode)

On D10/A540, the autodetection didn't work (probably these cameras don't follow exactly the same pattern), but you can skip it.

On D10, try setting the DIGIC RAM mirror parameter to 56 (0x38), which can be found like this (I've used my decompiler):
Code: (python) [Select]
ffafd328: ffb4a5ab undefined instruction 0xffb4a5ab ; *'EngDrvOut'
ffafd32c: ffa06aa4 undefined instruction 0xffa06aa4 ; 0xffa06aa4: pointer to 0xe2801004

dec 0xffa06aa4
sub_FF822C7C(*(arg0), arg0->off_0x4, arg2, arg3)

dec sub_FF822C7C
*(OR(arg0, 0x380000)) = arg1
*(arg0) = arg1

On A540, the formula seems more complex:
Code: (python) [Select]
dec sub_FFC6F458
*(OR(BIC(BIC(arg0, 0xFF000000), 0xFE0000), 0x300000)) = arg1
*(arg0) = arg1
but it should work if you set the mirror address to 48 = 0x30.

Re: FPS control
« Reply #13 on: 08 / April / 2013, 09:51:49 »
Quote
Known bug: the function "restore" in fps.lua doesn't get called when the script is interrupted (according to http://chdk.wikia.com/wiki/Script_commands#restore it should, not sure what's wrong)
restore needs to be defined before the script is interrupted, above the while loop.
While I have no doubt that you are correct about this,  it seems strange.  As I understand it,  Lua compiles to an intermediate state (like the old p-code) before executing (hence the error message that pop up when you try to run a script with syntax mistakes).  Seems like it should be able to spot a restore() function and do something appropriate at that point?
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline reyalp

  • ******
  • 11900
Re: FPS control
« Reply #14 on: 08 / April / 2013, 13:04:59 »
@waterwingz
To avoid going OT: http://chdk.setepontos.com/index.php?topic=9607.msg99013#msg99013

@a1ex:
Thanks, I'll test those later when I have time.

edit:
attached
« Last Edit: 09 / April / 2013, 00:08:15 by reyalp »
Don't forget what the H stands for.

*

Offline a1ex

  • *****
  • 671
  • ML dev
Re: FPS control
« Reply #15 on: 09 / April / 2013, 12:04:53 »
Um... the FPS section is not in these logs. Probably the fps override does not work on these cameras?

You can try writing to the timer registers blindly, e.g. writing 5000 to C0F06014 and then 1 to C0F06001 should slow down the LiveView.

*

Offline reyalp

  • ******
  • 11900
Re: FPS control
« Reply #16 on: 09 / April / 2013, 15:50:17 »
Um... the FPS section is not in these logs. Probably the fps override does not work on these cameras?
I just blindly ran the script with the numbers you suggested. I'll try to have a more detailed look later.
Don't forget what the H stands for.

*

Offline genie

  • *
  • 43
Re: FPS control
« Reply #17 on: 10 / April / 2013, 05:20:48 »
Hi,

this is for SX230HS 1.00c.

Now i tried:

...
@param a Timer A
@default a 8
@param b Timer B
@default b 12
...
No errors.

...
@param a Timer A
@default a 9 or 10
...
Camera crash!

genie
Sorry for my bad English.I am a Bavarian and German is the only foreign language i speak.


*

Offline genie

  • *
  • 43
Re: FPS control
« Reply #18 on: 13 / April / 2013, 04:22:50 »
Hello a1ex,

do you continues the development of the FPS control?

If so, a problem is to find the correct values ​​for TimerA and TimerB.
Incorrect values ​​let the camera die.

Are you working on the script of funnel (fpscontrol.lua)?
Regarding timelapse, it should be possible to reduce FPS to one image every 3-4 seconds.
Sorry for my bad English.I am a Bavarian and German is the only foreign language i speak.

*

Offline a1ex

  • *****
  • 671
  • ML dev
Re: FPS control
« Reply #19 on: 13 / April / 2013, 05:53:01 »
I no longer have the compact camera, sorry.

 

Related Topics