Magic Lantern Forum

Magic Lantern Releases => Camera-specific discussion => Topic started by: rwl408 on September 06, 2013, 06:07:43 AM

Title: Porting ML to XSi (450D)
Post by: rwl408 on September 06, 2013, 06:07:43 AM
ML has been ported to 5D and 40D but there seems to be lack of activity for XSi, which I believed Canon should have sold quite a lot. Yep, you are right, I have one. But I am looking at this porting thing not as an ML user but as an ML developer. For the past couple of weeks I have roamed this website and CHDK in an effort to understand what this "hacking" business is all about and to size up the development work. Well, it is big, at least to me. As someone who doesn't do video, I am wondering if it is worth the effort for me to jump in. From the information I came across it seems that firmware dump, v1.0.9 has been available (http://chdk.setepontos.com/index.php?topic=3402.0 (http://chdk.setepontos.com/index.php?topic=3402.0)) but a later thread asking for help to dump the same firmware (http://chdk.setepontos.com/index.php?topic=4973.0 (http://chdk.setepontos.com/index.php?topic=4973.0)) while using the same file I/O function pointers. Intrigued by this and as an IDA learning exercise (new tool to me), I set out to find what is going on. Well, I found the correct pointer values for those file I/O functions in Canon's flasher code and they are the same for both v1.0.9 and v1.1.0. Hmm, I wonder how one could get the firmware from apparently wrong function pointers. No, I have not dumped anything yet (need to set up the build environment in Ubuntu first, not to mention the build scripts) but I am sure mine are correct because I have cross-checked with those known working pointers in 40D firmware dump code in this thread (http://chdk.setepontos.com/index.php?topic=1651.45 (http://chdk.setepontos.com/index.php?topic=1651.45) to make sure they executes the same flasher file I/O code and they do. As a matter of fact, XS (1000D) has the exact same flasher file I/O code. They are just in different places (pointer values). I have not decided whether to continue further and certainly will not in the next two/three months but if anyone is interested in porting, I have no problem published the correct pointer values. Just want to get this porting thing move forward, albeit tortoise-wise. :)

- Rick
Title: Re: Porting ML to XSi (450D)
Post by: rwl408 on September 11, 2013, 06:35:09 PM
I got two extra weeks before my planned two month's away from home to do some more exploration. The file I/O pointer values that I found in the flasher code are correct. I have used them to dump Canon's firmware v1.1.0 successfully (from 0xFF810000 to 0xFFFFFFFF). It is not as straight as I thought. There were some more details I had to know about to actually dump the firmware without the risk of killing my XSi.
Title: Re: Porting ML to XSi (450D)
Post by: g3gg0 on September 12, 2013, 01:09:11 AM
so you were able to dump the rom content?
i recommend to dump starting from 0xF8000000 btw
Title: Re: Porting ML to XSi (450D)
Post by: rwl408 on September 12, 2013, 03:53:20 AM
That (rom dump) is affirmative. I started by dumping 0xFF800000 - 0xFFFFFFFF but then discovered that IDA  isn't happy about 0xFFFFFFFF being used (used by IDA?) and that 0xFF800000 - 0xFF8100000 just contains 0xFF's. I ended up just dumping 0xFF810000 - 0xFFFFFFFC so that I don't have to change file size when loading it into IDA. I am too lazy even though one only has to do it once - the first time loading.

0xF8000000 - 0xFFFFFFFF is a huge chunk (128MB). Can IDA handle that? Or would it be more advantageous to dump it in separate smaller chunks. I know 0xF8000000 - 0xF800000F is used as boot_flags and I guess it is probably in non-volatile memory. How big it may be? Also what other regions that presents interesting stuff for porting. I have taken a snapshot of the source code and am able to compile it. But I have not looked into the code yet.

By the way I think the next thing to do is to find the function pointers in the firmware to enable/disable boot-capability. I have followed the lead in a posting by Coutts (http://www.magiclantern.fm/forum/index.php?topic=1452.0 (http://www.magiclantern.fm/forum/index.php?topic=1452.0)) and found something close to the code (for 5D) in the posting but not quite the same. In 1000D (v1.0.5) I also found the same (XSi) code (in different places but very close by). Both of them are above 0xFFFF0000. I believe I have found them but until I learn ARM enough to be able to follow the code, I am not 100% sure.

After this exercise I have a better grasp of this porting business. It is not very challenged per se if one has the right knowledge (ARM assembly language for me) but requires a ton of labor to find where those equivalent pointers are in XSi, for starter. There should be more things I don't know yet.
Title: Re: Porting ML to XSi (450D)
Post by: g3gg0 on September 12, 2013, 09:32:37 AM
ROM0: 0xF0000000 - 0xF7FFFFFF (when camera has a ROM0, then its 8 or 16M, so its 0xF0000000-0xF0FFFFFF)
ROM1: 0xF8000000 - 0xFFFFFFFF (most cameras have 16M, so its 0xF8000000-0xF8FFFFFF)

use these ranges, they are the the real base address and repeat over and over until 0xFFFFFFFF.
the processor uses the image at various addresses.
on boot, 0xFFFF0000 is executed, which is at 0xF7FF0000. later it may jump to 0xFF810000 which really is 0xFF010000 etc.

but when dumping, you best use the ranges i quoted above.
relocating in memory can be done later in IDA without any problem

for IDA: just use addresses until 0xFFFFFFFC
Title: Re: Porting ML to XSi (450D)
Post by: rwl408 on September 12, 2013, 02:58:37 PM
Thanks for the information about ROM0 and ROM1. I read about them but have not put much thought into them yet. A couple of things to clarify though.

About the memory ranges to dump. You mean to dump just the lower 16M (0xF0000000-0xF0FFFFFF for ROM0 and 0xF8000000-0xF8FFFFFF). Right?

About the address mapping. I got lost here. How can 0xFFFF0000 (ROM1 range) be mapped from 0xF7FF0000 (ROM0 range)?
Title: Re: Porting ML to XSi (450D)
Post by: g3gg0 on September 12, 2013, 04:03:26 PM
haha ok you really understood what i wrote :)
yeah, i had a typo.

of course 0xFFFF0000 does map to 0xF8FF0000
Title: Re: Porting ML to XSi (450D)
Post by: rwl408 on September 12, 2013, 10:41:38 PM
Or 0xF8FF0000 maps to 0xFFFF0000. :)

