Canon 40D

Started by dichterDichter, July 18, 2012, 08:55:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Walter Schulz

Thanks, looks fine!
Heder told he would be busy with other things for quite some time. You may have to wait for thread confirmation by a mod or you want to join ML's discord channel to get some support. ATM Heder is the only one working on this port.

heder

I Guess I need to do a better install video next week, currently im om Mallorca  ;D

... some text here ..

imme

Heder

We are waiting for more updates....... :) :)

kitor

Do not use plural form to express your own expectations.

https://mikemcquaid.com/2018/03/19/open-source-maintainers-owe-you-nothing/

Also, nice work @heder!

Too many Canon cameras.
If you have a dead R, RP, 250D mainboard (e.g. after camera repair) and want to donate for experiments, I'll cover shipping costs.

heder

Happy new year !

I fought in 2021 Q3/Q4 with Ant123's jpeg motion video module, spend days on getting it to run, but could'nt resolve a bug causing drops, but now it's running in a prototype version. Current capabilities on 40D is 1024x680@max 30 fps, here a teaser at 1024x680@24fps:

SD (rubbish) resolution youtube video:




I will work toward a minor release with this module, ETA somehere in 2022@Q1. There still alot todo, stay tuned ..



... some text here ..

Danne

What a beautiful, clean image. Bravo.

heder

Hi.

Some interessing info regarding the process on mjpeg recording.

After alot of testing, I have finally completed a proof of concept that I can change the HD image (YUV Path) and 40D's internal JPEG path in such away that we can get proper MJPEG video recording at a bitrate of approx 12-14 MB/s.  The previous video (see posts above) was using standard HD images 1024 x 680 in x1 mode (binning x3), but by changing the YUV path into it's real original size I now have a format of 1288 x 820 (non-stretched). I known this is'nt going to make any real different, but the real goal is'nt x1 mode, the real goal is zoom mode where we don't have any binning (x5,x10) and where we can read the sensor pixel by pixel. On top of that, zoom mode x5 and x10 have by default set into 1944x806 mode, that FULL HD 1:2.39. The only thing I have not been able to test/control yet is the jpeg quality, which is really important when I reach FULL HD quality. Currently the quality on the HD image is really too high (lossless ?) and I need learn to lower it, inorder to get enought recording time at 1944x806.

To get 1288 x 820 I changed the following registers (including hijacking YUV buffers pointer and EDMAC's):

0xc0f1154c  // HD stretch register format (xxxx | yyyy), when xxxx=yyyy, ratio => 1.00
0xc0f1150c  // HD stretch register format (xxxx | yyyy), when xxxx=yyyy, ratio => 1.00
0xc0f11518  // HD width = 1288-1
0xc0f1155c  // 850 | HD width
   
I will work towards a release with 1288 x 820 MJPEG recording capabilities and after that I will go for 1920x806.

Here is a 1288 x 820 luminance test image, the image has some artifacts, but I was using singlebuffering and the save function was really slow, but still proof of concept 8), click on the image to expand to full size.

... some text here ..

kidkoala83

Hi heder! :)

I finally got ballsy and went beyond qemu to test your 40d port in my camera, it works and I am able to play Arkanoid and mess a bit with the intervalometer.

Been trying the raw video but don't understand very well how it works, it seems to stop automatically after short periods, and also then after I don't know what to do with those files, how to play those raw vid files, looking at my CF card I think the are the ones with .mlv extension..
If someone knows how to play them that be great.

Those mjpeg new features are looking great, wish I could help somehow.

Is great to see that finally unfold as we knew the 40d might be able to record video since 2008!

Thanks a lot and a big hooray to heder!!!

Walter Schulz

Quote from: kidkoala83 on March 08, 2022, 12:25:50 PM
Been trying the raw video but don't understand very well how it works, it seems to stop automatically after short periods, and also then after I don't know what to do with those files, how to play those raw vid files, looking at my CF card I think the are the ones with .mlv extension..

https://www.magiclantern.fm/forum/index.php?topic=20025.0

Stopping: Mostly because write rate is too low to keep up with sensor's data stream. You get a mere 12.5 (give or take) MByte/s with 40D's card interface.

kidkoala83

Ok, MLV app is working like a charm, thanks! :)
My vids are quiet buggy though, in the other hand they were my first try with raw video..
Contrast seems really hight, sometimes the screen just fades to black..
Still amazing to have been able to record some vid with the 40D! :)
Looking forward to mjpeg.

Why does my image fade to black when recording raw video? Could that be bad for my CMOS sensor or something? Should I stop the vid when that happens?

heder

Quote from: kidkoala83 on March 08, 2022, 12:36:39 PM
Ok, MLV app is working like a charm, thanks! :)
My vids are quiet buggy though, in the other hand they were my first try with raw video..
Contrast seems really hight, sometimes the screen just fades to black.
Still amazing to have been able to record some vid with the 40D! :)
Looking forward to mjpeg.

