Magic Lantern Firmware Wiki
Advertisement

Magic Lantern Firmware

Support the project!

Autopilot-onset

Thanks to your help, we have covered all our funding needs for now.

Please consider donating to EFF for us, because they do a great job in defending your digital rights, including the right to run third party software on your own devices!

Magic Lantern is an open platform for developing enhancements to the amazing Canon 5D Mark II full frame digital SLR. This camera is a "game changer" for independent film makers:

  • It allows the use of a wide range of lenses (anything that can be adapted to the EF mount).
  • The 35mm full-frame sensor is larger than the RED ONE's sensor, Super 35 film. It is approximately the size of VistaVision. This means shallower native depth-of-field than anything on the market, except for the Phantom 65.
  • The dynamic range and latitude are close to the capabilities of high-end HD cameras.
  • The low-light performance is currently unrivaled, even by the RED ONE.

But, the software in video mode has limitations, even after the recent 1.1.0 upgrade from Canon that fixed the most glaring manual exposure "bug".

That's where Magic Lantern comes in -- it turns your 5D Mark II into a 5D Mark Free. We've written extensions and widgets that fix many of the annoyances in working with the 5D Mark II on a film or video set. Our first set of fixes are targeted at the audio limitations of the camera, but there are some video enhancements included, too:

  • On-screen audio meters
  • Disabled AGC
  • Manual gain control
  • Zebra stripes (video peaking)
  • Crop marks for 16:9, 2.35:1 and 4:3
  • Todo list for more ideas


480px

Beyond those features, however, is the ability to write your own extensions or to commission new ones. Within some limitations, we can fix many of the Canon firmware problems and plan to write widgets to address the requirements of the film users of this amazing camera.

Frequently Asked Questions

Support the project!

Autopilot-onset

Thanks to your help, we have covered all our funding needs for now.

Please consider donating to EFF for us, because they do a great job in defending your digital rights, including the right to run third party software on your own devices!

General

What is it?

5D Rig

5D Mark II configured for film making with follow focus, matte box, rails, preamp and dolly

Magic Lantern is an enhancement atop of Canon's firmware that frees your Canon DSLR, allowing you to use many useful features. Initially developed for filmmakers, it now has functionality for both photo and video enthusiasts, including manual audio, zebras, focus assist tools, bracketing, motion detection and much more. It is an open (GPL) framework for developing extensions to the official software. It does not replace the existing firmware, but instead runs along side of it. There is no need to "uninstall" it -- simply format your card to reboot to the stock Canon firmware.

Is it only for video?

BulbTimer-Intervalometer-60x60s-M31-Brent
HDR-Karlskirche
MotionDetection-Bird

No.

Initially, Magic Lantern was developed by independent filmmakers and tailored for video production on 5D Mark II. Things changed when Magic Lantern was ported to smaller (APS-C) cameras, like 550D, 60D, 600D and 500D, which attracted developers interested in both still photography and DSLR video.

Where do I get it?

See the Download page.

Will it break my camera?

As of September 2009 the software has been downloaded over two thousand times and there have been no reports of damage to the cameras. While this is no guarantee of absolute safety, the stable releases have been tested by beta testers. Most of the risk is to the developers' cameras while testing new features and probing new portions of Canon's firmware. By the time the software moves from development to beta testing it has been installed hundreds or thousands of times.

What can I do to help?

If you're a programmer skilled in ARM assembly, embedded systems, GUI programming and don't mind risking your expensive camera, get the source code, join the forum, edit the wiki and make improvements.

Where do I report bugs?

For general tech-support, join the forum. For bugs and enhancement requests, use the issue tracker.

Why not just buy a video camera?

Arriflex

Arriflex ST versus the 5D, by Olivier Koos