Anyway I went ahead to dump 0xF0000000-0xF0FFFFFF (16M) and 0xF8000000-0xF8FFFFFF (16M)ranges. The data from the 1st range (ROM0) are all 0's. I guess there isn't ROM0 in XSi (a blank ROM should be all 0xFF's). Data in the 2nd range seems to be two copies of the same code/data with an address offset of 8M. I got the impression when searching for a couple of specific patterns that matched once in my previous dump (0xFF810000-0xFFFFFFFF) and got two matches now. That probably means the size of ROM1 is 8M for XSi. Hmm, interesting.
Title: Re: Porting ML to XSi (450D)
Post by: 1% on September 12, 2013, 10:49:24 PM
Quote
IDA  isn't happy about 0xFFFFFFFF

You can also cut a little bit off the end with a hex editor.. Its usually garbage like F's or 0s at the end.

I'm also wondering about 400D.. would be nice to have dual ISO on that.
Title: Re: Porting ML to XSi (450D)
Post by: rwl408 on September 12, 2013, 11:03:35 PM
By the way, the first 2K bytes (0xF8000000 and 0xF8800000 too) start with 8 0x00's and then all 0xFF's. So 0xF8000000, 0xF8000004, 0xF8000008 and 0xF800000C have value of 0, 0, -1 and -1. Seems to make sense.
Title: Re: Porting ML to XSi (450D)
Post by: g3gg0 on September 12, 2013, 11:08:31 PM
yep, the first sector contains startup flags
Title: Re: Porting ML to XSi (450D)
Post by: rwl408 on September 12, 2013, 11:35:48 PM
If you can write to it, it must be some kind of non-volatile memory to keep the flags across boot/power loss.
Title: Re: Porting ML to XSi (450D)
Post by: g3gg0 on September 13, 2013, 12:16:05 AM
its a flash chip. commands to erase/write are simple and standardized.
Title: Re: Porting ML to XSi (450D)
Post by: rwl408 on September 13, 2013, 01:11:56 AM
Ah, good old flash chip. Must be serial type - pin count and size matter. I had dealt with them (both serial and parallel) before. I plan to convert my XSi into IR someday and will look for it when I open it up. Back to the porting thing, which model to pick as the base for XSi in your opinion?
Title: Re: Porting ML to XSi (450D)
Post by: g3gg0 on September 13, 2013, 10:00:50 PM
its a parallel one, as it is mapped into memory space
Title: Re: Porting ML to XSi (450D)
Post by: rwl408 on September 17, 2013, 06:29:15 AM
its a parallel one, as it is mapped into memory space

You are so right.

I poked around the ML source code trying to find some details about the boot_flag thing. And I found the bootDisk  flag is @0xF8000004, not what I original thought @0xF8000000! Compare these sections of firmware code, I think I found the equivalent 500D enable/diable_bookDisk code in XSi.

500D Firmware v1.1.1?:
Code: [Select]
ROM:FF066748 ; =============== S U B R O U T I N E =======================================
ROM:FF066748
ROM:FF066748
ROM:FF066748 sub_FF066748                            ; CODE XREF: sub_FF013210+154p
ROM:FF066748                 STMFD   SP!, {R4,LR}
ROM:FF06674C                 ADR     R2, unk_FF066718
ROM:FF066750                 MOV     R1, #0
ROM:FF066754                 ADR     R0, aEnablefirmware ; "EnableFirmware"
ROM:FF066758                 BL      sub_FF1A5B58
ROM:FF06675C                 ADR     R2, sub_FF066724
ROM:FF066760                 MOV     R1, #0
ROM:FF066764                 ADR     R0, aDisablefirmwar ; "DisableFirmware"
ROM:FF066768                 BL      sub_FF1A5B58
ROM:FF06676C                 ADR     R2, sub_FF066700
ROM:FF066770                 MOV     R1, #0
ROM:FF066774                 ADR     R0, aEnablebootdisk ; "EnableBootDisk"
ROM:FF066778                 BL      sub_FF1A5B58
ROM:FF06677C                 ADR     R2, sub_FF06670C
ROM:FF066780                 MOV     R1, #0
ROM:FF066784                 ADR     R0, aDisablebootdis ; "DisableBootDisk"
ROM:FF066788                 BL      sub_FF1A5B58
ROM:FF06678C                 ADR     R2, sub_FF066730
ROM:FF066790                 MOV     R1, #0
ROM:FF066794                 ADR     R0, aEnablemainfirm ; "EnableMainFirm"
ROM:FF066798                 BL      sub_FF1A5B58
ROM:FF06679C                 LDMFD   SP!, {R4,LR}
ROM:FF0667A0                 ADR     R2, sub_FF06673C
ROM:FF0667A4                 MOV     R1, #0
ROM:FF0667A8                 ADR     R0, aDisablemainfir ; "DisableMainFirm"
ROM:FF0667AC                 B       sub_FF1A5B58
ROM:FF0667AC ; End of function sub_FF066748
ROM:FF0667AC
ROM:FF0667AC ;
ROM:FF0667B0 dword_FF0667B0  DCD 0xF8000004          ; DATA XREF: sub_FF066700r
ROM:FF0667B0                                         ; sub_FF06670Cr
ROM:FF0667B4 dword_FF0667B4  DCD 0xF800000C          ; DATA XREF: sub_FF066724r
ROM:FF0667B8 aEnablefirmware DCB "EnableFirmware",0  ; DATA XREF: sub_FF066748+Co
ROM:FF0667C7                 DCB    0
ROM:FF0667C8 aDisablefirmwar DCB "DisableFirmware",0 ; DATA XREF: sub_FF066748+1Co
ROM:FF0667D8 aEnablebootdisk DCB "EnableBootDisk",0  ; DATA XREF: sub_FF066748+2Co
ROM:FF0667E7                 DCB    0
ROM:FF0667E8 aDisablebootdis DCB "DisableBootDisk",0 ; DATA XREF: sub_FF066748+3Co
ROM:FF0667F8 aEnablemainfirm DCB "EnableMainFirm",0  ; DATA XREF: sub_FF066748+4Co
ROM:FF066807                 DCB    0
ROM:FF066808 aDisablemainfir DCB "DisableMainFirm",0 ; DATA XREF: sub_FF066748+60o

                           ===== bootdisk_enable =====
ROM:FF066700 ; =============== S U B R O U T I N E ================
ROM:FF066700
ROM:FF066700
ROM:FF066700 sub_FF066700                            ; DATA XREF: sub_FF066748+24o
ROM:FF066700                 LDR     R0, =0xF8000004
ROM:FF066704                 MOV     R1, 0xFFFFFFFF
ROM:FF066708                 B       sub_FF06664C
ROM:FF066708 ; End of function sub_FF066700

                           ===== bootdisk_disable =====
ROM:FF06670C ; =============== S U B R O U T I N E ================
ROM:FF06670C
ROM:FF06670C
ROM:FF06670C sub_FF06670C                            ; DATA XREF: sub_FF066748+34o
ROM:FF06670C                 LDR     R0, =0xF8000004
ROM:FF066710                 MOV     R1, #0
ROM:FF066714                 B       sub_FF06664C
ROM:FF066714 ; End of function sub_FF06670C

XSi Firmware v1.1.0
Code: [Select]
ROM:FFD184A0 ; =============== S U B R O U T I N E =======================================
ROM:FFD184A0
ROM:FFD184A0
ROM:FFD184A0 sub_FFD184A0                            ; CODE XREF: sub_FF811340+164p
ROM:FFD184A0
ROM:FFD184A0 var_4           = -4
ROM:FFD184A0
ROM:FFD184A0                 LDR     R0, =aEnablefirmware ; "EnableFirmware"
ROM:FFD184A4                 MOV     R1, #0
ROM:FFD184A8                 LDR     R2, =sub_FFD18158
ROM:FFD184AC                 STR     LR, [SP,#var_4]!
ROM:FFD184B0                 BL      sub_FFD0A128
ROM:FFD184B4                 LDR     R0, =aDisablefirmwar ; "DisableFirmware"
ROM:FFD184B8                 MOV     R1, #0
ROM:FFD184BC                 LDR     R2, =sub_FFD1822C
ROM:FFD184C0                 BL      sub_FFD0A128
ROM:FFD184C4                 LDR     R0, =aEnablebootdisk ; "EnableBootDisk"
ROM:FFD184C8                 MOV     R1, #0
ROM:FFD184CC                 LDR     R2, =unk_FFD18538
ROM:FFD184D0                 BL      sub_FFD0A128
ROM:FFD184D4                 LDR     R0, =aDisablebootdis ; "DisableBootDisk"
ROM:FFD184D8                 MOV     R1, #0
ROM:FFD184DC                 LDR     R2, =unk_FFD18550
ROM:FFD184E0                 BL      sub_FFD0A128
ROM:FFD184E4                 LDR     R0, =aEnablemainfirm ; "EnableMainFirm"
ROM:FFD184E8                 MOV     R1, #0
ROM:FFD184EC                 LDR     R2, =sub_FFD18300
ROM:FFD184F0                 BL      sub_FFD0A128
ROM:FFD184F4                 LDR     R0, =aDisablemainfir ; "DisableMainFirm"
ROM:FFD184F8                 MOV     R1, #0
ROM:FFD184FC                 LDR     R2, =sub_FFD183D0
ROM:FFD18500                 LDR     LR, [SP+4+var_4],#4
ROM:FFD18504                 B       sub_FFD0A128
ROM:FFD18504 ; End of function sub_FFD184A0
ROM:FFD18504
ROM:FFD18504 ; ---------------------------------------------------------------------------
ROM:FFD18508 off_FFD18508    DCD aEnablefirmware     ; DATA XREF: sub_FFD184A0r
ROM:FFD18508                                         ; "EnableFirmware"
ROM:FFD1850C off_FFD1850C    DCD sub_FFD18158        ; DATA XREF: sub_FFD184A0+8r
ROM:FFD18510 off_FFD18510    DCD aDisablefirmwar     ; DATA XREF: sub_FFD184A0+14r
ROM:FFD18510                                         ; "DisableFirmware"
ROM:FFD18514 off_FFD18514    DCD sub_FFD1822C        ; DATA XREF: sub_FFD184A0+1Cr
ROM:FFD18518 off_FFD18518    DCD aEnablebootdisk     ; DATA XREF: sub_FFD184A0+24r
ROM:FFD18518                                         ; "EnableBootDisk"
ROM:FFD1851C off_FFD1851C    DCD unk_FFD18538        ; DATA XREF: sub_FFD184A0+2Cr
ROM:FFD18520 off_FFD18520    DCD aDisablebootdis     ; DATA XREF: sub_FFD184A0+34r
ROM:FFD18520                                         ; "DisableBootDisk"
ROM:FFD18524 off_FFD18524    DCD unk_FFD18550        ; DATA XREF: sub_FFD184A0+3Cr
ROM:FFD18528 off_FFD18528    DCD aEnablemainfirm     ; DATA XREF: sub_FFD184A0+44r
ROM:FFD18528                                         ; "EnableMainFirm"
ROM:FFD1852C off_FFD1852C    DCD sub_FFD18300        ; DATA XREF: sub_FFD184A0+4Cr
ROM:FFD18530 off_FFD18530    DCD aDisablemainfir     ; DATA XREF: sub_FFD184A0+54r
ROM:FFD18530                                         ; "DisableMainFirm"
ROM:FFD18534 off_FFD18534    DCD sub_FFD183D0        ; DATA XREF: sub_FFD184A0+5Cr
ROM:FFD18538 unk_FFD18538    DCB 0x4F ; O            ; DATA XREF: sub_FFD184A0+2Co
ROM:FFD18538                                         ; ROM:off_FFD1851Co
ROM:FFD18538 ;

---------------------------- bootdisk_enable? ---------------
ROM:FFD18538
ROM:FFD18538 loc_FFD18538                            ; DATA XREF: sub_FFD184A0+2Co
ROM:FFD18538                                         ; ROM:off_FFD1851Co
ROM:FFD18538                 MOV     R0, 0xF8000004
ROM:FFD18540                 MOV     R1, 0xFFFFFFFF
ROM:FFD18544                 STR     LR, [SP,#-4]!
ROM:FFD18548                 LDR     LR, [SP],#4
ROM:FFD1854C                 B       loc_FFD18078
ROM:FFD18550 ;


---------------------------- bootdisk_disable? ---------------
ROM:FFD18550
ROM:FFD18550 loc_FFD18550                            ; DATA XREF: sub_FFD184A0+3Co
ROM:FFD18550                                         ; ROM:off_FFD18524o
ROM:FFD18550                 MOV     R0, 0xF8000004
ROM:FFD18558                 MOV     R1, #0
ROM:FFD1855C                 STR     LR, [SP,#-4]!
ROM:FFD18560                 LDR     LR, [SP],#4
ROM:FFD18564                 B       loc_FFD18078

This similarity makes me think if 500D is a good candidate of reference for XSi porting even though these two models  have different OS. Anyway, now is the time for ARM assembly language and architecture, and perhaps VxWorks. Until then, I don't think I can make any meaningful progress.
Title: Re: Porting ML to XSi (450D)
Post by: astroxsi on January 10, 2015, 10:32:46 AM
Hi all,

Any news on this topic?

I'm a 450d user (I use it mainly for astrophotography stuff) and ML would be a nice addon, I really wish to see it one day :) . I haven't moved to a newer canon model because this 450d is heavily modified (IR filter removed, peltier cooling), so I would like to stick with that camera at least for a while.

I'm afraid I cannot help with the code because I don't know the internals of Canon firmware, and I don't have experience hacking the ML code, but I can offer myself to try to test any code you generate.
Title: Re: Porting ML to XSi (450D)
Post by: Walter Schulz on January 10, 2015, 10:39:55 AM
I think it would be wise not to wait for a port but to use some advanced remote control device.
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on October 14, 2016, 03:39:52 PM
Some progress with converting 40D port to 450D:

(http://thumbnails116.imagebam.com/50942/4eda84509417915.jpg) (http://www.imagebam.com/image/4eda84509417915)
Title: Re: Porting ML to XSi (450D)
Post by: Marsu42 on October 15, 2016, 11:35:45 PM
Some progress with converting 40D port to 450D

Oh my, it isn't photoshopped? If not: good to see some people are not going along with planned obsolescence and try to make use of the good ol' gear!

Having said that, I personally wouldn't go below the long-running 18mp sensor for general photography nowadays, there are so many cams around with it and ML support so they should be more than affordable... I just bought a used 7d1. That's b/c I had a 450d-class cam (Nikon 3100) for some weeks on loan and wouldn't want to touch that usability and sensor iq again even with a 10-foot pole.
Title: Re: Porting ML to XSi (450D)
Post by: juvain on October 18, 2016, 08:32:19 PM
Some progress with converting 40D port to 450D:

(http://thumbnails116.imagebam.com/50942/4eda84509417915.jpg) (http://www.imagebam.com/image/4eda84509417915)

Can you post a link to this test build? :)
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on October 18, 2016, 09:42:47 PM
It's not finished yet. There is no normal installer. Shooting functions not implemented. Only intervalometer works at the moment...
Title: Re: Porting ML to XSi (450D)
Post by: juvain on October 21, 2016, 10:25:43 PM
It's not finished yet. There is no normal installer. Shooting functions not implemented. Only intervalometer works at the moment...

Can I help you somehow?
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on October 26, 2016, 10:54:53 PM
I compiled a modern version of ML with the changes made by rufustfirefly.
But I've got it working only when I used GCC 4.7.3
With GCC 4.8 or 4.9 I'm getting camera crash during font loading.
Is it necessarily to use GCC 4.8.3 ?

Garbage at the rightmost column was removed when I changed BMP_W_PLUS from 720 to 721 in bmp.h:
(http://thumbnails115.imagebam.com/51176/f1ffc3511751829.jpg) (http://www.imagebam.com/image/f1ffc3511751829)

Is this trick correct?

Source code: https://bitbucket.org/Ant123/magic-lantern/src (https://bitbucket.org/Ant123/magic-lantern/src)
Installer for 450D firmware 1.1.0. : https://bitbucket.org/Ant123/magic-lantern-40d/downloads/ML450D110.fir (https://bitbucket.org/Ant123/magic-lantern-40d/downloads/ML450D110.fir)
It works the same as 40D/5DC installer.
ML test build for 450D firmware 1.1.0. : https://bitbucket.org/Ant123/magic-lantern-40d/downloads/magiclantern-Nightly.2016Oct26.450D110.zip (https://bitbucket.org/Ant123/magic-lantern-40d/downloads/magiclantern-Nightly.2016Oct26.450D110.zip)
Only intervalometer can be useful at the moment...

Title: Re: Porting ML to XSi (450D)
Post by: a1ex on November 01, 2016, 08:45:51 PM
Added the 450D and 40D changes to the vxworks branch (https://bitbucket.org/hudson/magic-lantern/branch/vxworks) in the main repo. Did some minor cleanups (compiler warnings), had some attempts at emulating it in QEMU, but didn't really check any deeper yet.

For reverse engineering, I've adapted the dm-spy-experiments (http://www.magiclantern.fm/forum/index.php?topic=2388.msg113154#msg113154) branch as vxworks-dm-spy (https://bitbucket.org/hudson/magic-lantern/branch/vxworks-dm-spy) (tested in qemu).
Title: Re: Porting ML to XSi (450D)
Post by: LTG2004 on November 16, 2016, 05:34:06 PM
Hey Ant123, could you please update those download links as i would like to test this build.. They seem to be broken :( :(
Title: Re: Porting ML to XSi (450D)
Post by: gunny2k6 on March 08, 2017, 10:59:53 PM
was lucky enough to be given a 450d .. started doing google found this an updated 450d from 1.04 to 1.09 (arg when u can find it lol) then 1.10 (had to flash from eos util on pc) and gave your test files ago and it works! OK not much you can do but loads magic lantern menus !! .. I know this camera is so old now and be awesome to have more features but I guess like the most of magic lantern seems to be dead or lack of devs 😔

removed it from my sd card via format option and just stock canon again as lack of being able to do really anything with this so no point leaving it running.

(http://thumbnails117.imagebam.com/53699/ac9f24536988410.jpg) (http://www.imagebam.com/image/ac9f24536988410)

(http://thumbnails117.imagebam.com/53699/adee4e536988412.jpg) (http://www.imagebam.com/image/adee4e536988412)
Title: Re: Porting ML to XSi (450D)
Post by: botenredwolf on March 24, 2017, 08:49:33 PM
I'm also behind porting this, as I'm also running the 450D/XSi and don't mind experimenting. Also can help by dumping and building if need be, although I don't know my way around too much code, I can at least be a guinea pig.
Title: Re: Porting ML to XSi (450D)
Post by: armedchanger on June 24, 2017, 08:31:51 PM
Tried using your files but camera only flashes LED when ML450D110.fir is the only .fir file on the card.

Also tried to put original 1.1.0 firmware on the card with your fir. I can select ML450D110.fir and confirm the update and get the error message.

I'm I missing something?

Thanks
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on June 24, 2017, 10:12:29 PM
I'm I missing something?
Read the FAQ (http://wiki.magiclantern.fm/faq) first...
Title: Re: Porting ML to XSi (450D)
Post by: armedchanger on June 25, 2017, 09:46:41 AM
Read the FAQ (http://wiki.magiclantern.fm/faq) first...
Couldn't get it to work but managed to get it to work with EOScard software.

I think that there is huge potential for porting ML to XSi/450d because a lot of people use it as a 2nd camera. The intervalometer works as you said.

This thread needs more exposure and more devs joining in.
Title: Re: Porting ML to XSi (450D)
Post by: mikeuk on August 26, 2017, 11:55:02 AM
I have tried it on my 450D and it doesn't seem to work. It is installed but I can't seem to be able to load the ML menu up, Also it messes up the live mode, it flashes strange text.

When I press bin buttom this is what show up, then it crash and have to remove the battery to restart. I pressed Set and nothing happened.

(http://thumb.ibb.co/j0sJ45/IMG_20170826_104255.jpg) (http://ibb.co/j0sJ45)


I do have 1.1.0 firmware installed. Is there a different region of 1.1.0 firmware?? My camera is UK Version.

Many Thanks

Mike
Title: Re: Porting ML to XSi (450D)
Post by: a1ex on September 22, 2017, 09:31:17 PM
Managed to emulate the 450D GUI in QEMU (http://www.magiclantern.fm/forum/index.php?topic=2864.msg190254#msg190254), and also ran some tests on Ant's build:

(https://builds.magiclantern.fm/jenkins/job/QEMU-nightly-tests/208/artifact/qemu/magiclantern-Nightly.2016Oct26.450D110/2-overlay2.png) (https://builds.magiclantern.fm/jenkins/job/QEMU-nightly-tests/208/artifact/qemu/magiclantern-Nightly.2016Oct26.450D110/4-focus-peak.png) (https://builds.magiclantern.fm/jenkins/job/QEMU-nightly-tests/208/artifact/qemu/magiclantern-Nightly.2016Oct26.450D110/7-focus-patterns.png)

Animation (click to zoom):

(https://builds.magiclantern.fm/jenkins/job/QEMU-nightly-tests/208/artifact/qemu/magiclantern-Nightly.2016Oct26.450D110/thumbnails/menu.gif) (https://builds.magiclantern.fm/jenkins/job/QEMU-nightly-tests/208/artifact/qemu/magiclantern-Nightly.2016Oct26.450D110/menu.gif)

Emulation log (https://builds.magiclantern.fm/jenkins/job/QEMU-nightly-tests/208/consoleText)

Canon menu screenshots (without ML loaded):
(https://builds.magiclantern.fm/jenkins/job/QEMU-tests/208/artifact/qemu/tests/450D-menu.png)

Besides the not-so-impressive feature set, I have a few questions:

- On the actual hardware, do the fonts look as bad as in the following screenshot?

(https://builds.magiclantern.fm/jenkins/job/QEMU-nightly-tests/208/artifact/qemu/magiclantern-Nightly.2016Oct26.450D110/5-spotmeter.png)

- Do the colors in the menu customization mode really look as radioactive as these?

(https://builds.magiclantern.fm/jenkins/job/QEMU-nightly-tests/208/artifact/qemu/magiclantern-Nightly.2016Oct26.450D110/8-customize.png)

- Does the "ETTR ETTR ETTR ETTR" message show up on actual hardware as in the above screenshot?

Another surprise: if I compile ML from the vxworks branch (https://bitbucket.org/hudson/magic-lantern/branch/vxworks) (here) (https://builds.magiclantern.fm/jenkins/job/450D.110/1/), it doesn't boot correctly (https://builds.magiclantern.fm/jenkins/job/QEMU-nightly-tests/200/consoleText). When trying to compile from Ant's repository, changeset b05d7ea7f486 does not exist (https://builds.magiclantern.fm/jenkins/job/450D.110/3/consoleText) (did I misread the screenshot?) and his vxworks branch (https://bitbucket.org/Ant123/magic-lantern/commits/branch/vxworks) doesn't work either (emulation log (https://builds.magiclantern.fm/jenkins/job/QEMU-nightly-tests/209/consoleText) - it gets stuck on initial screen (https://builds.magiclantern.fm/jenkins/job/QEMU-nightly-tests/209/artifact/qemu/magiclantern-Nightly.2017Sep22.450D110/menu.gif)). Compiling from latest changeset from Ant (c700f92) gives the same result (stuck on initial screen, with LED turned on).

Unfortunately, I did not have this commit (https://bitbucket.org/hudson/magic-lantern/commits/9814dc67f327) when Ant posted his build - that would have embedded his local (uncommitted) changes in the executable file - so I'm unable to re-create his binaries from the current sources.

In any case, continuing the ML port on VxWorks models just got easier by an order of magnitude - or maybe two :)
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on September 24, 2017, 01:39:54 PM
Does the "ETTR ETTR ETTR ETTR" message show up on actual hardware as in the above screenshot?
Yes, if you are talking about ML Prefs menu.

Quote
Compiling from latest changeset from Ant (c700f92) gives the same result (stuck on initial screen, with LED turned on).
Try this patch:
Code: [Select]
diff -r 18ac6b0f9929 platform/450D.110/init.c
--- a/platform/450D.110/init.c Sun Oct 30 14:43:33 2016 +0200
+++ b/platform/450D.110/init.c Sun Sep 24 14:27:14 2017 +0300
@@ -89,7 +89,9 @@
  // _mem_init();
  bmp_vram_idle_ptr = malloc(360*240);
  // _find_ml_card();
- msleep(550);
+ // msleep(550);
+ uint32_t size;
+    while((FIO_GetFileSize("AUTOEXEC.BIN", &size ) != 0) || (size == 0))  msleep(10);
  _load_fonts();
        // msleep(300);
  call("DisablePowerSave");
Note: I'm using gcc-arm-none-eabi-4_7-2012q4. With GCC 4.8 it stuks.
Title: Re: Porting ML to XSi (450D)
Post by: a1ex on December 05, 2017, 01:55:49 AM
Confirmed - works with gcc-arm-none-eabi-4_7-2012q4 (without requiring the FIO workaround).

BTW - address 0xFFD65490 doesn't seem valid for 450D - did you mean 0xFFD237F0 ?

Does that mean not all these patches from disable_cache_clearing are actually required for booting?
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on December 07, 2017, 06:31:11 PM
BTW - address 0xFFD65490 doesn't seem valid for 450D - did you mean 0xFFD237F0 ?
Yes. There was wrong address 0xFFD65490.
But it doesn't help to create working binaries using modern GCC.
Only gcc-arm-none-eabi-4_7-2012q4 generates binary which doesn't stuck.

Quote
Does that mean not all these patches from disable_cache_clearing are actually required for booting?
I don't know. I just found the same opcodes based on 40D port.
Title: Re: Porting ML to XSi (450D)
Post by: gunny2k6 on January 23, 2018, 02:46:44 PM
I have tried it on my 450D and it doesn't seem to work. It is installed but I can't seem to be able to load the ML menu up, Also it messes up the live mode, it flashes strange text.

When I press bin buttom this is what show up, then it crash and have to remove the battery to restart. I pressed Set and nothing happened.

(http://thumb.ibb.co/j0sJ45/IMG_20170826_104255.jpg) (http://ibb.co/j0sJ45)


I do have 1.1.0 firmware installed. Is there a different region of 1.1.0 firmware?? My camera is UK Version.

Many Thanks

Mike

should not matter i Had 450D working with it ...i m in UK.... but have since traded in the 450D ...got as latest i could now on 77D (love it or hate it) not looked back i really like it as a huge leap forward. ye could get better but its what i wanted so :P
Title: Re: Porting ML to XSi (450D)
Post by: vijaymanickaraja on April 24, 2018, 09:21:42 AM
I have the same problem, i just put the .FIR file and was try to install it. now the camera is not booting. please help me to resolve this issue.
Title: Re: Porting ML to XSi (450D)
Post by: ArcziPL on April 24, 2018, 12:43:36 PM
I guess you put the installer (ML450D110.fir) on the card but not the ML itself. The installer set the boot-flag in the camera and made the card bootable but camera is not starting, as the the ML files are missing.

You have several solutions:
- put the ML to the card; unpack the files from the following archive
https://bitbucket.org/Ant123/magic-lantern-40d/downloads/magiclantern-Nightly.2016Oct26.450D110.zip

or
- format the card in a PC or another camera to make it non-bootable again.

In both cases camera should boot again. To clear the boot-flag from your camera you have to make it boot using any of the mentioned solutions, then put the installer on a working card (ML450D110.fir file) and select "update firmware" from camera's menu again.
Title: Re: Porting ML to XSi (450D)
Post by: justgerd on May 04, 2018, 03:48:44 PM
I'd be interested a lot in helping out. I have experience with C, but no experience with CFW of any kind. Can someone point me to resources specifically about ML?
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on May 07, 2018, 11:12:11 PM
https://www.magiclantern.fm/forum/index.php?topic=991 (https://www.magiclantern.fm/forum/index.php?topic=991)
https://bitbucket.org/hudson/magic-lantern/src/qemu/contrib/qemu/ (https://bitbucket.org/hudson/magic-lantern/src/qemu/contrib/qemu/)
https://bitbucket.org/hudson/magic-lantern/src/qemu/contrib/qemu/HACKING.rst (https://bitbucket.org/hudson/magic-lantern/src/qemu/contrib/qemu/HACKING.rst)
Title: Re: Porting ML to XSi (450D)
Post by: miguelate on May 08, 2018, 04:19:04 PM
Hi everybody, I have a 450D and I would like tu use ML on it. I have tried to install it but is not working.
I have downloaded the files from the links given on the page 1 of this topic. I have used the installer ML450D110.fir and the files from the zip file 'magiclantern-Nightly.2016Oct26.450D110'.
My firmware version is the correct one 1.1.0 and the SDcard it has been modifided on  EOScard so it is not Bootable.
When I try to install ML the screen gets black and a blue led is shinning.

May I am missing something? Or what am I doing wrong?


EDIT: Finally I could run ML on my 450D. I tought I could use video recorder function but it does not allow me. Is there any other version which I can record video with?

Thank you so much
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on May 08, 2018, 10:14:16 PM
Is there any other version which I can record video with?

EOS 450D has no video recording function out of the box. It's only theoretically possible to implement Motion JPEG(848x568px, ~22fps) recording without sound, but I abandoned the porting process in 2016 because of problems with the compiller...
Title: Re: Porting ML to XSi (450D)
Post by: reddeercity on May 09, 2018, 12:29:56 AM
EOS 450D has no video recording function out of the box. It's only theoretically possible to implement Motion JPEG(848x568px, ~22fps) recording without sound, but I abandoned the porting process in 2016 because of problems with the compiller...
Interesting -- Can you share any code ?
I'm interested in trying to get  mjpeg implementation on 5d2 & other digic4 cams .
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on May 09, 2018, 09:36:57 AM
I don't have any code.
But AFAIK this program (https://sourceforge.net/projects/eos-movrec/) captures MJPEG frames via USB. I posted the resolution and framerate from video file recorded using this program. The average bitrate was ~30-35 Mbit/s. Maybe it's limited by USB.
Title: Re: Porting ML to XSi (450D)
Post by: miguelate on May 09, 2018, 02:44:53 PM
Thank you so much for your reply Ant123
Title: Re: Porting ML to XSi (450D)
Post by: reddeercity on May 10, 2018, 04:26:24 AM
I don't have any code.
But AFAIK this program (https://sourceforge.net/projects/eos-movrec/) captures MJPEG frames via USB. I posted the resolution and framerate from video file recorded using this program. The average bitrate was ~30-35 Mbit/s. Maybe it's limited by USB.
Ok , I know of this already thanks.
On another note , I was wondering if you could PM me you rom files form a download link somewhere  ?
I interesting in decompiling it to do some investigations in the Jpeg routines .
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on May 10, 2018, 09:22:03 AM
if you could PM me you rom files form a download link somewhere  ?
I interesting in decompiling it to do some investigations in the Jpeg routines .

If you don't want to wait you can download (http://chdk.wikia.com/wiki/1000D#Available_firmware_dumps_.26_updates) and decompile 1000D fw right now.
Or do you need exactly 450D?
Title: Re: Porting ML to XSi (450D)
Post by: reddeercity on May 10, 2018, 11:10:27 PM
Thank they could be useful , I'll check them out .
Quote
Or do you need exactly 450D?
Yes , I want to see how thinks work in this cam , but that alright @ArcziPL sent me one (thanks again)
Title: Re: Porting ML to XSi (450D)
Post by: justgerd on May 16, 2018, 06:27:13 PM
So essentially, after I got the vxworks branch to compile, I tried to (probably in the worst way possible ;) port your patches for the 450D to the current tree, but I got really cryptic compiler errors. I will instead try to fix module compiler problems (not much better, but not as many) to get other modules working.

Also, am I the only one who has a flickering LiveView screen as long as ML is enabled?
Title: Re: Porting ML to XSi (450D)
Post by: Dog101 on June 02, 2018, 11:52:49 PM
Hi, I am an owner of the 450D.

I am interested in the idea of using this camera as a 4K video camera.  I saw your discussion and have been trying to get this working for quite some time now. Can anyone do a step by step basic tutorial for me to try and get somewhere?

Thanks,

Dog101
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on June 03, 2018, 05:05:26 PM
I am interested in the idea of using this camera as a 4K video camera.

slow image sensor * slow processor * slow storage device = bad idea  :)
Title: Re: Porting ML to XSi (450D)
Post by: Cuervo on July 04, 2018, 01:58:56 PM
EDIT: Finally I could run ML on my 450D. I tought I could use video recorder function but it does not allow me. Is there any other version which I can record video with?

¿How you make it work? i was trying and i can't make it run... :(
Title: Re: Porting ML to XSi (450D)
Post by: Omar.0905 on August 12, 2018, 05:57:23 AM
Buenas noches Tengo una Canon Rebel XSi o conocida como la 450D y me gustaría instarlarle la versión mas reciente del Magic Lantern  para este modelo agradezco el enlace de descarga y sus indicaciones. QAP
Title: Re: Porting ML to XSi (450D)
Post by: Audionut on August 16, 2018, 02:28:29 AM
https://builds.magiclantern.fm/
Title: Re: Porting ML to XSi (450D)
Post by: toshako on August 19, 2018, 05:54:49 PM
Hi im new to ML, i use to use CHDK on other two Canon cameras and now i want to use my 450D with ML.
I encounter same problems. The screen goes off and the blue led lights up with working autofocus.
What i missed?

Thanks in advance.

In addition i will post some screenshots:

(https://thumb.ibb.co/g1Xuaz/20180819_193003.jpg) (https://ibb.co/g1Xuaz)



(https://thumb.ibb.co/gNRWNe/EOScard.jpg) (https://ibb.co/gNRWNe)


(https://thumb.ibb.co/j3iE8K/sd.jpg) (https://ibb.co/j3iE8K)
Title: Re: Porting ML to XSi (450D)
Post by: qendis on February 16, 2019, 12:05:05 AM
Have the same problem.
ML in my camera 450d dosnt work.
Eoscard 1.40 cant help either.

1. Format card
2. copy https://bitbucket.org/Ant123/magic-lantern-40d/downloads/ML450D110.fir
3. During update blue led is blinking and nothing happend.

Any one can help ?
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on February 16, 2019, 08:36:28 AM
3. During update blue led is blinking and nothing happend.

Installer for 450D firmware 1.1.0. : https://bitbucket.org/Ant123/magic-lantern-40d/downloads/ML450D110.fir (https://bitbucket.org/Ant123/magic-lantern-40d/downloads/ML450D110.fir)
It works the same as 40D/5DC installer.


From 5D Classic thread:
7.) Launch the firmware update process. If you see any red led, then something went wrong. A solid blue led means that the bootdisk is now enabled. A blinking blue led means the bootdisk is now disabled (if you want to completely uninstall ML). Each time you run the firmware update it just toggles the bootdisk to the opposite of whatever it is currently. The installer FIR will make your CF card bootable for you, no further work required here.
8.) Turn the power switch off and pull your battery to turn the camera off. Just turn the camera on (make sure autoexec.bin and ML directory are on the card!) and you're all set. Press the Trash button to bring up the ML menu.

You only need to run the firmware update to enable the bootflag ONCE. Each time after that will only disable, re-enable, disable, re-enable, etc. the bootflag.

Title: Re: Porting ML to XSi (450D)
Post by: qendis on February 16, 2019, 11:07:10 AM
ML still does not work.
I installed the update.
After the installation, I deleted the file from the card.
I've put ML on the card.
When the camera is turned on, the red LED lights up red and nothing happens.
After turning off the boot, the camera starts normally, the trash button does not give anything.
I do not know what to do. I think I'm making a mistake somewhere.
Title: Re: Porting ML to XSi (450D)
Post by: qendis on February 16, 2019, 11:20:30 AM
(https://lh3.googleusercontent.com/6Hb2BQDXMD1I8PeIHWG0G6hdn4MaywLdFYbwvamhunFTOIH3amrTufYbNTMb8oq2gPN5S1rtsHn91s7igJN4AVwzyuYnI-PNTs0CgDWopBZPWx_Mlkd8facFhgUBcPCHBe7hUMO9a7-KMJow5to0-oES5SD7uVaz4kCHSS5Ms7gZbcRpdBm7S6L3YhBusi7f6hvaRGOuO1E7t7v89x4JH0if8pbgvJbUPc0OG6-hMYk1PjmlBNORT2xVuvBHWlnpHSz52BAOW8vTAaEyckhwJOAYUphQ5J_bJWFFoX8ubBuzIlGMcsRsrKb97VP9yqwocVEBOJjp7_ScwCIc9VGCVe7Z1-76SKhLlONwyR1qSwdtqg4_xPqRsIJIVUAy87fppmEydGHlZUXoGRoZVlJ60gXw-KAsvG5LbeTGozCfBQDMztISee4tgTg0CicwmerbflzxKZzIzdymMo029e1aFLN0vRQSDIDJvry4wQEXbJv72RE45KmbzXmdcYfRB7AB6ify1V0PmTkO3nHUt0GPXFw23h_9ROeBsXA9FxrsdgjrBmCuSdDhOZkRsK4v4DS4eVv7AUT47fS1WPRFppYLSZutx0rJk73wp-9BgWhaq79U4965gR0UdNnNfBGxSx3lL35EsgGeYwwPJizlwhJ4bS_fDxHUAa4=w800-h520-no)
(https://lh3.googleusercontent.com/TTMF8IQDWh8KYXIeM1EWAmPg6YPaHDz3upEVYtPTZbwRhCsxwa0aNk9ZrX7luW2OW9TbZFgEWyHuRXGVuzV4zXNrqTRO8nzEhjayJo57le_bdOOpzdGy_ALa8-ArueHtz51GPBq8rDI9AYAdBJd_z12sPR3N_i9qjHV-0Fn2lr_U8iOdsk7wTBE80FFv2rDX_Nz3MU61drNIP6SEogAFJ7TtXFWs8R9R0SGtWyDv0IaIumHpsScbqMHldIF2fXkc3aRXOuJ3zO-l7_7qh1LVhwanmF5cUWVpZuuxB6uZbhDGfJHMyVIYZUFthISD6lyLtnPp7i2fTFnZo72SoGgd1cqXTB97IY2CJ5qJGK7JWMQkdfVUdTb2S0cC8zD-5EsG2FPpWgt2mRDdPKB37-mtswNfvwN4YbV8NzXANXZjo7hrnNZ1I1mjj-XLFmwGklA_84tvDOZWG9PmZR2th94DwutH7UFFb2tLWXux2CGdCmnV9JLUTegde_Fqm-xq128e6lmMWgSDZhnidiB6V_aymLAFRQesVX1cF2SE3ySNdl3gelxEjWL1q2vJg9y7zJ1_5C_XtmjAkFKbKvzppiDwjGcnWBie2wLn6Phx3Qy30xOjVRLRUwYTvECPu43IQVFQSy8Yi9vEwoPSM_9bVbhv_WZmv9qNQKk=w600-h308-no)
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on February 16, 2019, 12:06:43 PM
I've put ML on the card.

Probably ML can't find some files in ML folder on SD card.
Try to format SD card in the camera and reinstall ML.
Title: Re: Porting ML to XSi (450D)
Post by: qendis on February 16, 2019, 12:56:38 PM
Welcome back. I successfully installed ML on another card.It works on an old 4 GB card.On 32 GB cards, the ML does not load. I tried it on two other cards. I do astrophotography and I need to brighten the view on the display so that I can set the focus on the stars. New versions of ML have this function available. Would you be able to program it into the 450D version? It would help me considerably. If you can do it, I would be willing to pay for that, just name your price.
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on February 16, 2019, 02:39:48 PM
On 32 GB cards, the ML does not load. I tried it on two other cards.
You can try this build (https://bitbucket.org/Ant123/magic-lantern-40d/downloads/magiclantern-Nightly.2019Feb16.450D110.zip)

Quote
I do astrophotography and I need to brighten the view on the display so that I can set the focus on the stars. New versions of ML have this function available. Would you be able to program it into the 450D version? It would help me considerably. If you can do it, I would be willing to pay for that, just name your price.

Which function do you need? Can you explain exactly?

Note: ML is not a commercial project, so I do not need your money...
Title: Re: Porting ML to XSi (450D)
Post by: qendis on February 18, 2019, 08:44:29 AM
You can try this build (https://bitbucket.org/Ant123/magic-lantern-40d/downloads/magiclantern-Nightly.2019Feb16.450D110.zip)

Which function do you need? Can you explain exactly?


Ho aganin.
I found a description of this function here:
https://wiki.magiclantern.fm/faq (https://wiki.magiclantern.fm/faq)

Probably the name is:Increase display gain.
(https://wiki.magiclantern.fm/_media/nightdemo.jpg?cache=&w=720&h=480&tok=7e5b04)

"Can I use LiveView in complete darkness?
Yes. Increase display gain, use a low FPS (with FPS override), or both. With a bit of tweaking, you can make the LiveView bright enough to manually focus on stars, for example.
Also check out the dark color schemes optimized for night shooting, or try disabling exposure simulation."

Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on February 19, 2019, 04:00:46 PM
I've compiled ML with FEATURE_LV_DISPLAY_GAIN.
But it doesn't work out of the box.
It seems that Digic 3 has no ISO_PUSH_REGISTER (0xc0f0e0f8).
Some registers are present (0xc0f08030, 0xc0f08034) but their modification has a very short effect. Probably camera refresh their values periodically.

Another problem is the lack of shadow memory. FPS override doesn't work either, but there are signs of FPS timers:
Code: [Select]
RAM:0000A7D4 08 60 F0 C0       DCD unk_C0F06008
RAM:0000A7D8 A3 09 A3 09       DCD 0x9A309A3
RAM:0000A7DC 0C 60 F0 C0       DCD unk_C0F0600C
RAM:0000A7E0 A3 09 A3 09       DCD 0x9A309A3
RAM:0000A7E4 10 60 F0 C0       DCD unk_C0F06010
RAM:0000A7E8 A3 09 00 00       DCD unk_9A3
RAM:0000A7EC 18 60 F0 C0       DCD unk_C0F06018
RAM:0000A7F0 20 00 00 00       DCD 0x20

Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on February 22, 2019, 10:51:31 PM
Got MJpeg video by inserting this code into dm-spy function:
Code: [Select]
if (lr != 0xFFAD5870)
{
        return;
}

uint32_t lvsize = MEM(0x8304);
char* lvbuf = MEM(0x8308);
if (BUF_SIZE > (len + lvsize))
{
char buff[9];
uint32_t* pnum = (uint32_t*)(buff);
*pnum = (uint32_t)(0x63643030); // "00dc"
pnum = (uint32_t*)(buff + 4);
*pnum = (uint32_t)lvsize;
memcpy(buf+len, buff, 8);
len += 8;
memcpy (buf+len, lvbuf, lvsize);
len += lvsize;
if (lvsize % 2 != 0)
{
char junk = 0;
memcpy (buf+len, &junk, 1);
len += 1;
}
}
    return;

https://filebin.net/f1akbgb5uprvkrxp/DM.TXT.AVI

Is there better way to get LV JPEG data than intercepting debug messages?
Title: Re: Porting ML to XSi (450D)
Post by: a1ex on February 23, 2019, 09:34:06 AM
The JPEG buffer is is populated *and* freed in lvcdevResourceGet, so... that's pretty much the only place for a hook, if you want to reuse Canon's approach. You could place a hook (patchmgr: patch_hook_function) directly into 0xFFAD5870, but that won't solve much (the hook code will only execute when needed, so it will be a bit cleaner). You should also speed up the copying process with either dma_memcpy (HPCopy) or edmac_memcpy; that should get rid of dropped frames.

On newer models (DIGIC 5, IIRC also 60D and newer DIGIC 4), this function no longer runs automagically while in LiveView, so this approach is only valid for older models.

There is another drawback of this JPEG stream: it's not using the full LiveView resolution. On 450D, CR2 resolution is 4312x2876 (with dcraw), so I'd expect something close to 1436x958 in LiveView. On 5D2, CR2 resolution is 5634x3753, LiveView resolution is 1880x1248, LV-JPEG resolution is 1024x680. I'm pretty sure the hardware can deliver MJPEG at full LiveView resolution; "just" need to figure out how to how to request a full-size YUV buffer (most Canons do this while recording H.264) and how to call the JPEG encoder on an arbitrarily-sized YUV buffer (likely very similar to the lossless encoder).

BTW - disabling this JPEG stream on old models could be useful for reducing power consumption. Nothing measured; just theory.
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on February 23, 2019, 12:56:20 PM
Quote
I'm pretty sure the hardware can deliver MJPEG at full LiveView resolution
But which framerate?
Current LV-JPEG resolution 848x568 used by EOS utility, EOS SDK and eos_movrec. The framerate is around 20-22.
Do you think it's limited by USB throughput?

Title: Re: Porting ML to XSi (450D)
Post by: a1ex on February 23, 2019, 03:14:45 PM
The main limiting factors are sensor readout speed, JPEG encoder speed and SD write speed.

Sensor readout speed:

- photo mode: timer A = 0x13EB, B = 0xB39 (from an older log from you), 91 microseconds / line (from 0xFFBDF2E8 VSizeSetting), so main FPS clock must be... 56 MHz x 1 channel. Yes, it's not much slower than 500D (32 MHz x 2 channels). Full-res capture at 3.82 FPS.

- LiveView: timer A = 0x9A3 (from your post), B = 0x2F7 (from your log). This gives 29.856 FPS.  During initialization, LiveView runs with timer B = 0x405, i.e. at 22 FPS. See this graph:

(https://a1ex.magiclantern.fm/bleeding-edge/lv-resolution/450D.png)

Raw readout resolution: 1440x572. From this, you will have to trim some black borders. Unfortunately, this 572 smells like 5x3 binning (572*5/3=953). Guess: (AD)TG register [100C] might control this (set to 2 for 3x3 binning; default 4). FFBE168C tg_write.

24p: expecting about 1440x760 (including borders). Maybe 1440x820, if timer A can be reduced to 2298. Maybe even more if HEAD timers are also adjusted (decreased); just a guess.

JPEG encoder speed: measure the execution time of FFBF9F44 / FFBF9DF8 (whichever is used). Place a hook before and after the call, and write down the microsecond timer delta.

SD card speed: trivial to benchmark. Expecting about 20 MB/s. Continuous recording at about 800K per JPG frame.
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on February 24, 2019, 07:13:38 PM
How to avoid the flashing(flickering) of ML menu and OSD in LiveView mode?
It also changes the colors of  Canon's OSD elements.

Was the lv_rec module replaced by mlv_rec? I'm trying to choose the reference for MJPEG recorder.
Title: Re: Porting ML to XSi (450D)
Post by: a1ex on February 24, 2019, 07:43:33 PM
Menu flickering: define GUIMODE_ML_MENU as:
Code: [Select]
#define GUIMODE_ML_MENU (lv ? 28 : 2)

That's the only valid value I could find in QEMU for LiveView.

Colors: I'd expect Canon code to restore their own palette, but needs to be double-checked (whether it works in LiveView etc).

As reference code, I'd start from mlv_lite and delete a bunch of stuff specific to raw recording. You will want to look at crop_rec_4k, as that's the only version working with variable frame sizes, but it will require heavy tweaking on the memory management side. It's a bit more complicated than it needs to be, but... the alternative would be to reinvent the wheel (buffering, speed optimizations and so on).
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on February 24, 2019, 08:05:23 PM
Menu flickering: define GUIMODE_ML_MENU as:
Code: [Select]
#define GUIMODE_ML_MENU (lv ? 28 : 2)
It doesn't help.
This video was made with #define GUIMODE_ML_MENU (RECORDING ? 0 : lv ? 49 : 2)
https://filebin.net/f1akbgb5uprvkrxp/MVI_7190.MP4?t=3h26fipc (https://filebin.net/f1akbgb5uprvkrxp/MVI_7190.MP4?t=3h26fipc)

Quote
You will want to look at crop_rec_4k, as that's the only version working with variable frame sizes, but it will require heavy tweaking on the memory management side. It's a bit more complicated than it needs to be, but... the alternative would be to reinvent the wheel (buffering, speed optimizations and so on).

Unfortunately vxworks branch is too old and has no mlv_lite and crop_rec_4k modules.
Title: Re: Porting ML to XSi (450D)
Post by: a1ex on February 24, 2019, 08:24:51 PM
SetGUIRequestMode(28) from "Don't click me" (call it after a short delay) -> I expect this to bring some transparent dialog in LiveView.

If GUIMODE_ML_MENU is actually used, it should display the same dialog "behind" ML menu, i.e. a split-second before opening it.

CURRENT_GUI_MODE should be 2C94, btw. Who knows what else is wrong, as I can barely start it in QEMU.
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on February 24, 2019, 09:46:51 PM
CURRENT_GUI_MODE should be 2C94

Already found it by myself. But it doesn't help.
Title: Re: Porting ML to XSi (450D)
Post by: reddeercity on February 25, 2019, 12:42:44 AM
Nice , thanks for starting up Mjpeg , being wanting to get in this for the last 6 months at least on d4 cams.
Great info  :) This is the kick starter I've being looking for .
Title: Re: Porting ML to XSi (450D)
Post by: toshako on May 06, 2019, 11:27:33 AM

From 5D Classic thread:

Thanks Ant123. At last it worked for me. I got the solid blue light when i updated the firmware with ML-SETUP.FIR. Then i've deleted the .fir file from SDcard and then put it back. Now the ML menu appears when i press Delete key. Now its time to figure it out how it works, and it'll take time. For now intervalometer works fine. Thank you guys.
Title: Re: Porting ML to XSi (450D)
Post by: sliper on May 10, 2019, 12:12:24 AM
I also instal sucesfull MR on my old 450D. Now i cant figure it out is there any way to shoot video with this camera?
Title: Re: Porting ML to XSi (450D)
Post by: Ant123 on May 10, 2019, 10:11:22 AM
Now i cant figure it out is there any way to shoot video with this camera?

There is only one way (https://sourceforge.net/projects/eos-movrec/) which works at the moment.
Recording MJPEG video on SD-card is not ready yet. I'm not sure that this will be completed ...
Title: Re: Porting ML to XSi (450D)
Post by: xueyide703 on July 08, 2019, 08:08:31 AM
Hey guys~

I successed installing the ML on my 450D which provided in the topic and i want to know is there any way to increase the ISO Value by using this ML firmware?
Thanks!
Title: Re: Porting ML to XSi (450D)
Post by: Kai123 on August 07, 2019, 09:27:01 AM
Hello I am new at magic lantern. I'm interested in features for astrophotography. I own the good old EOS 450D.
It is possible to take dark frames without wearing the shutter mechanism with long time exposure. More than 15 sec ?
I have seen the silent mode feature but there is only a max exposure of 15sec possible.
Could this function also be included in the PTP so that the dark frame can be triggered remote via usb?
If possible, my sequence should look like this and be triggerable via PTP:
Dark frame, light frame ( normal picture ), dark frame, light frame, ....
exposure time is greater than 1 minute.

For a better understanding:
I would like to activate the Canon Long Exposure Noise Reduction but do not use it in the EOS but instead save the created dark frame to the SD. So I always get a light frame and a dark frame on SD. Is that possible?