Magic Lantern Forum

Developing Magic Lantern => General Development => Topic started by: SDX on July 28, 2012, 02:53:08 PM

Title: Old lenses and aperture
Post by: SDX on July 28, 2012, 02:53:08 PM
I have a old Sigma 28-105 2.8/4 which hasn't been re-chipped. The problem is that the camera is not able to set the aperture.

This is a quite common problem, but I can't find any precise information about it. Physically there appears to be no difference between old and new lenses. Am I correct when I assume, that the only problem is the communication, the protocol?

I know it would be really hacky, but what do you think: would it be possible to grab the data that is in- and outgoing and manipulate it in order to control the aperture?
Title: Re: Old lenses and aperture
Post by: SDX on July 30, 2012, 11:07:44 PM
Ok, here is more detailed information about the problem.

First off, the problem appears only on old Sigma lenses. Those lenses have fallen significantly in price since this problem exists. Thats why you can find some really high quality APO lenses for under 100$ on ebay. It would be a big chance for people with low budget (like me) to get good lenses.

The problem itself is simple. According to this guy on flickr (http://www.flickr.com/groups/eos-manual-lenses/discuss/72157629683387582/72157629785041050/), the camera sends 3 bytes via the Dout pin (the 5th from left on the body). This is how they look like on new bodies:

0x07
0x13
<aperture>


Old bodies however send:

0x07
0x12
<aperture>


Yes, you heard it right - it's just one byte. One byte that makes hundreds of dollars difference.
I'm quite new to ML and need to know from some of you guys, if it would be possible to modify the data before it leaves the camera.

Title: Re: Old lenses and aperture
Post by: ilguercio on July 30, 2012, 11:32:02 PM
As far as i know lens to camera communication is still to be understood.
If this succeeds we could have focus confirmation for manual lenses and support for older lenses, as you say.
Let's wait.
Title: Re: Old lenses and aperture
Post by: Alia5 on August 01, 2012, 02:44:20 AM
Quote from: ilguercio on July 30, 2012, 11:32:02 PM
Let's wait.

What?! Let's get onto code!

Sadly i'm a pretty crappy developer and don't want to risk my camera with my unbelievable awful coding >.<


But i would also like this... Could get a lot of lenses on an budget :D
Title: Re: Old lenses and aperture
Post by: ilguercio on August 03, 2012, 01:43:59 PM
Well, a developer should take a closer look at the lens-camera communication.
There are chips that can be glued on lenses so they can transmit exif data and focus confirmation to the camera so it has to be possible somehow.
Title: Re: Old lenses and aperture
Post by: Chungdha on August 03, 2012, 11:09:23 PM
I got the same lens congrats, currently using nd filters with it to shoot during the day. Be great if the lens was able to work normal, able to focus plus aperture control. But enjoy the high quality of it.
Title: Re: Old lenses and aperture
Post by: SDX on August 07, 2012, 01:05:05 AM
I too can't claim to be a excellent programmer, but i would like to give it a try.
I'm not expecting a routine or hidden setting from Canons firmware which could be used.

I have no clue on what handles the communication. Maybe someone who has a bit more knowledge hardware wise could help.

Also, I see a small chance of finding bricks for the protocol in the memory, which would be used by the firmware. Maybe we could manipulate these. A kind of hacky solution which could generate a lot of trouble, but worth a try. Has someone experience on how to investigate the memory? In general it would be quite exiting to take a look on whats going on in there  :)
Title: Re: Old lenses and aperture
Post by: neo96 on October 02, 2012, 05:56:09 PM
Any news on that?
Quote from: ilguercio on July 30, 2012, 11:32:02 PM
As far as i know lens to camera communication is still to be understood.
In this thread (http://www.dslr-forum.de/showthread.php?t=649529) there are some guys who understood the protocol pretty good, maybe this helps.
Also they provide information on how to implement a chip that converts the 19 back to an 18, which let's good old Sigmas work again :)

Unfortunately it's a german forum, but if someone is interested in it I could try to translate some parts :)
Title: Re: Old lenses and aperture
Post by: ilguercio on October 02, 2012, 06:08:38 PM
Well, as i said there is a fw update for the 40 mm STM lens and since it's going to write something inside the lens it can probably be used to learn something, but i don't know.
Title: Re: Old lenses and aperture
Post by: neo96 on October 02, 2012, 06:20:52 PM
IMHO this won't help us. We need to know where the commands are stored in the camera firmware, so we can change them :)
The other problem is, because the firmware files are binary, we can't really learn something from them. Well at least I can't :D If we had access to the Canon sources, this would be much easier :)
Title: Re: Old lenses and aperture
Post by: nanomad on October 02, 2012, 06:27:24 PM
The issue is that the Lens->Camera communication is handled by a third party chip (the infamous Tx) over which we have no control
Title: Re: Old lenses and aperture
Post by: neo96 on October 02, 2012, 06:33:13 PM
Ok so even the firmware sources wouldn't help. And I think there's no way to "overlay" this thing?