If you can find a video camera that a) shoots HD, b) has a 50 mbps data rate, c) has interchangable lenses, d) has a 35 mm or larger sensor and e) costs less than $25k (without lenses, like the RED One), then buy that one instead. There are limitations to shooting movies on a 5D Mark II, notably the limited 12 minute recording time and lack of balanced audio inputs, but a ArriCam Lite only records 5 minutes of Super 35 and a high quality preamp like the juicedLink CX231 provides balanced inputs. The lack of auto-focus in movie mode isn't a problem either -- movies are focused manually with a follow-focus like the Cinevate Durus.

Will it work on my camera?

7D box

7D being reverse engineered

Check the nightly builds page - if your camera is listed there, it already works.

If your camera is not listed on the nightly builds page, the short answer is: maybe. Longer answer: The CHDK project successfully supports many different cameras running different operating systems, but finding the necessary kernel entry points is a very time consuming process. Since Magic Lantern is publicly available, someone with the time, the hardware and the inclination to port it to other cameras can do so.

For 400D, use 400plus.

The 40D, 450D, 1000D and 5Dmk1 are similar in hardware, but they run vxWorks and would be lots of effort to support. It may be easier to port 400plus instead. See also Other_dslr.

For Panasonic GH1 and GH2, please check http://www.gh1-hack.info/. This is a completely different bit of hardware and would require an entire from-scratch reverse engineering effort in order to port Magic Lantern.

For Nikon cameras see http://nikonhacker.com/.

There is also an effort in reverse engineering the Pentax K10/GX10 and K20/GX20 cameras. As of August 2009 they have been able to decrypt the firmware update and are making progress in understanding how the camera works.

Installation

Firmware-screenshot

How is it installed?

5D Mark II

As shown in the video, a file named 'magiclantern.fir' is copied to the CF card and "Update firmware" is selected from the menu. The running firmware shuts down, loads the file into RAM and starts it running. Rather than reflashing the ROMs, this new program starts the DryOS boot process to install itself.

550D, 60D, 600D (Unified branch)

See Unified/Install; the procedure is slightly different.

500D

See 500D/T1i_Installation.

Does it modify the camera?

Nothing is written into the ROMs. When the camera reboots, the RAM image is flushed and the bootloader FROMUTIL at 0xFFFF0000 starts the pristine copy in ROM at 0xff810000. After any reboot (or even powersave), you must select the "Update firmware" menu item. When autoboot is enabled, a flag in permanently set in the camera that allows it to boot automatically from the AUTOEXEC.BIN file on the CF card.

Is it dangerous?

I haven't bricked my camera yet, but that is no guarantee. It doesn't write to the ROMs at all, so it should be fairly safe, but anytime software is interacting with hardware there is possibility of significant damage. The FROMUTILITY appears to have a way to reflash even a bricked camera, but I don't know how to access the console.

Does it void my warranty?

It is very similar to CHDK, which has a FAQ: Does using the CHDK program void your warranty?:

