Video timer theory

318 views
Skip to first unread message

g3gg0

unread,
Feb 21, 2012, 6:47:53 PM2/21/12
to Magic Lantern firmware development
well, for documentation purpose i ask this on the public mailing list
instead of asking alex directly :)
maybe others can contribute too or have some ideas.

background:
https://magiclantern.wikia.com/wiki/VideoTimer
i dumped the tables that contain timer values for frame rate
generation.
alex found the exact timer frequency that is used to calculate frame
rate.

Values for 60D:
#define TG_FREQ_PAL 50000000
#define TG_FREQ_NTSC_FPS 52747200
#define TG_FREQ_NTSC_SHUTTER 49440000

Values for 5D2:
#define TG_FREQ_PAL 40000000
#define TG_FREQ_NTSC_FPS 41328630
#define TG_FREQ_NTSC_SHUTTER 39300000

based on this frequency we are able to alter the timers that trigger
cmos read etc.
*but* - it is still no clear where these frequencies come from.
they are different for NTSC and shutter etc.
maybe we want to alter this frequency too, to get other frame rates
which are not possible yet.


okay, i have an idea:
0xC0F06008, +0x0C, +0x10 are written with values like 0x221, 0x23F etc
on 600D
0x23F = PAL/PAL_DZ, 0x221 = NTSC, 0x23B = NTSC_DZ, 0x2DD = ?, 0x19F
= ?, 0x1C1 = ?

50.000.000 Hz * (0x23F + 1) = 28.800.000.000 Hz (haha... 28GHz...
thats just math of course. in real world they have for sure a 28.8 MHz
clock)
28.800.000.000 Hz / (0x221 + 1) = 52.747.252 Hz (okay, we are 52 Hz
off alex' calcuation. not too bad)

results in short:
0x23F = 50.000.000 Hz (would match)
0x221 = 52.747.252 Hz (would match)
0x23B = 50.349.650 Hz (?)
0x2DD = 39.344.262 Hz (?)
0x19F = 69.230.769 Hz (?)
0x1C1 = 64.000.000 Hz (?)

can you check this for 5D2, 60D etc?
until now, i see no reason why this should be wrong.

if it fits for all other cameras... well.. we can get a lot of finer
fps tuning possibilities :)


how to find the table that contains these values (600D)

FF282178 str_SDRV_StartupDevice
FF282178 10 40 2D E9 STMFD SP!, {R4,LR}
FF28217C 00 40 A0 E1 MOV R4, R0
FF282180 00 00 A0 E3 MOV R0, #0
FF282184 5B 2F 8F E2 ADR R2, aSdrv_startupdevic ;
"SDRV_StartupDevice"
FF282188 03 10 A0 E3 MOV R1, #3
FF28218C 81 B0 F7 EB BL DryosDebugMsg
FF282190 98 41 05 EB BL engio_write_some
FF282194 34 00 94 E5 LDR R0, [R4,#0x34] ; load
video mode id
FF282194 ; 1 = 25
fps
FF282194 ; 0 = 24
fps
FF282194 ; 4 = 50
fps
FF282194 ; 8 = 25
fps zoomed
FF282194 ; 7 = 24
fps zoomed
FF282198 6D 41 05 EB BL write_res_timers_etc
<-- in here the table with element size 0x14 is dereferenced








g3gg0

unread,
Feb 21, 2012, 7:00:12 PM2/21/12
to Magic Lantern firmware development

> in real world they have for sure a 28.8 MHz clock

well, forget that 28.8 MHz as number. replace it with "for sure a few
MHz" ;)
(multiplied using a PLL etc)

xaos

unread,
Feb 22, 2012, 7:26:08 AM2/22/12
to ml-d...@googlegroups.com
LV mode, canon 60d (values inside table are decimal):
0xC0F060xx 04 08 0c 10 14 18 1c 20 24 28
2c 30 34 38 3c
1920/25 0/1 575/575 575/575 0/575 0/1999 0/32 0/0 0/2 0/0 0/0 0/0
0/0 0/0 0/0 0/0
1920/24 0/1 545/545 545/545 0/545 0/2199 0/32 0/0 0/2 0/0 0/0 0/0
0/0 0/0 0/0 0/0
1280/50 0/1 575/575 575/575 0/575 0/999 0/32 0/0 0/2 0/0 0/0 0/0
0/0 0/0 0/0 0/0
640/50 0/1 575/575 575/575 0/575 0/999 0/32 0/0 0/2 0/0 0/0 0/0
0/0 0/0 0/0 0/0
640+/50 0/1 449/449 449/449 0/449 0/1279 0/32 0/0 0/2 0/0 0/0 0/0
0/0 0/0 0/0 0/0

> --
> http://magiclantern.wikia.com/
>
> To post to this group, send email to ml-d...@googlegroups.com
> To unsubscribe from this group, send email to ml-devel+u...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/ml-devel?hl=en

Giovanni Di Cello

unread,
Feb 22, 2012, 11:18:08 AM2/22/12
to Magic Lantern firmware development
Do you need any value from my 50D?
I can provide them while recording.

g3gg0

unread,
Feb 22, 2012, 12:38:17 PM2/22/12
to Magic Lantern firmware development
yeah i need the values that are written to 0xC0F06008, +0x0C, +0x10.
they will be all the same i think. (16 bit values)

thanks :)