But, as mentioned before, there's a way to modify the old Sigmas so they work properly. I'm thinking about doing that, but I'm not sure yet. It doesn't soud to complicated. Actually it sounds pretty simple. Just program an ATtiny to change 19s to 18s and braze it into the lens's circuit. Maybe I'll give it a try. If so, I'll report about the result here.
Title: Re: Old lenses and aperture
Post by: SDX on October 02, 2012, 08:18:27 PM
I've already searched in the memory for peaces of the protocol. Found some promising addresses, but nothing that would make me say "That's where the protocol snippets are stored!". Those I found don't have any effect on the actual output. Now that nanomad mentioned that it is handled fully by an external chip, it all makes sense.

I've heard about the "rechipping" of the lenses before. I just checked, I actually do have a few ATtinys here, so that could be done as well. But I'm more interested in a solution for everyone that doesn't require people hack their lens!

Title: Re: Old lenses and aperture
Post by: 1% on October 02, 2012, 09:26:11 PM
What happens when you put the old lens on and take a pic? Error 70? Just doesn't work?
Title: Re: Old lenses and aperture
Post by: SDX on October 02, 2012, 11:57:51 PM
The camera gives and error when not using default aperture (and that is always wide-open).

From the thread on dslr-forum.de I can determine, that the camera would accept a (18, 18) as response from the lens, even though it used (19, x) to set the aperture. So the lens doesn't even get that far. It properly sends a (12) or (15). Both (12) and (15) aren't understood yet, but I assume that at least one of those is for errors.
Getting ML to ignore those error-messages could already be a step. Since you then don't need to wait until your camera has rebooted just because you didn't pay attention to the aperture value. On the other side, that wouldn't be something we would have to bother with when we could switch between analog and digital aperture value.