First, please bear in mind that CHDK comes with no warranty for any use; you use it at your own risk. What follows is just a few thoughts, and is not a legal opinion. Many believe that using the CHDK does not harm your warranty, since it is said to be loaded into the memory only temporarily (turn off the cam and it's gone completely) and that it leaves the original camera firmware untouched

They include an email exchange with Canon:

After researching this software on the internet it appears that CHDK doesn't make any actual changes to your camera. If you delete the CHDK software from your memory card, or if you choose not to activate the CHDK software on the card (or remove and replace the batteries), then the camera will behave absolutely normally - nothing has been (or ever is) changed, so the warranty is not affected.

The Magic Lantern firmware is distributed with NO WARRANTY and NO GUARANTEES are provided. It might work. It might not. It hasn't destroyed any cameras yet, but who knows.

How will it interact with future upgrades from Canon?

We have updated it to work on the 1.0.7, 1.1.0, 2.0.3, 2.0.4 and 2.0.8 firmware versions on 5D Mark II. It is a manual process to find the symbols in each new version, although tools like patchdiff2, Gensig finsig and GPL Tools/match.py make it much easier. Each new version must be statically linked against addresses in the firmware ROM as if it were a library, which requires locating the entire set of symbols.

Despite this tight integration, Magic Lantern software does not contain any Canon code. It is entirely a clean-room implementation that runs along side the official Canon firmware as a separate DryOS task.

Features

It won't boot!

There are three likely causes:

  1. Wrong firmware version: Make sure you have the correct Canon firmware for the Magic Lantern build you are using
  2. Auto-sensor clean is enabled: It messes with the boot process and must be turned off
  3. Third-party batteries: The error message also messes with the boot process and prevents Magic Lantern from starting.

How do I bring up the Magic Lantern menus?

5D Mark II

Press Picture Style button once LiveView is displayed to bring up the Magic Lantern menu. Once in the menu:

  • Use the joystick to move between items.
  • Click the joystick to select items to toggle them.
  • Press Picture Style to exit the menu.
  • If Zebras are not turned on, the menu may not be cleared; press digital zoom or Menu to refresh the display

550D, 60D, 600D, 500D, 50D, 1100D (Unified ML)

  • Press ERASE (550D/60D/600D,500D), Picture Style (50D) or AV (1100D) to bring up the Magic Lantern menu.
  • Use arrow keys or joystick to navigate.
  • Use SET, PLAY and Q (on 500D, LV) to change values.
  • Press DISP or INFO button to get help.

For more info, see Unified/UserGuide#Magic_Lantern_menu.

How do I save the gain/zebra/etc configuration?

The configuration can be saved by going to the Debug menu and selecting Save Config. This will write the current configuration to the magiclantern.cfg file. Any comments in the file will be removed. Alternatively you can edit this file with a text editor on your computer.

How about 5, 7, 9 or more bracketing shots?

Release 0.1.6 has support for custom brackets. Eventually this will also be supported with the scripting interface and you will be able to write your own bracketing algorithm to vary shutter, ISO, aperture and focus. Scripts will be triggered via a menu item, IR remote or perhaps a USB remote.

What are the next steps?

Most of the current projects are being tracked in the issue tracking system. You can add new proposals to the tracker and perhaps a developer will be interested in working on it.

Simultaneous HDMI and LCD display?

Since the HDMI and LCD are different resolutions (1080i and 480p), it is unlikely that they can be run at the same time. It might be possible to switch the HDMI into a low-res mode and have both of them simultaneously, but this would make focusing on the HDMI monitor very difficult.

What about feature X?

See the issue tracking system] for details.

Why is the recorded audio so quiet?

The 5D has low-quality analog amps, so it is best to boost it in post. It will be no noisier than if we boosted it in the camera with digital gain, but if we boost too much in the camera, it's impossible to get a low noise result with a hot mic or preamp. We have selected the best balance available with a single value.

Why is the internal mic disabled?

You can enable it by selecting Mic Input INT in the Audio menu. The AGC can be turned off, but the quality of the internal mic is still very low.

Why is the external video disabled?

For a similar reason -- the hotplug task that handles switching between different video modes was disabled so that the A/V jack could be used for audio monitoring. There are reports of audio noise when NTSC video is being output on the jack, so HDMI is likely to be the only supported output format.

First second of audio on the first take

Due to the way Canon's firmware rewrites the audio registers, there is one second of bad audio on the first take after a reboot. This is bug 29 and may be fixed in a later release if we can rewrite the part of mvrRecStart() that does it.

Technical

Does it work with chdk?

I've used some of the CHDK tools to learn about Canon firmware files, but this is all new code. They have done an amazing job of supporting hundreds of different camera models across multiple architectures and operating systems. At some point in the future chdk might be ported to the 5D Mark 2, but this project is much more focused on just the 5D Mark II and the needs of film makers. CHDK is a great project for Canon's Point-and-Shoot cameras. Without their initial effort in understanding DryOS, Canon's firmware files and the boot process, I wouldn't have been able to make as much progress as quickly as I did. While I was able to use modern tools to analyze dump files of ROM images thanks to their efforts, they got started bitbanging a UART via the status LED on a camera body. That's truly hardcore.

Why the name change?

Originally the project was called just "5D Mark Free", but out of an abundance of caution it seemed best to avoid Canon's trademarks.