On 22 Feb., 17:18, Giovanni Di Cello <giovannidice...@gmail.com>
wrote:

Giovanni Di Cello

unread,
Feb 22, 2012, 1:15:35 PM2/22/12
to Magic Lantern firmware development
2b702b7, 2b702b7, 2b7 respectively.
Anything else?
;)

Giovanni Di Cello

unread,
Feb 22, 2012, 1:55:43 PM2/22/12
to Magic Lantern firmware development
695 is the 16-bit value you wanted, right?
;)

g3gg0

unread,
Feb 22, 2012, 2:19:55 PM2/22/12
to Magic Lantern firmware development
0x02B7 is already the right one. thanks!
for which mode is this? are there different fps modes? PAL/NTSC/other
resolutions? digital zoom?

if this camera would have the same input clock, this would represent
41.379.310 Hz
and this is nearly TG_FREQ_NTSC_FPS 41328630 on 5D2. close. but not
exactly. :(
maybe this is just a random hit.

On 22 Feb., 19:55, Giovanni Di Cello <giovannidice...@gmail.com>
wrote:

Giovanni Di Cello

unread,
Feb 22, 2012, 2:25:45 PM2/22/12
to Magic Lantern firmware development
It doesn't change when in NTSC.
It changes to 27b027b when in x5 and x10 digital zoom.
The same applies for 640*480.
;)

g3gg0

unread,
Feb 22, 2012, 2:41:14 PM2/22/12
to Magic Lantern firmware development
550D v1.0.9 has these values in firmware image at 0x53CAC0:
0x221, 0x23F, 0x2DD, 0x19F, 0x1C1
so its the same as in 600D.

my theory was that the 5 values give the divider for HEAD1-4 and the
FPS timer.
hmmm. would have to check the VideoTimer table and calc FPS from it.

g3gg0

unread,
Feb 23, 2012, 5:59:42 PM2/23/12
to Magic Lantern firmware development
any values for 5D2 available?

Giovanni Di Cello

unread,
Feb 23, 2012, 6:22:57 PM2/23/12
to Magic Lantern firmware development
I guess the guys are too afraid of putting their 5DII to work.

TOM_M

unread,
Feb 24, 2012, 9:35:13 AM2/24/12
to Magic Lantern firmware development
Ive done some of the digic brute force tests but im not sure exactly
what i need to do for this... i have a 550d and a 5d Mkii.
If you explain to me what i need to do -as if i was an idiot - then i
will do it on my 5d Mkii for you.

:-)

Giovanni Di Cello

unread,
Feb 24, 2012, 9:51:46 AM2/24/12
to Magic Lantern firmware development
Provide g3ggo with the values at 0xC0F060xx, offsets 08, 0C, 10.
;)

TOM_M

unread,
Feb 24, 2012, 9:56:11 AM2/24/12
to Magic Lantern firmware development
the numbers that cycle as i hold the shutter?

Should i be recording at the same time?


On Feb 24, 2:51 pm, Giovanni Di Cello <giovannidice...@gmail.com>
wrote:

g3gg0

unread,
Feb 24, 2012, 10:07:02 AM2/24/12
to Magic Lantern firmware development
no, the numbers should only change when selecting a different video
mode.

where do you read them from? from cached addresses?

BR,
g3gg0

TOM_M

unread,
Feb 24, 2012, 10:10:09 AM2/24/12
to Magic Lantern firmware development
Apologies for me not understanding.

At the moment, when i select a value to test using Digic Poke, i hold
the shutter button in live view and it cycles through various values
until i release the shutter and it stops testing. The values are read
from the screen.

Sorry for being a bit thick, i really just want to help :-)

Giovanni Di Cello

unread,
Feb 24, 2012, 10:11:56 AM2/24/12
to Magic Lantern firmware development
Nope.
DIGIC poke is to alter the values for that particular register but you
can also just read a register's value.
Enter Live View, enable DIGIC poke and go to:
Family:0xC0F0
Base:0x60
Family:0x8
Then, go back to LV and read the hex value which is the upper one in
the frame:
http://dl.dropbox.com/u/1087972/ML/value.jpg
I circled the value for you, that's register C0F06008.
Do the same for the other 2 registers.
Do the same again for each resolution and FPS you might have on 5DII
and 550D.
Is that clear enough?
;)