Currently I'm wondering if the problem also exists the other way around. Do new lenses expect a (19, x) and can't parse a (18, x)? I have a 600 (without a D), I'll test it next weekend.
Title: Re: Old lenses and aperture
Post by: nanomad on October 03, 2012, 12:02:30 AM
*Maybe* there's hope. Post the error log here
Title: Re: Old lenses and aperture
Post by: ilguercio on October 03, 2012, 01:03:08 AM
http://kzar.net/wiki/Photo/CanonEFProtocol
Just found this online.
Title: Re: Old lenses and aperture
Post by: g3gg0 on October 03, 2012, 02:00:49 AM
Quote from: neo96 on October 02, 2012, 05:56:09 PM
Any news on that?In this thread (http://www.dslr-forum.de/showthread.php?t=649529) there are some guys who understood the protocol pretty good, maybe this helps.
Also they provide information on how to implement a chip that converts the 19 back to an 18, which let's good old Sigmas work again :)

Unfortunately it's a german forum, but if someone is interested in it I could try to translate some parts :)

well, i am german.
that are 50 pages :-/

as far i can tell, they replaced the commands 19 with 18

18 Aperture Analog
19 Aperture Digital
Title: Re: Old lenses and aperture
Post by: neo96 on October 03, 2012, 02:07:07 AM
I think the other way round isn't a problem, because old Canon lenses also work with both 18 and 19. The problem only affects Sigma lenses. I'm not sure about Tamron, but I think they licensed the protocol, while Sigma reverse-engineered it.
And reboot isn't a problem also, with my 600D pressing the shutter when getting the error makes the message dissapear.

To fix the problem the camera has to send 18 instead of 19. But as lens communication is done by the Tx Chip (?) ML can't fix that.

Maybe I'll post an error log here next week.
Title: Re: Old lenses and aperture
Post by: SDX on October 03, 2012, 08:02:34 PM
ilguercio: That is a lib with non-public source. It's meant for scientific projects that want to use EF lenses. Unfortunately we can't use it or learn something from it.

g3gg0: on the last page (50.) someone has collected the current knowledge. If there is a need (from the non-german in here), I could translate it to English.

nanomad: you'll get a log in a few hours, since the lens currently is in use ;)
Title: Re: Old lenses and aperture
Post by: nanomad on October 03, 2012, 09:59:55 PM
Interesting stuff about the possible communication between the Tx chip and the ARM CPU

http://magiclantern.wikia.com/wiki/SIO3_MREQ
Title: Re: Old lenses and aperture
Post by: SDX on October 03, 2012, 11:02:12 PM
Wow, very cool! Lets hope that the code on the Tx isn't limited to only use digital aperture, but contains a routine for switching between analog and digital.
I can see, that someone already managed to disassemble some Tx code, but apparently not the entire code or bigger peaces. Am I right?
Title: Re: Old lenses and aperture
Post by: SDX on October 04, 2012, 12:31:55 PM
Here's the log. I tested with aperture value 3.2, in case it should be relevant. http://f.9pixel.net/LOG001.LOG
Title: Re: Old lenses and aperture
Post by: bart on October 04, 2012, 04:34:18 PM
Maybe not related, but the dedicated moviemode on 550d and 600d is different than the shooting modes. I have a Tokina 400mm f.5.6 that gives err01 on all shooting modes but works  flawless in movie mode. I can make photos in modemode too.

I had the Sigma 400mm f5.6 and you can change aperture in moviemode without error. It doesn't actually change the aperture it appears to stay wide open.
Title: Re: Old lenses and aperture
Post by: neo96 on October 04, 2012, 07:28:32 PM
Yeah that's right, taking pictures in movie mode doesn't give error regardless of aperture setting but anyhow the iris stays open.
And even if it would close, taking pictures in movie mode isn't exactly brilliant :)

So do I understand that right, that if we could understand the Tx, this would be the answer to our problem?
Title: Re: Old lenses and aperture
Post by: nanomad on October 04, 2012, 07:42:33 PM
If we could understand and modify his behavior (like we do for the ARM cpu), yes.
Title: Re: Old lenses and aperture
Post by: g3gg0 on October 04, 2012, 08:35:49 PM
could be easier on 7D ;)
Title: Re: Old lenses and aperture
Post by: ilguercio on October 05, 2012, 12:04:53 AM
Quote from: g3gg0 on October 04, 2012, 08:35:49 PM
could be easier on 7D ;)
How? I mean, why are you saying this?
Title: Re: Old lenses and aperture
Post by: asettico on October 15, 2012, 12:28:43 PM
I've installed ML 2.3 last week.
When I using a manual len (samyang 14mm f/2.8) equipped with an AF Confirmation chip on my 5D mkII, I'm unable to set used aperture on my camera, I have to set it to max aperture.
If not I got a 01 Error (Communication between camera and len).

I'm using this chip:

http://www.ebay.it/itm/EMF-AF-Confirm-chip-for-Canon-lens-EOS-EF-Adapter-/220943097874?pt=US_Lens_Adapters_Mounts_Tubes&hash=item33713c2012

AF confirmation chips are usefull, because with it I'm able to set aperture before shooting and I can record in my exif data the used aperture.

How can I help to solve this problem ?

I have four of this chip because I'm also using them with old m42 lenses.

If this can help I can send a copy of chip (with an m42 adapter) to somebody that can use it for developing.

I'm also a programmer, so If I can do something more just ask me, in this moment I have a very limited knowledge of ML and I'm unable to do it by myself.
Title: Re: Old lenses and aperture
Post by: ilguercio on October 18, 2012, 03:18:10 AM
Are you sure it works?
Title: Re: Old lenses and aperture
Post by: 1% on October 18, 2012, 03:35:38 AM
I have a chip that doesn't let you set aperture. No errors, several cameras/lenses. Are you sure chip is exactly over all contacts? Everything is configured? This isn't an ML specific thing. You can cache hack the error out but I don't think it will do much good.

What happens in movie mode?

Good to know you can mount one to the samyangs as *SOMETHING* is a must with manual lenses.
Title: Re: Old lenses and aperture
Post by: imme on December 19, 2012, 08:34:30 AM
There are standalone chip makers who provide standalone chips. Just attach it with any lens and these chips start acting as CPU for that lens. feature are

1. AF confirmation beep.
2. EXIF data

but chip i am using also provides

