Author Topic: Canon 1100D / T3  (Read 708295 times)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10545
  • 5D Mark Free
Canon 1100D / T3
« on: June 14, 2012, 04:50:54 PM »
Canon 1100D / T3
Current state: Release Candidate Danger, Will Robinson! Danger!


The main issues that are holding ML are:
Lack of phisical buttons (for menu, for example)

Short-term Todo List:
Done: Port 550D button hack to 1100D AE_COMP to open menu but retain the original long-press functionality.
Done: Start working on the fonts and display routines

Random bonus stuff:
Done: In-camera audio meters.

I will be posting updates here as I make progress -- Nanomad

The current version compiles and runs on 1100D.
RC 3: http://nanomad.magiclantern.fm/1100D/magiclantern-v2.3.1100D.RC3.zip Use development builds instead!!
Use the included .fir (for 1100D 1.0.5) to enable the bootflag.

Source code: http://bitbucket.org/hudson/magic-lantern/src/tip/platform/1100D.105

Development builds: http://nanomad.magiclantern.fm/nightly/

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: Canon 1100D / T3
« Reply #1 on: June 23, 2012, 05:38:53 PM »
Hi,
I'm (once again) trying to get the 1100D port up-to date. If you don't mind, I'll hijack your original post and use this thread as a work-log :P

Missing constants
  • EVF_STATE (state-object.c)
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10545
  • 5D Mark Free
Re: Canon 1100D / T3
« Reply #2 on: June 25, 2012, 09:46:22 AM »
Here you go:
Code: [Select]
#define EVF_STATE (*(struct state_object **)0x4C34)
#define MOVREC_STATE (*(struct state_object **)0x5720)

Tip: for AV button, you may want to look at 550D implementation, where it's used for arrow key shortcuts (tweaks.c). This button has different codes, depending on the shooting mode. I've only considered P, Tv, Av, M and Movie.

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: Canon 1100D / T3
« Reply #3 on: June 25, 2012, 11:19:10 AM »
Just a quick question a1ex, as I hate eating pre-made foods...
How did you find these values  :o
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10545
  • 5D Mark Free
Re: Canon 1100D / T3
« Reply #4 on: June 25, 2012, 11:42:12 AM »
Those are state objects ( http://magiclantern.wikia.com/wiki/StateObjects , http://a1ex.bitbucket.io/ML/states/ ) - some sort of event-driven tasks which are pretty easy to hijack (that is, execute ML code at certain moments, like once per LiveView frame).

Most of those things contain strings with their name (for our example, we have EvfState and Evf\\EvfState.c).

Code: [Select]
ff5969ac: ff6db6d7 ; *'EvfState'
ff5969b0: 00000001 andeq r0, r0, r1
<state matrix follows below>

The state matrix (ff5969ac) is referenced from sub_FF0F73C8. So, with arm-console:
Code: [Select]
dec sub_FF0F73C8
[...]
CreateStateObject(name='EvfState', 0x0, addr=0xFF5969B0, inputs=14, states=10) => ret_CreateStateObject_FF0F73E8
*0x4C34 = ret_CreateStateObject_FF0F73E8
return ret_CreateStateObject_FF0F73E8

So, at 0x4C34, Canon firmware saves a pointer to EvfState object (see "struct state_object" in state-object.h).

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10545
  • 5D Mark Free
Re: Canon 1100D / T3
« Reply #5 on: June 25, 2012, 11:57:02 AM »
For the fonts: on 5Dc we have used a trick to downscale the bitmap coordinates on the fly (its resolution is 720x240). On 1100D, the screen resolution is 360x240 if I remember well, but the buffer size is 720x480, and the firmware does some sort of interpolation (is it nearest neighbor or something else?).

The medium font has a width of 12 pixels, and the bottom help text in ML assumes this width (max 60 chars). Probably a very tiny font rendered at width=6px and with pixels doubled could work a bit better than current medium font.

If not, can we consider a larger font (maybe the current small font with doubled pixels, that is, width=16px), and use horizontal scrolling of help text, like in rockbox?

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: Canon 1100D / T3
« Reply #6 on: June 25, 2012, 12:04:14 PM »
I'll have a look into fonts after making the ML menu button work reliably (shouldn't take too long).

Thanks for all the help!
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10545
  • 5D Mark Free
Re: Canon 1100D / T3
« Reply #7 on: June 25, 2012, 02:50:33 PM »
Also: how much free memory do you have on 1100D? The 60D, 550D and 600D had some problems with this (but now there are solutions, only that I need to know which one to apply).

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: Canon 1100D / T3
« Reply #8 on: June 25, 2012, 03:22:06 PM »
Free Memory: 26K + 865K

Oh, and the overlay isn't showing up in the idle screen (the one that says P, ISO AUTO, AWB, MF, ...)
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10545
  • 5D Mark Free
Re: Canon 1100D / T3
« Reply #9 on: June 25, 2012, 03:30:18 PM »
Hm... not much. Can you try compiling without -mlong-calls with a 32-bit gcc?

I'll fix this (need to do the same on 600D), but it may take a while.

The overlay means clock and other small extra info from outside LiveView? It's ifdef'ed out (debug.c, around line 1800).

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: Canon 1100D / T3
« Reply #10 on: June 25, 2012, 04:07:00 PM »
Uhm, dunno if I'm doing something wrong, but the memory usage stays the same (26K + 865K)

This time I've used codesurcery 32bit arm gcc (4.6.3)
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10545
  • 5D Mark Free
Re: Canon 1100D / T3
« Reply #11 on: June 25, 2012, 04:25:56 PM »
Remove -mlong-calls from Makefile.inc .

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: Canon 1100D / T3
« Reply #12 on: June 25, 2012, 04:30:53 PM »
I've done that as soon as I switched to a 32bit compiler. Maybe it's the codesurcery compiler, dunno :o