Giovanni Di Cello

unread,
Feb 24, 2012, 10:16:55 AM2/24/12
to Magic Lantern firmware development
DON'T push the shutter button as it CHANGES the value of the register.
g3gg0 needs the actual value being used by Canon.
;)

TOM_M

unread,
Feb 24, 2012, 10:17:08 AM2/24/12
to Magic Lantern firmware development
That all makes perfect sense, except on my 550d (making sure i know
what im doing on this one before testing it on the 5d)
Nothing appears until i hold the shutter. Your screenshot shows more
info than i seem to be getting on my camera...

While i wait for your next response i will try to make sure i have the
latest build....



On Feb 24, 3:11 pm, Giovanni Di Cello <giovannidice...@gmail.com>
wrote:

Giovanni Di Cello

unread,
Feb 24, 2012, 10:21:06 AM2/24/12
to Magic Lantern firmware development
It doesn't show up because you have to make it come up.
Just use the joystick to cycle through the three values.

TOM_M

unread,
Feb 24, 2012, 10:22:17 AM2/24/12
to Magic Lantern firmware development
Bingo!

Right i shall do it right away on my 5d, please cross your fingers
that my camera survives!

:-)



On Feb 24, 3:21 pm, Giovanni Di Cello <giovannidice...@gmail.com>
wrote:

Giovanni Di Cello

unread,
Feb 24, 2012, 10:23:16 AM2/24/12
to Magic Lantern firmware development
It will.
There's nothing wrong with this procedure.
;)

TOM_M

unread,
Feb 24, 2012, 10:32:35 AM2/24/12
to Magic Lantern firmware development
on a 5d Mkii:

1920x1024 24fps

08 23b023b
=37421627
=571 571
=2 59 2 59

0c 23b023b
=37421627
=571 571
=2 59 2 59

10 23b
=571
=0 571
0 0 2 59


1920x1080 30fps

08 23b023b
=37421627
=571 571
=2 59 2 59

0c 23b023b
=37421627
=571 571
=2 59 2 59

10 23b
=571
=0 571
0 0 2 59

1920x1080 25fps

08 2570257
=39256663
=599 599
=2 87 2 87

0c 2570257
=39256663
=599 599
=2 87 2 87

10 257
=599
=0 599
0 0 2 87


is this all the required info?

g3gg0

unread,
Feb 24, 2012, 10:36:54 AM2/24/12
to Magic Lantern firmware development
perfect, thanks!
will analyze later when i am back home :)

TOM_M

unread,
Feb 24, 2012, 10:39:40 AM2/24/12
to Magic Lantern firmware development
Excellent, you're welcome

sorry for being such a n00b ;-)

Alex

unread,
Feb 24, 2012, 11:10:10 AM2/24/12
to ml-d...@googlegroups.com
Changing C0F06008 does alter FPS, but unlike previous method (C0F06014), this one also increases the amount of rolling shutter.

Moreover, these two methods for changing FPS can be combined, so you can get easily 0.2 fps or maybe even less (I believe 0.1 fps is also possible). That's really extreme low light capability!

Great find!

Also, g3gg0's math is valid on 5D2 too.

Some code for the impatient:

void run_test()
{
    EngDrvOut(0xC0F06008, 0x20002000);
    EngDrvOut(0xC0F06000, 1);
}

and optionally enable FPS override from the menu.


g3gg0

unread,
Feb 24, 2012, 12:23:54 PM2/24/12
to Magic Lantern firmware development
yeah, cool.

didn't calc the frequencies, but if you say it is correct i will
believe ;)
thanks to all contributors for input data and thanks alex for
validation :)

so it seems now we can have a) lower frame rates and b) absolute
control over the *exact* frame rate.

alex, i guess the timer values are five 16 bit dividers for different
timers like HEAD1-4 and FPS timer and they should all be updated all
together.
there is a structure in memory for every video mode that could be
patched once. i think i mailed it to you some days ago.

maybe its a good idea to look up that structure and patch that. not
sure when the registers are rewritten.

most of the 16 bit timer registers have a maximum value of 0x3FFF.

Alex

unread,
Feb 24, 2012, 2:09:36 PM2/24/12
to ml-d...@googlegroups.com
Yes, this will probably make possible 24.000 fps (instead of 23.976), among others. Need to figure out the math first.

I've tried to alter rolling shutter (that's doubling the value in one register and halving the value in the other), but didn't get meaningful results.