What is it written in? Can I get the source?

The firmware hack is in C, with some inline assembly for boot strapping. The firmware build tools are in Perl and use Makefiles for dependency tracking. You need an arm-linux-elf build of gcc and binutils. Most of the code analysis has been done with objdump, strings and the IDA demo. No tech support will be provided. If it breaks you get to keep both pieces. If you know what all of these terms mean and aren't scared of the possibility of breaking your camera, you can download the Magic Lantern firmware source code.

How do I get a ROM0.bin firmware image?

I've written a modified version of the 1.0.7 firmware image that uses the embedded DryOS to dump out the firmware. Since it is a derived work of Canon's firmware, I am not comfortable distributing it. There is no reason that this could not be added to the new 5d2-ml.fir file once we have custom menus, which should avoid any IP issues. We do not distribute ROM images, nor IDAPro .idb files, since they are verbatim copies of Canon's copyrighted code. You can generate the ROM images from your own camera and use the .map file to apply our names to the file inside of IDA.

What are all of the 0xff81beef things and funny names like EP_SetManualMovieMode()?

These are the addresses in the official ROM firmware for different functions and names that we have given to functions. If you load the ROM0.bin image into IDA or use objdump you can trace through the instructions to determine how the software works. If you are just using the camera, they don't need to mean anything to you, but they give other developers a place to look in the firmware image.

The function names are unlikely to be the same as the ones in Canon's source code, which we have never seen. We name functions based on what they seem to do, or debugging / diagnostic strings embedded in the function. It isn't perfect, but it is sufficient to locate the important things for task creation, file I/O and GUI operation.

Is it legal?

This is a "clean room" / "black box" reverse engineering effort and as such should be ok. Frequently asked questions about reverse engineering addresses the legality question; producing an interoperable product is one of the explicit allowances enshrined in law.

Misc

Has Canon contacted you?

No one at Canon has contacted me regarding Magic Lantern or software development for the 5D/7D/1D series of cameras. I am very eager to discuss the project with them, however, so if you have any technical contacts inside of Canon's software team, please put them in touch with me.

Who is that guy in the corner?

He is the chemist Robert Cornelius and the self-portrait photograph is considered to be the first picture of a person. </noinclude>

Downloads

Technical information

Videos

Video:5D Mark II Audio Exposed (First Results) Video:Zebra stripes Early version of the onscreen audio meters

See also

Thanks

Chdk
CHDK
Without their hard work on understanding Canon's point-and-shoot cameras, this would not have been possible. They did the hard-core reverse engineering on their cameras using only a LED to blink raw machine code and built an entire community on top of it. And since they released it all under the GPL we were able to learn from their efforts.
Jon Fairhurst @ Poorly Projected Pictures
Jon did the alpha testing to find a decent set of input gains and to compare the Magic Lantern firmware against other recorders. He also handles much of the tech support and has a few thousand posts over at dvinfo.net.
Juicedlink
juicedLink
Robert at juicedLink provided guidance on the audio testing procedures and provided a CX231 preamp for testing.
Cinevate
Cinevate
Cinevate has donated a matte box and rails system. Their DSLR shooting rigs turn the 5D into a cinematic camera system.
Chris Barcellos @ MYF Media
Chris does a great job of bravely beta testing the Magic Lantern firmware and has been providing tech support.
Smallhd
SmallHD
SmallHD has provided a DP1 HDMI field monitor so that Magic Lantern can be extended to support external displays.
Glidetrack
Glidetrack
Glidetrack produces high quality, low cost and very compact tripod mounted tracks for dolly shots. It's amazing how much a tracking shot adds to the cinematic feel.
5dfilmmaking
5D Film Making
5dfilmmaking produced a much better intro video for the Magic Lantern project and can teach you to make better films with your 5D (or 7D or other DSLR), too.
Donors
Thanks to everyone who made a donation via PayPal or through equipment donations! You can donate via PayPal to help keep the project going, too.
Advertisement