Here's the patch I've created to make 1100D compile again

http://nanomad.magiclantern.fm/1100D-compiles.patch
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10545
  • 5D Mark Free
Re: Canon 1100D / T3
« Reply #13 on: June 26, 2012, 10:23:31 PM »
Applied memory fixes to 1100D (though you may need to double-check the addresses).

https://bitbucket.org/hudson/magic-lantern/changeset/17b0f20612c2

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: Canon 1100D / T3
« Reply #14 on: June 27, 2012, 02:34:38 PM »
Well, it sure did something.



I'll run the test suite you posted now
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10545
  • 5D Mark Free
Re: Canon 1100D / T3
« Reply #15 on: June 27, 2012, 02:39:44 PM »
Not bad. And if the screenshot feature works, it's probably enough. If not, we may have to move something from the big buffer to the small one.

The 60D gives random ERR70 if the second buffer has less than 1MB free. Probably I should also display the maximum contiguous block.

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: Canon 1100D / T3
« Reply #16 on: June 27, 2012, 03:21:36 PM »
This post contains current issues with ML

- [WONTFIX] Shutter and aperture working only in Exp Comp mode (applies to LV too)
- [L] Going from Exp Comp ON to OFF doesn't re-disable Shutter and Aperture
- [M] Focus peaking: peaks are off
- [M] Focus peaking - grayscale preview: Image is magenta
- [H] Magic Zoom: image is zoomed but it's being displayed wrong (weird aspect ratio, flickering)

Movie mode
- [H] ISO Stuff is not working

P Mode
- [L] Can't disable ExpSim
- [M] GlobalDraw - interaction with Canon graphics not working

I didn't finish testing as I have to go :P
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10545
  • 5D Mark Free
Re: Canon 1100D / T3
« Reply #17 on: June 27, 2012, 03:42:37 PM »
Exp Comp - you mean expo override? So, the 1100D now has manual video controls, right?

Focus peaking and magic zoom off: this means that HD image buffer size is incorrect. You can take silent pics and use them to guess the right size. Howto: http://magiclantern.wikia.com/wiki/VRAM/550D

Magenta image: that's strange, on the 1100D even digic commands are different :)

The 600D has problems with ExpSim too, so it should be commented out in the 1100D too.

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: Canon 1100D / T3
« Reply #18 on: June 27, 2012, 04:19:01 PM »
Yes, sorry, exp override. So we do have manual video controls as long as we activate it. Which is nice  8)
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

Arthur

  • New to the forum
  • *
  • Posts: 35
Re: Canon 1100D / T3
« Reply #19 on: July 01, 2012, 06:34:06 PM »
Hey there!

I'm want to help with the development for T3/1100D, I have a lot of experience with C/C++, but I don't have experience with reverse engineering, is it enough to help?

Also, I have experience with graphic design, so maybe I can help develop a special font that will look better on 1100D low resolution screen.

There is anyway to render ML menus in 720x240 natively, then upscale it using nearest neighbor to 720x480? I think that's how it is done on the official firmware. What would be required to change in ML in order to do this? or is it not possible due to it requiring to rewrite core parts of ML?

By the way, is 1080p video option really completely locked down on this one? Or did you guys found out anything? I remember seeng something about this on ML Google Groups last year.
EOS 1100D | EF-S 15-55mm f/3.5-5.6 IS II (Kit lens)

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: Canon 1100D / T3
« Reply #20 on: July 01, 2012, 06:38:00 PM »
Hi,
I'm glad you want to help. I suggest you start by setting up the toolchain to compile Magic Lantern and compile the latest release for the 1100D.
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10545
  • 5D Mark Free
Re: Canon 1100D / T3
« Reply #21 on: July 01, 2012, 06:39:58 PM »
The 5Dc renders ML menus at 720x240, so you can inspire from there. All the changes required for this can be in bmp.c / bmp.h / vram.c IMO.

Arthur

  • New to the forum
  • *
  • Posts: 35
Re: Canon 1100D / T3
« Reply #22 on: July 01, 2012, 07:04:18 PM »
Ok, I'll setup the toolchain on my PC here,
Then I'll look into 5Dc source.

I've seen some 5Dc constants in bmp.c and vram.c (CONFIG_5DC), won't some of them work on 1100D?

It seems that Canon is using some tricks to get most of 1100D display, can someone send me some screenshots of the original firmware menus? I want to take a look how Canon is doing it.

By the way, there is any specific reason ML font is looks like a system font?
I'm thinking about creating a more rounded font, similar to the one in the official firmware, I can do it from the scratch, pixel by pixel (I have some experience with pixel art for games and stuff).
This is specially useful for extremely small text, so I can tailor it to look good in low resolution.
EOS 1100D | EF-S 15-55mm f/3.5-5.6 IS II (Kit lens)

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: Canon 1100D / T3
« Reply #23 on: July 02, 2012, 03:58:17 PM »
Hi, I'm glad you want to help. Leave me your skype/gmail address in PM and I'll get you started on the 1100D port and ML in general.
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

Arthur

  • New to the forum
  • *
  • Posts: 35
Re: Canon 1100D / T3
« Reply #24 on: July 05, 2012, 05:07:56 PM »
Hey nanomad,
the link to the .fir on the first page is not working
you forgot the ":" after https
https://bitbucket.org/hudson/magic-lantern/issue-attachment/1150/hudson/magic-lantern/1333128527.7/1150/ml-1100d-105.fir
EOS 1100D | EF-S 15-55mm f/3.5-5.6 IS II (Kit lens)