There's one more mystery left: the divider for NTSC shutter timers. Probably it's in some different register range.

For those who would like to play with DIGIC poke and extremely low FPS:
1) start recording
2) set C0F06008 to something ending in 0x1xxx
3) set C0F06000 to something nonzero
4) enable FPS override

Giovanni Di Cello

unread,
Feb 24, 2012, 2:38:18 PM2/24/12
to Magic Lantern firmware development
What about higher fps?
Will this help?

g3gg0

unread,
Feb 24, 2012, 4:03:00 PM2/24/12
to Magic Lantern firmware development
these registers *are* the key to NTSC/PAL clocks :)

lets look at what i mean on my 600D:

25 FPS mode has at +0x14 the value 0x07D0 and at +0x08 it has 0x23F
24 FPS mode has at +0x14 the value 0x0898 and at +0x08 it has 0x221

0x07D0 * (0x23F + 1) * 25.000 = 28.800.000 Hz
0x0898 * (0x221 + 1) * 23.976 = 28.799.971 Hz

so the reference clock *is* 28.8MHz on 600D as i guessed in my first
post.

@TOM_M:
can you also dump the contents of +0x14?

g3gg0

unread,
Feb 24, 2012, 4:09:41 PM2/24/12
to Magic Lantern firmware development
ouch, you mean shutter timers.
i misread your post, sorry :)

TOM_M

unread,
Feb 24, 2012, 4:23:35 PM2/24/12
to Magic Lantern firmware development
on 5d mkii

1920x1080 30fps

c0f06014: 577
=1399
=0 1399
=0 0 5 119

1920x1080 24fps
c0f06014: 6d5
=1749
=0 1749
=0 0 6 -43

1920x1080 25fps
c0f06014: 63f
=1599
=0 1599
=0 0 6 63

do you need 640x480 also?

Giovanni Di Cello

unread,
Feb 24, 2012, 4:39:13 PM2/24/12
to Magic Lantern firmware development
On the 50D offset 0x14 has a hex value of 563

g3gg0

unread,
Feb 24, 2012, 5:17:56 PM2/24/12
to Magic Lantern firmware development
i made a public spreadsheet with all known timer values for the
cameras.
purple is INPUT DATA. i made it to calculate the base clock frequency
for every camera.
when we find the correct frequency, it can be entered in "Exact Base"
and the exact FPS will be shown.

https://docs.google.com/spreadsheet/ccc?pli=1&key=0AgQ2MOkAZTFHdEZrXzBSZmdaSE9WVnpOblJ2ZGtoZXc#gid=0

do you agree with the exact FPS printed there?


On 24 Feb., 22:39, Giovanni Di Cello <giovannidice...@gmail.com>
wrote:

TOM_M

unread,
Feb 24, 2012, 5:35:54 PM2/24/12
to Magic Lantern firmware development
would you like the values from a 550d?


On Feb 24, 10:17 pm, g3gg0 <g3gg0...@gmail.com> wrote:
> i made a public spreadsheet with all known timer values for the
> cameras.
> purple is INPUT DATA. i made it to calculate the base clock frequency
> for every camera.
> when we find the correct frequency, it can be entered in "Exact Base"
> and the exact FPS will be shown.
>
> https://docs.google.com/spreadsheet/ccc?pli=1&key=0AgQ2MOkAZTFHdEZrXz...

g3gg0

unread,
Feb 24, 2012, 5:38:19 PM2/24/12
to Magic Lantern firmware development
yeah it will help for documenting :)
can you dump them for all modes?

thanks!

Giovanni Di Cello

unread,
Feb 24, 2012, 5:42:21 PM2/24/12
to Magic Lantern firmware development
The 50D records at 30fps, not 25.
;)

g3gg0

unread,
Feb 24, 2012, 5:45:21 PM2/24/12
to Magic Lantern firmware development
ok, updated

On 24 Feb., 23:42, Giovanni Di Cello <giovannidice...@gmail.com>
wrote:

TOM_M

unread,
Feb 24, 2012, 6:06:23 PM2/24/12
to Magic Lantern firmware development
For 550d

1920x1080 24fps

08 2210221
=35717665
=545 545
=2 33 2 33

0c 2210221
=35717665
=545 545
=2 33 2 33

10 221
=545
=0 545
=0 0 2 33

14 897
=2199
=0 2199
=0 0 8 -105

1920x1080 25fps

08 23f023f
=37683775
=575 575
=2 63 2 63

0c 23f023f
=37683775
=575 575
=2 63 2 63

10 23f
=575
=0 575
=0 0 2 63

14 7cf
=1999
=0 1999
=0 0 7 -49

