Porting ML to XSi (450D)

Started by rwl408, September 06, 2013, 06:07:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dog101

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

Ant123

Quote from: Dog101 on June 02, 2018, 11:52:49 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  :)

Cuervo

Quote from: miguelate on May 08, 2018, 04:19:04 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... :(

Omar.0905

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


toshako

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:










qendis

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 ?

Ant123

Quote from: qendis on February 16, 2019, 12:05:05 AM
3. During update blue led is blinking and nothing happend.

Quote from: Ant123 on October 26, 2016, 10:54:53 PM
Installer for 450D firmware 1.1.0. : https://bitbucket.org/Ant123/magic-lantern-40d/downloads/ML450D110.fir
It works the same as 40D/5DC installer.


From 5D Classic thread:
Quote from: coutts on June 14, 2012, 04:54:02 PM
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.


qendis

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.


Ant123

Quote from: qendis on February 16, 2019, 11:07:10 AM
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.

qendis

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.

Ant123

Quote from: qendis on February 16, 2019, 12:56:38 PM
On 32 GB cards, the ML does not load. I tried it on two other cards.
You can try this build

QuoteI 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...

qendis

Quote from: Ant123 on February 16, 2019, 02:39:48 PM
You can try this build

Which function do you need? Can you explain exactly?


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

Probably the name is:Increase display gain.


"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."


Ant123

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:
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



Ant123

Got MJpeg video by inserting this code into dm-spy function:

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?

a1ex

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.

Ant123

QuoteI'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?


a1ex

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:



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.

Ant123

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.

a1ex

Menu flickering: define GUIMODE_ML_MENU as:

#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).

Ant123

Quote from: a1ex on February 24, 2019, 07:43:33 PM
Menu flickering: define GUIMODE_ML_MENU as:

#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

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.

a1ex

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.

Ant123

Quote from: a1ex on February 24, 2019, 08:24:51 PM
CURRENT_GUI_MODE should be 2C94

Already found it by myself. But it doesn't help.

reddeercity

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 .