Why does my image fade to black when recording raw video? Could that be bad for my CMOS sensor or something? Should I stop the vid when that happens?

Hi kidkoala83.

I did a quick one minute mlv_lite recording test using 1.0.6, format 924x388@24 fps, and did not see any issues. Im shooting in mode "M". Try to record a video with and without "small hacks" option to see if this changes anything.
... some text here ..

kidkoala83

If I go as low as 640x160 and 5:1 or 4:1 aspect ratio i get continous mode in green letters, that seems good..
Under heavier loads i get blueish cold temperature screen, or snow, or splat screen half-half mirror effect..
How do you get those non standard resolutions of 924x388?
Do you use fps overrride to set the 24 fps?
What do "Use SRM job memory" and "Small hacks" do? How can I load the mlv_play module for playback?
I am enjoying very much testing the video on the 40d. :)

heder

Quote from: kidkoala83 on March 09, 2022, 10:33:46 PM
If I go as low as 640x160 and 5:1 or 4:1 aspect ratio i get continous mode in green letters, that seems good..
Under heavier loads i get blueish cold temperature screen, or snow, or splat screen half-half mirror effect..
How do you get those non standard resolutions of 924x388?
Do you use fps overrride to set the 24 fps?
What do "Use SRM job memory" and "Small hacks" do? How can I load the mlv_play module for playback?
I am enjoying very much testing the video on the 40d. :)

Hi.

Small hacks = disable white balance, disable auto exposure, tweak CF card.
Use SRM job memory = use photo memory for capturing (without SRM you are limited to 40MB buffers, with SRM > 200 MB)
mlv_play = bugged, does'nt work yet, use MLVapp.

Yes I shoot at 24 fps, I can shoot any size that the camera allows without issues.

What happens if you recording zoom mode (x5,x10).
What CF card are you using ? (old or new?)
Does the blueish cold temperature screen or snow, some slowly while recording, or does it appear when you start LiveView ?
Does the blueish cold temperature screen or snow disapeer if you close and re-open LiveView ?

Blueish cold temperature screen or snow, is a typical indication that the video timing becomes screwed.
... some text here ..

kidkoala83

The closest I get to 924x388 is 928x388 at 2.39:1 .. What aspect ratio are you using? Or it might have been a typo..

The Blueish cold temperature screen, snow, or half-half screen effect shows on liveview, it does disappear if you turn it off and on again, at least temporarily.

Haven't tried the x5, x10 zoom yet.. Should I be recording with zoom on?

I am using an old 2Gb CF card for testint Magic Lantern, from the year 2008 or so..

Btw, what is binning? What does the SRM acronym stand for?


heder

Hi

QuoteWhat does the SRM acronym stand for?
No idea, but the "SRM_" name originates from the firmware itself.


QuoteThe closest I get to 924x388 is 928x388 at 2.39:1 .. What aspect ratio are you using? Or it might have been a typo..
The 924x388 is properly just a typo, my mistake.

QuoteThe Blueish cold temperature screen, snow, or half-half screen effect shows on liveview, it does disappear if you turn it off and on again, at least temporarily.
Do you get these effect in LiveView even without recording ?

QuoteHaven't tried the x5, x10 zoom yet.. Should I be recording with zoom on?
When you go into zoom mode, mlv_lite is not recording in "zoom mode", but rather the raw sensor (not binning mode), mlv_lite for 40D can currently recording around 1920(?) x 806(?), but the crop mode is high and aspect ratio around 2.39

1. try to disable Small hacks
2. try to recording in zoom mode.





... some text here ..

kitor

QuoteNo idea, but the "SRM_" name originates from the firmware itself.

System (Static?) Resource Manager, on newer models you find a lot of RscMgr.c references. It manages most of memory space, "regular" malloc / AllocateMemory are a very limited pool.

SRM_AllocateMemoryResourceFor1stJob is just a nasty hack that uses SRM Factory mode to allocate a lot of memory. There's a ton of other allocators, they behave differently per camera mode.

https://www.magiclantern.fm/forum/index.php?topic=12528.0
Too many Canon cameras.
If you have a dead R, RP, 250D mainboard (e.g. after camera repair) and want to donate for experiments, I'll cover shipping costs.

kidkoala83

I will do further testing when I can, the blueish/snow/half mirror was happening in high resolutions and aspect ratios in liveview but not even recording yet if I recall right, in fact those might had not even been set yet.. Just liveview no recording, quiet sure..
Once more, thanks a lot heder! :)

kidkoala83

Ok, Ive checked. The weird effects happen in live view, not recording, without fps override enabled (OFF), turning  live view on and off seems to fix it momentarily.
If Im not mistaken it only happens in fps above 24, 29.9 for instance, setting fps override (ON) at 24 fps seems to fix it.

