DigicV "Fun Time" registers.

Started by 1%, March 21, 2013, 04:45:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

1%

So I did some digic poking, disappointed I still can't figure out what's crashing tether.

Found a couple of interesting things:

FPS override isn't calculating the timer A right. I can get very low fps (less than .2fps) without lines at least for a little bit. I can also crank it up to 60fps in 1080p but after 34 the image collapses. Timer B IS changeable.. it just gets reset right away. It lets you push fps further, both lower and higher.

Image effects are around c0f078XX... much weird stuff in there. Including one register that stretches out the image, almost like crop mode.



C0f0 787c - freeze lv - can swap YUV but img frozen
c0f0 7804 - Subtract to stretch image and change U/V
7884 - Color skips, can make blue DOF lines fucks with color, can pixelate, make purple
     7888 - horiz lines
     7814 - Change colors all crazy
     7824 - Magentas and greens
     782c - reds value was 100000
     7838 - Make everything purple.. .actually can pick red/other colors
c0f0 6008 - super low FPS .2 something - timer A, calculations wrong?
600C - same but for different mode I think
     6014 - Low FPS keeps getting reset Timer B
     6020 - Make everything flash like HDR video


So image effects on digicV do exist, just I'm not sure what does what yet.

The resizing effect

http://youtu.be/Q5D8JcgHJck


Tiles?

http://youtu.be/3h8C9Pn_nRg

c0f1 a01C - Looks like heat camera value = F

1%

http://pastebin.com/Z8cLxs1J

6D reg dump... now to compare with 600D and possibly see what moved where.

600D: http://pastebin.com/D9r439AM

a1ex

Timer A seems to go up to FFFF on 5D3, nice find. Probably on all digic V cameras.