1920x1080 30fps

08 2210221
=35717665
=545 545
=2 33 2 33

0c 2210221
=35717665
=545 545
=2 33 2 33

10 221
=545
=0 545
=0 0 2 33

14 6df
=1759
=0 1759
=0 0 6 -33

1280x720 50fps

08 23f023f
=37683775
=575 575
=2 63 2 63

0c 23f023f
=37683775
=575 575
=2 63 2 63

10 26f
=575
=0 575
=0 0 2 63

14 3e7
=999
=0 999
=0 0 3 -25

1280x720 60fps

08 2210221
=35717665
=545 545
=2 33 2 33

0c 2210221
=35717665
=545 545
=2 33 2 33

10 221
=545
=0 545
=0 0 2 33

14 36f
=879
=0 879
=0 0 3 111

640x480 50fps

08 23f023f
=37683775
=575 575
=2 63 2 63

0c 23f023f
=37683775
=575 575
=2 63 2 63

10 23f
=575
=0 575
=0 0 2 63

14 20
=999
=0 999
=0 0 3 -25

640x480 60fps

08 2210221
=35717665
=545 545
=2 33 2 33

0c 2210221
=35717665
=545 545
=2 33 2 33

10 221
=545
=0 545
=0 0 2 33

14 36f
=879
=0 879
=0 0 3 111

640x480 CROP 50fps

08 1c101c1
=29426113
=449 449
=1 -63 1 -63

0c 1c101c1
=29426113
=449 449
=1 -63 1 -63

10 1c1
=449
=0 449
=0 0 1 -63

14 4ff
=1279
=0 1279
=0 0 4 -1

640x480 CROP 60fps

08 19f019f
=27197855
=415 415
=1 -97 1 -97

0c 19f019f
=27197855
=415 415
=1 -97 1 -97

10 19f
=415
=0 415
=0 0 1 -97

14 482
=1154
=0 1154
=0 0 4 -126

TOM_M

unread,
Feb 24, 2012, 6:07:53 PM2/24/12
to Magic Lantern firmware development
Also, when testing 24fps it was set to ntsc not pal.

Francis Danforth

unread,
Feb 24, 2012, 6:28:11 PM2/24/12
to Magic Lantern firmware development
Wow, great work! I'll have to look back on the other thread to see how
I can help with the registers research.

TOM_M

unread,
Feb 24, 2012, 6:33:53 PM2/24/12
to Magic Lantern firmware development
FOR A 5D MKii


640x480 30fps

08 23b023b
=37421627
=571 571
=2 59 2 59

0c 23b023b
=37421627
=571 571
=2 59 2 59

10 23b
=571
=0 571
=0 0 2 59

14 577
=1399
=0 1399
=0 0 5 119

640x480 25fps

08 2570257
=39256663
=599 599
=2 87 2 87

0c 2570257
=39256663
=599 599
=2 87 2 87

10 257
=599
=0 599
=0 0 2 87

14 63f

g3gg0

unread,
Feb 24, 2012, 7:25:04 PM2/24/12
to Magic Lantern firmware development
thanks for the contribution :)
now the spreadsheet looks a lot better.

