Author Topic: Canon 40D  (Read 409928 times)

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 8303
Re: Canon 40D
« Reply #600 on: July 05, 2021, 08:49:52 PM »
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

  • Developer
  • Member
  • *****
  • Posts: 164
  • No time for caution
Re: Canon 40D
« Reply #601 on: July 06, 2021, 07:20:54 PM »
I Guess I need to do a better install video next week, currently im om Mallorca  ;D

Embedded SW engineer. Canon 20d, 40d, 350d

imme

  • New to the forum
  • *
  • Posts: 30
Re: Canon 40D
« Reply #602 on: November 19, 2021, 06:42:58 AM »
Heder

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

kitor

  • Developer
  • Senior
  • *****
  • Posts: 350
Re: Canon 40D
« Reply #603 on: November 19, 2021, 12:11:44 PM »
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.

heder

  • Developer
  • Member
  • *****
  • Posts: 164
  • No time for caution
Re: Canon 40D
« Reply #604 on: January 03, 2022, 11:06:43 AM »
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 ..



Embedded SW engineer. Canon 20d, 40d, 350d

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7267
Re: Canon 40D
« Reply #605 on: January 03, 2022, 03:00:29 PM »
What a beautiful, clean image. Bravo.

heder

  • Developer
  • Member
  • *****
  • Posts: 164
  • No time for caution
Re: Canon 40D
« Reply #606 on: March 06, 2022, 07:39:01 PM »
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.

Embedded SW engineer. Canon 20d, 40d, 350d

kidkoala83

  • New to the forum
  • *
  • Posts: 11
Re: Canon 40D
« Reply #607 on: March 08, 2022, 12:25:50 PM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 8303
Re: Canon 40D
« Reply #608 on: March 08, 2022, 12:29:05 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

  • New to the forum
  • *
  • Posts: 11
Re: Canon 40D
« Reply #609 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?

heder

  • Developer
  • Member
  • *****
  • Posts: 164
  • No time for caution
Re: Canon 40D
« Reply #610 on: March 09, 2022, 09:08:17 AM »
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.
Embedded SW engineer. Canon 20d, 40d, 350d

kidkoala83

  • New to the forum
  • *
  • Posts: 11
Re: Canon 40D
« Reply #611 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. :)

heder

  • Developer
  • Member
  • *****
  • Posts: 164
  • No time for caution
Re: Canon 40D
« Reply #612 on: March 10, 2022, 10:14:34 AM »
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.
Embedded SW engineer. Canon 20d, 40d, 350d

kidkoala83

  • New to the forum
  • *
  • Posts: 11
Re: Canon 40D
« Reply #613 on: March 10, 2022, 11:39:59 AM »
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?

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 8303

heder

  • Developer
  • Member
  • *****
  • Posts: 164
  • No time for caution
Re: Canon 40D
« Reply #615 on: March 10, 2022, 01:09:20 PM »
Hi

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


Quote
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 924x388 is properly just a typo, my mistake.

Quote
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.
Do you get these effect in LiveView even without recording ?

Quote
Haven'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.





Embedded SW engineer. Canon 20d, 40d, 350d

kitor

  • Developer
  • Senior
  • *****
  • Posts: 350
Re: Canon 40D
« Reply #616 on: March 10, 2022, 01:14:25 PM »
Quote
No 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.

kidkoala83

  • New to the forum
  • *
  • Posts: 11
Re: Canon 40D
« Reply #617 on: March 10, 2022, 08:39:22 PM »
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

  • New to the forum
  • *
  • Posts: 11
Re: Canon 40D
« Reply #618 on: March 23, 2022, 09:01:12 PM »
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

  • Developer
  • Member
  • *****
  • Posts: 164
  • No time for caution
Re: Canon 40D
« Reply #619 on: March 25, 2022, 09:55:57 PM »
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.
Embedded SW engineer. Canon 20d, 40d, 350d