For timer B, maybe we have to find out the moment when Canon changes it (so we can overwrite it right away). Either try making the engio calls from the EVF state object (it's likely that Canon code updates the timers there), or maybe CONFIG_FPS_AGGRESSIVE_UPDATE helps?

I'm not sure how to get rid of the vertical bars from timer A... tried a bunch of combinations on 5D3, but they still appear after a while.

1%

I was line free at .2fps then I press record and lines show up :(  But at least its possible to be line free somehow.

The other regs seem to do a LOT of stuff to color. Almost like you could make HW focus peaking or selective color.

Timer B setting does some trick with modes that is probably not possible with our different ones. I already tried setting up timer b + aggressive and got no changes. When I release h/s from digic poke the register snaps right back so even if the B changes were applied they would be gone in a second the way its currently set.

Any way to find out which registers are written to by the lens correction?

Rush

Quote from: 1% on March 22, 2013, 05:20:07 PMThe other regs seem to do a LOT of stuff to color. Almost like you could make HW focus peaking or selective color.
Is it applies to recorded video or just for overlay?
Greetings from Russia!

a1ex

So... as long as you keep the shutter pressed halfway, timer B takes effect, and then it's reverted? If so, the place for changing it is from image_effects_step (that's where digic poke works).

I'll try to apply this trick on all cameras, maybe it will no longer require the aggressive update (it may help with 500D/1100D).

1%

I noticed no ill effects from aggressive update, only easier to restore changes when image collapses. I already have the table found for 6D and you found it for 5d3.

That is the behavior though... as soon as you release its gone.

a1ex

If my understanding is correct, this should fix FPS timer B on all digic V cameras (maybe also 1100D/500D).

https://bitbucket.org/hudson/magic-lantern/commits/56a908d14c45

To try it, enable CONFIG_FPS_UPDATE_FROM_EVF_STATE and disable CONFIG_FPS_TIMER_A_ONLY/CONFIG_FPS_AGGRESSIVE_UPDATE from internals.h.

1%

It updates for a second then goes back.

* on some FPS it sticks... like 7FPS is good and then 20fps it flip flops.

exact fps 1.00 fps... not getting the lines anymore... timer B must have been some of the problem.

a1ex

Right, it's because Canon flips timer B between two different values all the time, and ML interprets this as changing video modes. This happens on line 1379, sig = blahblah.

Try this:


void fps_task()
{
     while(1)
     {
           fps_set_timers_from_evfstate(valA, valB, 1); // replace with raw register values
     }
}


If this works, we need to change the signature formula so it won't be influenced by tiny changes in timer B value.

1%

That works 99% of the time... it drops back to "canon" timings when the piggyback dialog refreshes in the background.

a1ex

Perfect, just pushed another fix, this time should work normally (it may need aggressive update, not sure).

You may also want to update this document: https://docs.google.com/spreadsheet/ccc?key=0AgQ2MOkAZTFHdEZrXzBSZmdaSE9WVnpOblJ2ZGtoZXc#gid=0

1%

It still flips back at higher fps. Aggressive didn't help. When it flips back the image dies since its going between like 12 and 40 fps.

a1ex

Um... maybe you should check whether the computations are somehow influenced (that is, if the values written to registers by ML are constant or they flip back and forth too).

If they are constant, maybe the delay between updates is too big. If so, maybe it's good to update the timers at every single frame, but for this you need to change the logic in lv-img-engio.c.

1%

FPS < 3 works fine. FPS 4 or greater it flip flops.

Low jello or high jello settings have the lines. exact fps doesn't. It flips between 40fps and 4 fps so I'm guessing ML values are constant but doesn't update often enough.

Lowering the msleep helps for fps 4-9 but then it still changes once and corrupts the LV. As you raise fps it starts flipping faster.

Maybe with the timer be fluctuations the register is updated twice by canon. I got rid of sleep completely and it still does it. I got it to override to 20fps and image flickered slightly as timber be went +1 +2

1%

Latest commit stopped the flipping but now LV is frozen or collapsed at >3 fps. I think that initial canon flip is killing it.

*Tried some different modes... low jello 1080 is working for FPS above 3.. I don't see lines yet.

a1ex

That's a tricky one... if I update the registers continuously, ML would no longer detect Canon's video mode changes (so, with the new method, changing video modes with the new FPS override results in corrupt image on 5D3). Though I don't understand why it would freeze at low frame rates... with the simple FPS task does it work for >3fps?

1%

Somewhat. It seems that it works based on which fps method you chose. Some fps is good at high jello, other fps is good at low jello. If you pick the wrong mode you get corruption... if you pick the right mode it works. Also some FPS can knock out the live view and you have to reboot.

I.e. 30.00 exact fps in 1080p30 = corruption
      30.00 high shutter = good
      33 fps in high shutter = good

Exact fps is great for <3 after that its almost impossible in all [video] modes.


Seems like will be complicated for the users... but I'm not seeing the lines anymore, knock on wood.

a1ex

Got it working on 5D3, maybe try again with 5df00e215c00. There was a bug that could freeze the LiveView.

1%

Latest commit makes it much more useable... some fps modes and some FPS it starts to flash or change back and forth.. but easier to pick the right mode now. Exact fps for <3... other modes for higher fps. Fast TV works well for a bunch.. I don't think it got lines under 8fps... Less timer B changes this time?


Also look at 8FPS on "low light" it flashes back and forth like HDR video. Low jello it becomes 15fps and sometimes flashes.

Low jello is worst for the flashing... like it can't handle timer b at all.

Sometimes FPS indicator displays wrong fps or switches but LV maintains correct fps.

*The low light is going to be insane for time lapse now. Its sunny and I can't step it down at iso 25 f32.. shutter as high as it will go.. seems like its not indicated whether shutter you've set is working or not. Trying high jello 2.5fps hopefully its line free.


1%

Ok, more testing.... That last commit breaks setting of timer B. I tried commenting out the timer A check and then increasing the timer B changes to 20 even and it still never let you alter timer b.

I found a new defect for 1fps with timer A only... the shutter speed is really limited. That sheet will have to be figured out for good fps settings for each fps mode.

a1ex

So, if you use 10fps low light (which uses only timer B), it doesn't work?!

1%

With fps_video_mode_changed it only adjusts timer A only. So it works but I get deffects. If I comment out the check it adjusts timer B again. With timer B working I have to adjust shutter range until its greater than 1/1/ to 1/1 to avoid defects but then its good.


*I'm going to try some of the stuff from today... maybe timer A limit like you put for 5d3 will help with calculations. There has to be a way to tweak mode change detection to avoid the crash but still let you set timer B.

Vignetting Correction is working... So are extreme shutters.

Trying out the min timer A from 5d3.

a1ex

So... fps_video_mode_changed returns true when it shouldn't, correct?

What if you delete just the second check? (the one with ABS)

1%

Deleting timer b check seems to have fixed it.

* with 5d3 A limits image doesn't collapse in exact fps above 3.