View Full Version : Homebrew firmware for the 5D Mark 2
Tramm Hudson May 17th, 2009, 07:56 PM I've figured out a way to build a firmware file that will disable the automatic audio gain, leaving the default +36 dB gain in place, and change the firmware version string to read '1.0.7-hudson'. This isn't the final goal, but what is does prove is that we can run our own software on the 5D Mark 2 and make the changes that will make the camera even more suited for our film uses.
A file named '5d2.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:
* copies itself above the DryOS BSS
* copies part of the DryOS ROM image into the BSS
* modifies it to reserve the new regions
* adjusts the code flow to return to itself
* creates its own task (that doesn't do anything yet)
* installs a hook so that task scheduling will call its own routine
* hooks the sound_dev_task() so that my version is used instead (which just turns off AGC)
* has a periodic timer that writes state information into a logging file for my analysis
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.
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.
The current code is very tightly integrated with the 1.0.7 firmware image; it modifies specific instructions at hard-coded addresses and uses function addresses that will change in a new firmware. If Canon releases a new firmware version, the reset shim in my code will need to be updated with locations of the functions in the new one before it can be used with it. Since nothing is modified in the camera itself when running the modified firmware, it will be possible to upgrade to Canon's hypothetical new firmware even after running my modified 1.0.7 version.
It is hard to predict how much effort will be required to implement new features like 24p and full manual control. Disabling existing features is fairly easy, which is why AGC support was the first target. Disabling auto-exposure should be easy as well, but an accurate estimate is difficult to give since I'm only working on this in my spare time.
For these reasons it is hard to say if all of the terms of Canon hack (http://canonhack.com/) will be met. Perhaps, although changing the frame rate to 24p and PAL are the ones that have the most unknowns.
So, what are the next steps?
* Figuring out how to create additional menus
* Understanding localization and string pointers into ROM1.bin
* Adding custom functions for enabling/disabling new features
* Overriding lvae_*
* AUTOBOOT.BIN to automatically start the new firmware from the CF card
* Adjusting frame rate of video (24p and PAL)
* Figuring out how to write to the frame buffer device
* Onscreen level meters
There are lots of other features that everyone wants. I'm not sure how how long any of these further projects will take. But, the first steps have been taken and hopefully we'll be able to start implementing new features once we have the initial show-stoppers fixed.
William Chung May 17th, 2009, 08:18 PM Tramm amazing work you have done there!!! Looking forward to see your progress
Alex Coelho May 17th, 2009, 08:19 PM You got to love hackers. Maybe we should email Canon about this so it would light a fire under them to make the changes we want.
Chris Barcellos May 17th, 2009, 08:50 PM Tramm:
Are you looking for input from programers on this board. I am not one, but there may be some here.
Chris Hurd May 17th, 2009, 09:24 PM Well done -- this opens a world of possibilities. Thanks Tramm,
Jacob Mason May 17th, 2009, 09:53 PM You got to love hackers. Maybe we should email Canon about this so it would light a fire under them to make the changes we want.Canon is rumored to have a firmware update for the 5DmkII ready to release in the coming weeks. I have no idea what all it'll address, but it's believed they'll only do minor updates for video. Just enough to ensure that people stop buying Nikon's manual aperture lenses. They kinda don't like how that went down so that's their only real concern. Otherwise, they need to keep it limited due to conflicts this camera poses to dedicated HD video cameras.
Jon Fairhurst May 17th, 2009, 11:26 PM ...but it's believed they'll only do minor updates for video. Just enough to ensure that people stop buying Nikon's manual aperture lenses.
This wouldn't surprise me - and I'll be happy to take it. There's also the problem of stutters when zooming a Canon lens and when the aperture changes when the exposure isn't locked. Those would be good Canon lens fixes too.
...they need to keep it limited due to conflicts this camera poses to dedicated HD video cameras.
I've been thinking about this, and am starting to think that this might not be a motivator. Let's say that Canon owns 25% of the prosumer camera market. (I have no idea about their market share. I made the 25% thing up.) If the 5D MkII is able to steal share from the prosumer video camera market, then for every four sold, Canon only loses one sale. The other sales losses are for Sony, Panasonic, JVC and whomever. And for each 5D MkII sold, there's the potential of another few thousand dollars worth of lenses, batteries and accessories.
And even with 24/25p and manual control, there's still the 12 minute limit, the DSLR form factor, the lack of electronic zoom, autofocus limitations, no built-in ND filters, no XLR audio, no timecode, rolling shutter and aliasing. The prosumer camcorder market won't crumble overnight. And big, fast sensors will rejuvenate the prosumer market.
The real loser in all of this is the $30k and over camera. Once big sensors are available for $10k and below, the high roller cameras have got to look elsewhere for differentiation. Note that Canon doesn't compete at the higher price points. If anything, Canon will soon be in a position to take away those high end sales.
So, Canon, bring on the features. You have nothing to fear! :)
William Chung May 17th, 2009, 11:30 PM Usually big companies don't like hacked firmwares because of the problems that it causes them. Hacked ones don't go through the QA and there are going to be a ton of inexperienced people trying to mess with it and bricking their cameras. Would you want to deal with that?
If he can get all those functions we want working though it will definitely speed up the process since everyone will know it's 100% possible to do.
Marcus Marchesseault May 18th, 2009, 12:44 AM "...enough to ensure that people stop buying Nikon's manual aperture lenses."
Oops! Too late. I'm a baaaaaad customer. Either that or I'm a good Nikon customer. I'm even planning to buy some brand new Nikon lenses down the road.
Nigel Barker May 18th, 2009, 03:10 AM Oops! Too late. I'm a baaaaaad customer. Either that or I'm a good Nikon customer. No, you are just a cheap customer:-) There are plenty of used Nikon lenses on the market at cheap prices. They all have an aperture ring even the more modern ones that on a Nikon will have the aperture controlled electronically by the camera. For our purposes though old totally manual lenses are fine.
Adaptor rings for fitting other camera manufacturers lenses to the Canon are also available. Lovely manual lenses from other manufacturers can be found even cheaper than the Nikon lenses. There are great lenses for brands like Practika(r) & Exakta made by Carl Zeiss of Jena which are particularly cheap.
BTW Why would you want to buy new Nikon lenses? None of the modern electronic aids e.g. focus, stabilisation are going to work.
Jon Fairhurst May 18th, 2009, 12:27 PM ...Adaptor rings for fitting other camera manufacturers lenses to the Canon are also available...
http://blog.planet5d.com/wp-content/uploads/2009/04/panavision-lens-to-canon-eos-lens-mount-adapter-agbkblog.jpg
Rumor: Harry Potter film crew using 2 Canon 5D mk ii cameras with Panavision lenses (http://blog.planet5d.com/2009/05/rumor-harry-potter-film-crew-using-2-canon-5d-mk-ii-cameras-with-panavision-lenses/)
But I digress...
A firmware hack for the 5D MkII is really welcome. I have the feeling that Canon will give us aperture control of their lenses - and will fix the stutter when their lenses change aperture/focal length. (That could be the excuse for the update.)
If that's the case, it's still not enough. Currently the shutter speed is 1/focal_length. Sorry, but I don't want my shutter speed to change within a scene just because I zoomed or used a different prime lens.
If they must go auto, the shutter should default at 180 degrees (1/60) and should increase when the ISO clips at 100, and should decrease when it clips at 3200. But aperture must be controllable. And frankly, I'd really like to push the ISO to 1,000 or so with a fast shutter for special effects.
Unless Canon unleashes this beast, we will still want this firmware mod.
Ryan Mueller May 18th, 2009, 03:39 PM Tramm, You are THE MAN! I am very intersted in what you are working on and can't wait to see what else you come up with. Keep up the incredible work!
Marcus Marchesseault May 18th, 2009, 10:37 PM "BTW Why would you want to buy new Nikon lenses? None of the modern electronic aids e.g. focus, stabilisation are going to work."
At this point, with half a dozen Nikon lenses, I really only need the AGC control hack. I'll eventually buy some new Nikon lenses to get capabilities not around 20 years ago like 20mm focal length for specialty shots like small rooms or to get that forced perspective effect that seems so popular these days. Things like that may be gimmicky, but they have their place. It is also not easy or possible to find old f2.8 zoom lenses and that is where the real need is when I do events.
Why buy Nikon now? Because it is most logical that Nikon will come out with a full-frame camera with full video controls since Canon won't want to interfere with their video division. With each lens purchase I am making it easier to switch to Nikon. Besides, I think I will put more money into lenses than the camera body so the lenses will eventually determine which body I buy in the future. I love the 5D for many of its qualities, but it has a few important things mysteriously missing.
Peer Landa May 18th, 2009, 11:16 PM Why buy Nikon now? Because it is most logical that Nikon will come out with a full-frame camera with full video controls since Canon won't want to interfere with their video division.
I kind of agree, but since Canon has a huge leg up when it comes to video, I believe it will take some time before we see such a camera from Nikon.
-- peer
Marcus Marchesseault May 18th, 2009, 11:30 PM I agree, Peer, but Nikon lenses last a LOOOOOONG time. I'm fairly certain I have a lens that is older than me. I won't feel I am wasting money getting a few $1000 lenses and waiting a couple of years to get what will probably be an amazing Nikon body. Until then, I'll be very happy to have a 5D with decent audio.
Thanks for all the hard work fixing my almost-perfect camera!
Tramm Hudson May 24th, 2009, 04:50 PM I've posted a short video of my on-screen audio meters running on the 5D Mark 2. It is the most boring 45 second video you will ever see, but it has such promise!
5D Mark Free audio meters on Vimeo (http://vimeo.com/4817844)
Jon Fairhurst May 24th, 2009, 08:03 PM Congratulations! That's a big step forward.
Chris Barcellos May 25th, 2009, 02:25 AM Tramm
It ain't boring anyway and no how... This is great news and a super effort. I have been watching your progress, and to me it is like reading a good mystery novel. Something new at every turn. Please keep posting your progress there !!!
Chris Hurd: This man needs to be moved up to wizard status or something befitting contribution !
Dylan Couper May 25th, 2009, 09:07 AM Um..... WOW!
This is brilliant. Hope Canon notices!
Chris Hurd May 25th, 2009, 10:23 AM This man needs to be moved up to wizard status...Excellent suggestion. Done!
Barlow Elton May 25th, 2009, 11:54 AM Amazing to see this stuff! Thank you for what you are attempting!
I have to put in a request if you are taking any--
Live HDMI output--If the full 1080 can be output (without overlays) while recording, that would be a big deal. If not, it would still be great if the live output's graphic overlays can be disabled and video set to full screen and hopefully the timer on locked settings can be disabled.
It's not that I'm totally unhappy with the 5D2's compression, but I would love to be able to mate it with the nanoFlash in the future.
Happy hacking!
Jon Fairhurst May 25th, 2009, 12:41 PM Great suggestion, Barlow. Full HD, even at reduced framerate, would be fantastic for live focus. If at the full framerate, it would be useful in the studio and for pulling keys. Even if some masking exists, it's still useful if you can get 2.35:1 or 2:1 aspect ratios.
Live histogram - and zebras - would be amazing too, but we're getting ahead of ourselves.
Being able to adjust the gain and having an active headphone output will be excellent improvements!
Tramm Hudson May 25th, 2009, 10:16 PM I've posted a short video of my on-screen audio meters running on the 5D Mark 2: 5D Mark Free audio meters on Vimeo (http://vimeo.com/4817844)
The video has been updated with the now flicker-free meters and full-time 16:9 crop marks.
Ryan Mueller May 25th, 2009, 10:42 PM Looking good Tramm! Looking really good!
Chris Barcellos May 25th, 2009, 10:48 PM Tramm:
Congrats on you field promotion to Wizard Status
Dan Chung May 25th, 2009, 11:13 PM Tramm,
Great work, I hope Canon takes note. Have you thought about trying to hack the magnification function to work during recording? would be pretty tough I guess.
Also how about switching the shutter button and the set button, is that possible?
Dan
Dan Brockett May 25th, 2009, 11:24 PM Tramm:
Really impressive work there! The update with the higher rate and less flicker looks pretty usable.
I know that everyone wants everything from you but it seems that after all of your great audio work, the next logical function would be to make the exposure lock stay on as long as the camera is powered up. If you can obtain the exposure ISO and shutter speed desired, the ability to hold it indefinitely would be amazing and I would think would not be very hard for you to program?
Let us know your thoughts on if enabling this function would be very difficult.
Thanks,
Dan
Dan Chung May 25th, 2009, 11:39 PM Dan,
Good point, second that. And thinking about it, what about having it maintain exposure lock after the end of a recording.
Dan
Daniel Browning May 26th, 2009, 12:20 AM Dan,
I third the motion.
Dan
Dan Chung May 26th, 2009, 12:24 AM Dan and Dan,
Now I know what the 'D' in 5DmkII stands for, its clearly Dan. Nobody else but Dans should be allowed to use one!
Dan
Wayne Avanson May 26th, 2009, 10:39 AM I would like to be known as Dan Avanson from now on then please.
Thank you.
Dan.
Dan Brockett May 26th, 2009, 01:05 PM Everyone who is anybody is a Dan.
Dan
Julian Frost May 26th, 2009, 09:10 PM Tramm,
It would be interesting to compare the newly announced firmware with the current version to see if there are any real differences... or if Canon simply changed a flag to enable manual controls and recompiled. You seem like the perfect guy for the job!
Julian
Mark Holmes May 26th, 2009, 10:02 PM And if the firmware update still does not add 24P, perhaps Canon is being considerate enough to leave you one "feature" you could add via your custom firmware.
Dan Chung May 26th, 2009, 10:27 PM Tramm,
Now that we have exposure figured out can i make another request for swapping the shutter button and set button function. I'm bascially looking for a way to get the 5dmkII to use a standard wired or wireless release to trigger the video start stop instead of firing the shutter. This would mean we could use cable releases on shoulder rigs etc without having to rely on IR, as well as allow for some great remote shooting.
Dan
Chris Barcellos May 26th, 2009, 10:56 PM Husdons latest firmware is featuring more improved sound level monitoring, and now,,
zebras. And if you listen to his vimeo demo here, he is saying he should be able to incorporate with the new firmware. As may know, his firmware resides on CF card and is only loaded into RAM, so wouldn't affect Canon's firmware.
Here is vimeo link: http://vimeo.com/4858670
Sorry if it was posted already.
|
|