Magic Lantern Firmware Wiki
(Expanded "will it break my camera" section)
(Trying to fix noinclude tag)
Line 40: Line 40:
 
However, there is an effort in reverse engineering the [http://pentax-hack.info/index.html 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.
 
However, there is an effort in reverse engineering the [http://pentax-hack.info/index.html 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.
   
  +
<includeonly>
<includeonly>For more questions about the Magic Lantern firmware, see the [[FAQ|full FAQ]]</includeonly><noinclude>
+
For more questions about the Magic Lantern firmware, see the [[FAQ|full FAQ]]
  +
</includeonly>
  +
<noinclude>
   
 
= Installation =
 
= Installation =

Revision as of 16:38, 21 September 2009

General

Zebra-stripes

Zebra stripes demo

What is it?

Magic Lantern is an enhancement atop of Canon's firmware that makes your 5D Mark II into the 5D Mark Free. It adds new features like onscreen audio meters and zebra stripes, as well as disables the audio AGC. It is an open (GPL) framework for developing extensions to the official software, tailored for film making needs. It does not replace the existing firmware, but instead runs along side of it. There is no need to "uninstall" it -- simply power cycle the camera to reboot to the stock Canon firmware.

Where do I get it?

You can download pre-build firmware files or the GPL licensed sources. This is still a beta version and there are some rough edges.

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, join the Magic Lantern devel mailing list, edit the wiki and make improvements.

Where do I report bugs?

For general tech-support, post questions to dvinfo's 5D forum or cinema5d's firmware forum. For bugs and enhancement requests, use the issue tracker.

Can I donate / pay for it?

You can donate via PayPal. I'm also looking for a steadicam and interesting lenses, so if you have any older ones that are no longer being used please let me know. Or you can make a donation to the EFF for me.

When will 24p be available?

24p and 25p frame rates are very important for film makers and folks in PAL countries, but one that I have not (yet) been able to achieve. While I have been able to reverse engineer most of the Canon DryOS that runs on the ARM CPU in the camera, there is no documentation at all on the DIGIC4 that is doing the actual h.264 encoding and reading from the sensor.

It may be possible to select different frame rates, and if someone is able to find the register inside the DIGIC4 to set the frame rate, we can easily toggle it in Magic Lantern. Without any documentation, however, our best hope might be that Canon will add these two frame rates to compete with the new DSLR cameras from its competitors. Additionally it might be possible to read the firmware in the 7D or 500D/T1i to see how the different frame rates are selected and to program the DIGIC4 in the 5D Mark II with the same values to see if it works.

It is hard to predict how much effort will be required to implement new features. Disabling existing features is fairly easy, which is why AGC support was the first target.

Why not just buy a video camera?

5D Rig

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

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 $150k (without lenses, like the CineAlta F35), 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 a 7D?

Short answer: Not yet. Until there is a firmware update for the 7D, it will be difficult to get a firmware dump. It might be possible to generate one with the 5D dumping toolkit, which would allow a very quick port to the 7D. Send me a camera and I'll get right on it.

Will it work on a 40D, 50D, T1i, GH1, etc?

Short answer: No. Longer answer: It is likely that the 50D and T1i are close enough to the 5D Mark 2 that the same techniques can be applied to building similar firmware. 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. Once the 5D Mark Free software is publicly available, some one with the inclination to port it to the 50D can do so. The 40D is similar in hardware, but runs vxWorks and would be lots of effort to support The GH1 is a completely different bit of hardware and would require an entire from-scratch reverse engineering effort. Until Panasonic releases a firmware update it is unlikely that any such efforts can be begun and even then it would require someone with a camera, the inclination and the skills to work on it.

However, there is 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?

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.

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. Eventually we want to be able to boot directly from the AUTOBOOT.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?

The current code is very tightly integrated with the 1.1.0 firmware image; it modifies specific instructions at hard-coded addresses and uses function addresses that will change in a new firmware. The initial Magic Lantern firmware was written to support 1.0.7; we learned some things during the port to 1.1.0 and hopefully have abstracted out enough to make it easy to move to a new Canon firmware version.

Despite this tight integration, the 5D Mark Free 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

How do I bring up the Magic Lantern menus?

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

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. Eventaully 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. 24p/25p/29.97 are all being worked on, but it is unknown how long they will take to complete or if it is possible without documentation on the DIGIC4.

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] or New feature requests 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.

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

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.