i wonder about 0xC0F06088....
it contains vertical resolution and some counter-like value..
(see https://magiclantern.wikia.com/wiki/Register_Map )

BR,
g3gg0

g3gg0

unread,
Feb 24, 2012, 7:51:23 PM2/24/12
to Magic Lantern firmware development
i am not perfectly sure, but it looks like the ADTG is responsible for
shutter timing.

see FF3D1B14 int __stdcall cmos_adtg_set_params(int cmd) (600D
v1.0.1)

ROM:FF3D1FBC B6 00 D4 E1 LDRH R0, [R4,#6] ;
load exposure time
ROM:FF3D1FC0 50 10 96 E5 LDR R1, [R6,#0x50]
ROM:FF3D1FC4 00 00 41 E0 SUB R0, R1, R0 ;
image rate timer - exposure timer value
ROM:FF3D1FC8 01 00 40 E2 SUB R0, R0, #1 ; -1
ROM:FF3D1FCC A8 35 FC EB BL
some_xor_transformation
ROM:FF3D1FD0 38 10 96 E5 LDR R1, [R6,#0x38] ;
0x4069483C
ROM:FF3D1FD4 00 08 A0 E1 MOV R0, R0,LSL#16
ROM:FF3D1FD8 98 24 91 E5 LDR R2, [R1,#0x498] ;
replace lower 16 bits
ROM:FF3D1FDC 20 08 A0 E1 MOV R0, R0,LSR#16
ROM:FF3D1FE0 22 28 A0 E1 MOV R2, R2,LSR#16
ROM:FF3D1FE4 02 28 A0 E1 MOV R2, R2,LSL#16
ROM:FF3D1FE8 00 20 82 E1 ORR R2, R2, R0
ROM:FF3D1FEC 98 24 81 E5 STR R2, [R1,#0x498]
ROM:FF3D1FF0 9C 24 91 E5 LDR R2, [R1,#0x49C] ;
there also
ROM:FF3D1FF4 22 28 A0 E1 MOV R2, R2,LSR#16
ROM:FF3D1FF8 02 28 A0 E1 MOV R2, R2,LSL#16
ROM:FF3D1FFC 00 00 82 E1 ORR R0, R2, R0
ROM:FF3D2000 9C 04 81 E5 STR R0, [R1,#0x49C]
ROM:FF3D2004 01 1B 81 E2 ADD R1, R1, #0x400
ROM:FF3D2008 98 10 81 E2 ADD R1, R1, #0x98 ;
data
ROM:FF3D200C 02 00 A0 E3 MOV R0, #2 ; cs
ROM:FF3D2010 B7 2B FC EB BL ADTG_Write ;
0x40694CD4


On 24 Feb., 20:09, Alex <broscutama...@gmail.com> wrote:

g3gg0

unread,
Feb 24, 2012, 8:06:44 PM2/24/12
to Magic Lantern firmware development
some_xor_transformation means NRZI-encode :)

Giovanni Di Cello

unread,
Feb 24, 2012, 8:14:40 PM2/24/12
to Magic Lantern firmware development
Looks interesting.
43C0385 is the value at 0x88 for the 50D.
;)

pip

unread,
Feb 25, 2012, 3:46:56 AM2/25/12
to Magic Lantern firmware development
Hi guys great work am i right n thinking this info will also help in
getting crop zoom working on all cameras too or is it just wishfull
thinking on my part ??

On Feb 25, 1:14 am, Giovanni Di Cello <giovannidice...@gmail.com>
wrote:

g3gg0

unread,
Feb 25, 2012, 3:55:29 AM2/25/12
to Magic Lantern firmware development
this is all still about clocks only.
how to generate clocks for a desired frame rate easily.

-> FPS tuning only

Huey Lee

unread,
Feb 25, 2012, 4:18:07 AM2/25/12
to ml-d...@googlegroups.com
Hi guys, just like Tom, I'd love to help out testing for 5D2 too. Can you please give me specific instructions and let me know if you guy want to test anything on 5D2. Thanks

Matthias_...@t-online.de

unread,
Feb 25, 2012, 4:56:43 AM2/25/12
to ml-d...@googlegroups.com
 Hi, I had been testing the video timing of a couple of 5dII last year for 3d-work.... they never ran in sync :-( I tested them on the oscilloscope so can be sure that the results are true as well as in real life where one would run about a frame faster per 2 minutes then the other.
How fine do you think could the timing be adjusted now with all these findings ? Could we sync a couple of 550's decently or are the parameters that can be adjusted not so fine  tuneable ?
a very curious Matthias

Nyax

unread,
Feb 25, 2012, 11:56:08 AM2/25/12
to Magic Lantern firmware development
Hi !
Values for the 500D if you need it :

1080p, 20fps

0x08 : 50f050f
0x0C : 50f050f
0x10 : 50f

720p, 30fps & 640*480, 30fps :

0x08 : 5630563
0x0C : 5630563
0x10 : 563

With x5 or x10 zoom (same values for all modes) :

0x08 : 58f058f
0x0C : 58f058f
0x10 : 58f

I got the same values for both PAL and NTSC.

g3gg0

unread,
Feb 25, 2012, 4:21:09 PM2/25/12
to Magic Lantern firmware development
i made a quick tool to go through all possible modes to find the
nearest FPS variants.
here a screenshot of the possible granularity.

http://666kb.com/i/c1kkhghkndcr3c2fz.png
the next neighbors to 24 fps (23,97602397) are
-0,00014371 fps
0,00004790 fps

this would be up to 5.8 frames per hour granularity. at least in
theory.
this is all far beyond any crystal accuracy, so we would have to test
if this makes any difference at all.
if your crystal is really constantly is off a few frames per minute
(in average) this might help you.


On 25 Feb., 10:56, "Matthias_von_Mut...@t-online.de"

g3gg0

unread,
Feb 25, 2012, 6:57:23 PM2/25/12
to Magic Lantern firmware development
i uploaded it here http://g3gg0.de/projects/EOSTimerGen/

its a simple .NET 3.5 program
Message has been deleted

Giovanni Di Cello

unread,
Feb 25, 2012, 8:08:28 PM2/25/12
to Magic Lantern firmware development
Can i use these values, how?

M.v.M.

unread,
Feb 26, 2012, 5:15:00 AM2/26/12
to ml-d...@googlegroups.com
 
Hi and vielen Dank f�r das Tool,
 I saw my cameras drift away constantly at the same amount over time, so being able to correct this will be super important for Stereo3d. I have build a small hardware that compares the sync of the video out of the cameras, this is looking for the sync-pulse, so next would be to reenable the video-out in F-BAS from either 5DII or one of the T-models. My conclusions from last years tests were that the video-out and the actual video recording is reliably correlated, I checked with recording video-out externally and putting the files of external and internal recording on the same timeline as two images on the same canvas. So this looks really promising...

Danke f�r die Arbeit/ Thanks for your work and thanks for reading

Matthias

g3gg0

unread,
Feb 26, 2012, 7:23:36 AM2/26/12
to Magic Lantern firmware development
this means, you are able to measure the real sync pulse frequency?
sounds helpful :)

@Giovanni:
not yet, i am sure that alex is already working on something :)


On 26 Feb., 11:15, "M.v.M." <Matthias_von_mut...@t-online.de> wrote:
> Hi and vielen Dank f�r das Tool,
>  I saw my cameras drift away constantly at the same amount over time, so
> being able to correct this will be super important for Stereo3d. I have
> build a small hardware that compares the sync of the video out of the
> cameras, this is looking for the sync-pulse, so next would be to
> reenable the video-out in F-BAS from either 5DII or one of the T-models.
> My conclusions from last years tests were that the video-out and the
> actual video recording is reliably correlated, I checked with recording
> video-out externally and putting the files of external and internal
> recording on the same timeline as two images on the same canvas. So this
> looks really promising...
>
> Danke f�r die Arbeit/ Thanks for your work and thanks for reading
>
> Matthias

TOM_M

unread,
Feb 26, 2012, 8:09:38 AM2/26/12
to Magic Lantern firmware development
I have an oscilloscope...if it helps and you know how i could use it
to measure the sync pulse, i'll gladly use it on my cameras and
provide the results.

g3gg0

unread,
Feb 26, 2012, 8:14:45 AM2/26/12
to Magic Lantern firmware development
ah ok now i understand. you measure the FBAS bursts.
if you change the camera FPS, will it affect the FBAS signal at all?
did you check that?

g3gg0

unread,
Feb 26, 2012, 2:12:26 PM2/26/12
to Magic Lantern firmware development
to all that are still willing to help :)

can you open the spreadsheet again and look closer at the table to the
right?
0xC0F06088 0xC0F0713C 0xC0F07150

the last two registers control some interrupts that happen per frame
to update some parameters etc.
if we are tuning fps more than now, we need to patch them too. but for
that we have to know what they do.
also the first register - it is related to vertical resolution and
some divider.

lets fill these values so we have an idea what we have to touch.

thanks again :)

On 22 Feb., 00:47, g3gg0 <g3gg0...@gmail.com> wrote:
> well, for documentation purpose i ask this on the public mailing list
> instead of asking alex directly :)
> maybe others can contribute too or have some ideas.
>
> background:https://magiclantern.wikia.com/wiki/VideoTimer
> i dumped the tables that contain timer values for frame rate
> generation.
> alex found the exact timer frequency that is used to calculate frame
> rate.
>
> Values for 60D:
>     #define TG_FREQ_PAL  50000000
>     #define TG_FREQ_NTSC_FPS 52747200
>     #define TG_FREQ_NTSC_SHUTTER 49440000
>
> Values for 5D2:
>     #define TG_FREQ_PAL  40000000
>     #define TG_FREQ_NTSC_FPS 41328630
>     #define TG_FREQ_NTSC_SHUTTER 39300000
>
> based on this frequency we are able to alter the timers that trigger
> cmos read etc.
> *but* - it is still no clear where these frequencies come from.
> they are different for NTSC and shutter etc.
> maybe we want to alter this frequency too, to get other frame rates
> which are not possible yet.
>
> okay, i have an idea:
> 0xC0F06008, +0x0C, +0x10 are written with values like 0x221, 0x23F etc
> on 600D
> 0x23F = PAL/PAL_DZ, 0x221 = NTSC, 0x23B = NTSC_DZ, 0x2DD = ?, 0x19F
> = ?, 0x1C1 = ?
>
> 50.000.000 Hz * (0x23F + 1) = 28.800.000.000 Hz  (haha... 28GHz...
> thats just math of course. in real world they have for sure a 28.8 MHz
> clock)
> 28.800.000.000 Hz / (0x221 + 1) = 52.747.252 Hz (okay, we are 52 Hz
> off alex' calcuation. not too bad)
>
> results in short:
> 0x23F = 50.000.000 Hz (would match)
> 0x221 = 52.747.252 Hz (would match)
> 0x23B = 50.349.650 Hz (?)
> 0x2DD = 39.344.262 Hz (?)
> 0x19F = 69.230.769 Hz (?)
> 0x1C1 = 64.000.000 Hz (?)
>
> can you check this for 5D2, 60D etc?
> until now, i see no reason why this should be wrong.
>
> if it fits for all other cameras... well.. we can get a lot of finer
> fps tuning possibilities :)
>
> how to find the table that contains these values (600D)
>
> FF282178             str_SDRV_StartupDevice
> FF282178 10 40 2D E9                 STMFD   SP!, {R4,LR}
> FF28217C 00 40 A0 E1                 MOV     R4, R0
> FF282180 00 00 A0 E3                 MOV     R0, #0
> FF282184 5B 2F 8F E2                 ADR     R2, aSdrv_startupdevic ;
> "SDRV_StartupDevice"
> FF282188 03 10 A0 E3                 MOV     R1, #3
> FF28218C 81 B0 F7 EB                 BL      DryosDebugMsg
> FF282190 98 41 05 EB                 BL      engio_write_some
> FF282194 34 00 94 E5                 LDR     R0, [R4,#0x34]  ; load
> video mode id
> FF282194                                                     ; 1 = 25
> fps
> FF282194                                                     ; 0 = 24
> fps
> FF282194                                                     ; 4 = 50
> fps
> FF282194                                                     ; 8 = 25
> fps zoomed
> FF282194                                                     ; 7 = 24
> fps zoomed
> FF282198 6D 41 05 EB                 BL      write_res_timers_etc
> <-- in here the table with element size 0x14 is dereferenced

g3gg0

unread,
Feb 26, 2012, 2:39:32 PM2/26/12
to Magic Lantern firmware development
hi TPM_M,

can you confirm or correct these values?

640x480 30fps

+0x10 23b
+0x14 577

they result in a frame rate of 35.96 fps.
is it possible that it was 0x06D5 instead of 0x577 ?

BR,
g3gg0

On 25 Feb., 00:33, TOM_M <duopho...@gmail.com> wrote:

TOM_M

unread,
Feb 26, 2012, 2:40:57 PM2/26/12
to Magic Lantern firmware development
Ive done the values for the 550d and 5dMkii. A lot of the same values
came up...hope this is correct...

g3gg0

unread,
Feb 26, 2012, 2:51:22 PM2/26/12
to Magic Lantern firmware development
okay its solved. my wrong :)
referred to the wrong clock -.-

xaos

unread,
Feb 26, 2012, 6:01:28 PM2/26/12
to ml-d...@googlegroups.com
Done for 0xC0F06088 0xC0F0713C 0xC0F07150:
http://magiclantern.wikia.com/wiki/Register_Map/60D/xaos

g3gg0

unread,
Feb 26, 2012, 6:57:37 PM2/26/12
to Magic Lantern firmware development
thanks.
looks absolutely the same like 550D

g3gg0

unread,
Feb 26, 2012, 7:41:43 PM2/26/12
to Magic Lantern firmware development
hmmm, not exactly.

on 60D the HEAD3->HEAD4 interrupt delay is always around 1.0ms
for 1920x1080 24fps its just 0.95, but 1.0 would have been possible if
they had tuned the values.
instead they took the same as for the 25 fps 1920 mode. very
interesting :)
maybe a (harmless) bug

compared to 600D and 60D, the 550D and 5DII have very weird HEAD3/4
timing parameters.
not sure whats the background behind this.

also 0xC0F06088 is still a riddle to me.
on 5DII and 500D 0xC0F06088 has the in upper 16 bit same value as
0xC0F0713C (minus one).
the other models have 0xC0F07150 (minus one)
EXCEPT 60D for crop modes. they totally differ.

@xaos: can you double-check all three register values for both 640+
modes?


well, now we still miss the 50D values for 0xC0F06088 0xC0F0713C
0xC0F07150.

Giovanni Di Cello

unread,
Feb 26, 2012, 8:20:25 PM2/26/12
to Magic Lantern firmware development
50D
c0f06088=43c0385
c0f0713c=440
c0f07150=500

xaos

unread,
Feb 27, 2012, 8:56:10 AM2/27/12
to ml-d...@googlegroups.com
On Mon, Feb 27, 2012 at 1:41 AM, g3gg0 <g3gg...@gmail.com> wrote:
(...)

> @xaos: can you double-check all three register values for both 640+
> modes?
(...)

Double check done, register values are correct.

Reply all
Reply to author
Forward
0 new messages