3. Trap focus (As when camera achieves autofocus it automatically fires shutter)

If anybody can help in software like linking ML and any of these chips, an external motorized focusing rig for all these manual focus lenses can be done. This rig will make all manual focus lenses autofocusing mechanically....aperture controls can also be done.
Title: Re: Old lenses and aperture
Post by: pato on January 20, 2013, 06:51:34 PM
It would be great if you could make this happen! :)
I've got a EOS 550D and an old/new Sigma 400mm F5,6 APO HSR Macro lens. Open aperture is good, but any other causes an error message.
Attached are some of the debug logs.
https://www.dropbox.com/s/nshz3ncdoh8qf6g/LOG000.rar
Title: Re: Old lenses and aperture
Post by: luckyluc on September 10, 2013, 04:39:18 PM
Un site en français pour une solution  à ce problème
Ca fonctionne parfaitement avec mon sigma 400mm f5.6
http://altomcat.blogsite.org/ (http://altomcat.blogsite.org/)
Title: Re: Old lenses and aperture
Post by: SDX on September 10, 2013, 07:25:40 PM
Ah yea, the well known ATtiny hack. You'll find that everywhere on the internet, it is quite popular a solution.

Also: this forum is english. We speak english, we read english and no one understands French.
Title: Re: Old lenses and aperture
Post by: sleepinghouse on September 20, 2013, 11:06:56 PM
QuoteUn site en français pour une solution  à ce problème
Ca fonctionne parfaitement avec mon sigma 400mm f5.6
http://altomcat.blogsite.org/

Luckyluc says there is a site in french for this problem. And that it works perfectly for their sigma 400mm f/5.6

Chrome has built in google translation for websites, I took some french so I figured out almost all of it but putting it in google translate takes 5 seconds.
Title: Re: Old lenses and aperture
Post by: eggy on November 03, 2013, 12:10:21 PM
Yesterday I used attiny mod to rechip one Sigma 300mm APO lends. It worked nicely on 5D calssic and 7D, on new 6D body I got the lens error when changing aperture...any ideas? On 5D and 7d I did not notice any hick-ups even on 7fps shooting. Anyone got any experience on 6D?
Title: Re: Old lenses and aperture
Post by: a1ex on November 03, 2013, 12:20:55 PM
I also have trouble with third party chips for manual lenses on 5D3 (a no-name one and a optix v6). All OK on older cameras. Probably the lens protocol was changed.
Title: Re: Old lenses and aperture
Post by: Andy600 on November 03, 2013, 12:27:50 PM
Protocol was definitely changed. The guy who I buy my adapters from said customers had problems with them on the 700D, 6D, 5D3 etc but there are newer ones available now.
Title: Re: Old lenses and aperture
Post by: a1ex on November 03, 2013, 12:36:25 PM
My "optix v6" was also advertised as working on 5D3. At first sight it's fine, but once you use it for thousands of pictures, you can start noticing all sorts of quirks, like entering program mode whenever it wants, or the reported focal length and aperture changes, so it's kinda annoying. I ended up removing the chips from my lenses and focusing with DIGIC peaking, high sharpness in picture style and 10x zoom on half-shutter.
Title: Re: Old lenses and aperture
Post by: 1% on November 03, 2013, 04:04:35 PM
I have no errors setting aperture on the FF capable newer adapter. However setting the aperture doesn't behave like real aperture even if the lens and chip are set the same. Canon still darkens it digitally.
Title: Re: Old lenses and aperture
Post by: j.otisk on March 08, 2015, 09:19:14 PM
This is old thread but with still actual problem. If anybody have this type of error with old lenses, please see http://www.butterflybikers.cz/index.php/cz/elektronika/item/1-canon-eos-protocol-convertor-for-old-sigma-lens for ERROR 01 solution for old lenses which don't understand aperture command.

EDIT: link corrected, thanks to dreadylocks for notice.
Title: Re: Old lenses and aperture
Post by: conurus on March 25, 2016, 07:25:02 AM
I just tried a Sigma 28-105/3.8-5.6 UC-III of 1999 vintage. On 5D Mark II the aperture does not operate. I got an Err 01 after the exposure. With Metabones Mark IV adapter and Sony A6300, however, the aperture works fine. So one way to use those very old Sigmas is to use them on a Sony. Metabones issues the 0x13 command to move the aperture for Canon lenses but use 0x12 instead for the old Sigmas.