heder

Hi Kidkoala83, thanks for testing the build!.

I have seen the blueish/snow/half mirror snow effect from time to time on my camera, and it's surely my ML build that does it. I also see these issues on test builds where I mess around with timing. I don't see it currently, but it might just be that I have coded the build to fix perfectly to my camera but not yours. Its timing related becuase I have hijacked all driver functions that writes to the peripherals (sensor, cf, display ... ect). I don't have another build currently, but the next build I will optimize and change the code and hopefully the issues will go away.

Currently I'm stuck for the 2-3 weeks, due to the war in Ukraine, my office is occupied by a grow up daugther of one of our friends from Ukraine. I have the YUV path running correctly and "just" need the jpeg path hacked and then the camera can do 1288 x 820 recording.
... some text here ..

imme


heder

I have been working on getting the mjpeg video recording running at 1336x872 (non crop mode) or similar but it partly fails. The original size 1024x780 is'nt interessing due to the small size. I actually have the YUV conversion path running (sensor->YUV conversion), see post from 6 of March 2022, but the YUV->JPEG path partly fails. I do get a correctly sized image with good pixels, but I also have a green pattern all over the place. I have failed to fix this so far. No one have documented to JPEG engine and registers so it's a black box.

Here is my pattern problem:



I'll give it another month, and If I fails, I'll try to x5 zoom mode. x5 zoom mode is harder to work on, because I need to change much more registers, but I properly have a slightly higher properbility of success with the YUV->JPEG path as the 40D can save JPEG photo images in 1936x1288 format (small size), and I can utilize this to find the correct registers for a 1936x1288. Max format in crop more (x5,x10) is 1944x806 (full HD 1:2.39)
... some text here ..

theBilalFakhouri

General note: from own preview experiments on 700D/5D3, LiveView seems to have multiple layers, if one of the layers didn't match horizontal resolution of e.g. YUV path, some artifact would show (similar to your image). But no idea if it the same thing in your case.

Try to compare registers among none crop mode vs x5 mode, tweak registers you found and see if one of the registers causes these kind of artifacts. We usually do this by adtg_gui module on DIGIC 4/5.




If x5 mode works for JPEG recording and you prefer none-crop mode, You can patch 1:1 (x5) mode back to 3x3 (none crop) mode without touching preview registers, see this. This can be done using CMOS and ADTG registers and it's very simple. We also can do this by adtg_gui module, and it's very simple to do it. Unfortunately no idea how to do it on 40D.

heder

Quote from: theBilalFakhouri on August 07, 2022, 10:05:46 PM
General note: from own preview experiments on 700D/5D3, LiveView seems to have multiple layers, if one of the layers didn't match horizontal resolution of e.g. YUV path, some artifact would show (similar to your image). But no idea if it the same thing in your case.

Try to compare registers among none crop mode vs x5 mode, tweak registers you found and see if one of the registers causes these kind of artifacts. We usually do this by adtg_gui module on DIGIC 4/5.




If x5 mode works for JPEG recording and you prefer none-crop mode, You can patch 1:1 (x5) mode back to 3x3 (none crop) mode without touching preview registers, see this. This can be done using CMOS and ADTG registers and it's very simple. We also can do this by adtg_gui module, and it's very simple to do it. Unfortunately no idea how to do it on 40D.

Thanks for input.

The YUV Path runs correctly. I don't have any artefacts, and the registers are quite similar to the one you descripted. The image from 6 March is a image from the updated YUV path. (greyscale image, converted from YUV).  It's the JPEG "path" compressions that run incorrectly, but the JPEG engine is largely undocumented. The YUV is transferred in macro 8x8 blocks into the JPEG engine in a specific pattern, properly due to JPEG engine ram or similar (and another EDMAC is configured to readout on the fly, this works fine). I had compute re-compute the EDMAC value in order to get image transferred. By looking at the different video/photo modes I was capable of re-computing the new EDMAC values. This works for some image width (1024,1088,1280), but I get those artefacts.  I did compare x1 versus x5/x10 inorder to get a feeling for that needs to be updated, EDMAC and JPEG registers.

Basically I'm hijacking the 40D JPEG Path "main" call and changing the image size, and JPEG engine get correctly configured, but the EDMAC value for transferring into the JPEG engine is hardcoded and those is changed on the fly. Also some JPEG related registers needs to be corrected for the entire path to run.

My current assumption is 

1. Either I'm missing at update some JPEG related registers
2. or EDMAC is configured incorrectly.


... some text here ..

Ant123

Quote from: heder on August 07, 2022, 08:47:31 PM
No one have documented to JPEG engine and registers so it's a black box.

Have you tried to logging MMIO traffic through JPCore?