Author Topic: Compiling Magic Lantern in the Cloud  (Read 74539 times)

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5919
Re: Compiling Magic Lantern in the Cloud
« Reply #75 on: June 09, 2015, 07:51:02 AM »
Interesting. Could I ask how you added changes in the raw2dng codes? I tried but my changes didn, t work. Maybe a step by step guide if you have some time?
Thanks.

Licaon_Kter

  • Hero Member
  • *****
  • Posts: 519
  • M
Re: Compiling Magic Lantern in the Cloud
« Reply #76 on: June 09, 2015, 09:39:44 AM »

Now with dmilligan's guidance we got a simple way to compile ML from source but I am getting tripped up trying to get the raw_rec and dual_iso modules because of this:
http://www.magiclantern.fm/forum/index.php?topic=14725.0
Link is wrong? But I guess you need this patch: https://bitbucket.org/hudson/magic-lantern/diff/src/chdk-dng.c?diff2=6aa15daa7bc0&at=fullres-silent-pics ?




Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5919
Re: Compiling Magic Lantern in the Cloud
« Reply #77 on: June 09, 2015, 10:52:08 AM »
Been a while since I worked on this but I tried changing things like metadata. Could have been raw_rec i fiddled with. I got to take some time to learn more deeply.
Noob question. What would it take to change metadata information in raw2dng and get a compiled binary for mac? Is the 64bit issue solved?
Thanks.

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3737
Re: Compiling Magic Lantern in the Cloud
« Reply #78 on: June 09, 2015, 09:10:09 PM »
@Licaon_Kter

Fixed the link and quoted what dmilligan wrote. Thanks for the patches.

Interesting. Could I ask how you added changes in the raw2dng codes? I tried but my changes didn, t work. Maybe a step by step guide if you have some time?
Thanks.

I was able to compile raw2dng but that was quite a while ago.

http://magiclantern.fm/forum/index.php?topic=7645.msg111168#msg111168

(Hope I posted the right link this time!)
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3737
Re: Compiling Magic Lantern in the Cloud
« Reply #79 on: June 11, 2015, 12:04:09 PM »
Darn it. I thought I fixed that link. This is the issue I'm talking about:


Yeah, cr2hdr and raw2dng have to be compiled in 32 bit mode, and this VM is 64 bit and doesn't have the 32bit gcc libraries installed. Without sudo privliges, I'm not sure installing them is possible. The only solution really is to modify the makefile for dual_iso module so that it doesn't try to compile cr2hdr (the same for raw_rec which tries to compile raw2dng).
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

Zaimon

  • New to the forum
  • *
  • Posts: 5
Re: Compiling Magic Lantern in the Cloud
« Reply #80 on: June 15, 2015, 07:33:04 PM »
Dear all,

I compiled both ML and the  LUA.mo in the cloud for a 600D, as described in the post:
http://www.magiclantern.fm/forum/index.php?topic=14725.msg145456#msg145456

I wrote a LUA script that takes a picture when the camera is switched on and I installed both the build and the script on a SD card whose size is 4GB, on the 600D.
I substituted the camera battery with an external temporized power supply that provides the power at a certain time interval and for a certain amount of time.
Everything worked fine. The camera starts, takes a picture and shut down the number of time set by the temporized external power supply.

Then I installed the ML equipped with the LUA.mo and the script on a SD card whose size is 32GB. If I use the camera battery and I manually switch on and off the camera everything works fine: the camera switch on, take a picture and when I switch the camera off it shut down normally. If I substitute the camera battery with the external temporized power supply, seems that a problem occur during the shut down. At the first bootstrap after the first shut down the console shows the following message error:
"Camera was not shut down cleanly. Skipping module loading.". The same problem do not occur with the 4GB SD card.

Does this problem is caused by the SD card size (32GB instead of 4GB)? If yes, do I have to make a partition as in the case of the CHDK?
Is there a way to automatically force the module loading even if the camera was not shut down cleanly?
Do you have any suggestion to overcome this problem?

Thanks a lot!

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 6873
Re: Compiling Magic Lantern in the Cloud
« Reply #81 on: June 15, 2015, 07:50:38 PM »
Does this problem is caused by the SD card size (32GB instead of 4GB)?

No.

Is there a way to automatically force the module loading even if the camera was not shut down cleanly?
Debug tab -> Modules debug -> Load modules after crash ON
Photogs and videographers: Assist in proof reading upcoming in-camera help!. Your input is wanted and needed!

Zaimon

  • New to the forum
  • *
  • Posts: 5
Re: Compiling Magic Lantern in the Cloud
« Reply #82 on: June 16, 2015, 05:51:03 PM »
@Walter
thank you very much. It works perfectly.

jipo

  • New to the forum
  • *
  • Posts: 8
Re: Compiling Magic Lantern in the Cloud
« Reply #83 on: June 22, 2015, 11:44:26 PM »
hi,

sorry for a stupid question, but i can't go through the simple Codio setup...
1) i created an account....OK
2) i created a new project...ok
3) i failed to install sw or go to the terminal, with a mesage "Installing Software and Box access is only available if you have an active subscription."

Am I missing something, it is not for free now?

PhotoCat

  • Freshman
  • **
  • Posts: 63
Re: Compiling Magic Lantern in the Cloud
« Reply #84 on: June 24, 2015, 06:41:30 PM »
Interesting discussion! I have successfully compiled ML once
following this thread:

http://www.magiclantern.fm/forum/index.php?topic=6783.0

But that was how far I went... sadly...

Just wondering what is the advantage of cloud compiling versus the "old" way?
Sorry I am out to lunch...   pls enlighten me so that I can choose a better path
in learning how to tweak some ML codes. Tks!

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1801
Re: Compiling Magic Lantern in the Cloud
« Reply #85 on: June 24, 2015, 06:49:55 PM »
@PhotoCat

The gurus will comment I'm sure, however, from a novice perspective I think 'compile in the cloud' is great. It has opened up ML for me.

Before CITC all I could do was hope a guru would tweak ML for me.

I read about compiling on my PC, but it was al 'too much'.

With CITC I was able to tweak the ML depth of field code and prove it out, before the gurus authorized its use.

As a further example, with CITC I was able to take the latest nightly and compile a version for my IR converted 50D, ie IR diffraction.

The only 'negative' observation I have is that you need to tweak some of the batch coding, ie to force certain modules. But others have helped me here.

Bottom line: I love it!

PhotoCat

  • Freshman
  • **
  • Posts: 63
Re: Compiling Magic Lantern in the Cloud
« Reply #86 on: June 24, 2015, 07:13:04 PM »
Wow thanks garry23!
I will try it then...  so I don't need to setup the Virtual Machine on my PC any more?

My biggest road block was that I got ML to compiled and got the ML binaries but I
had no confidence to install it in my camera! So I was stuck sadly...   
Not knowing how the revision control software works (pull/push request??) is another problem...

I love to move forward if someone can help me check my binaries :)   
I know some C but very very rusty.

Thanks for all the encouragements garry23 & I really appreciate it!

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1801
Re: Compiling Magic Lantern in the Cloud
« Reply #87 on: June 24, 2015, 07:24:06 PM »
@PhotoCat

You are welcome :-)

Having been positive, I will say a few personal 'negatives'.

Like you, I consider myself someone who is able to code, BUT I'm not a C programmer. As I tried to understand ML C code, I became aware that you really need to understand C 'linguistics' before writing your own code. I still don't understand C well enough.

Also, ML code, although often commented, is not always readable, eg unless you wrote the code in the first place. This is not a moan, but a simple observation: ML is complex, ie with bits here and bits there.

I believe an alternative avenue is opening up, and one I have yet to try. That is script writing. I would also suggest you look at this.

Cheers

Garry



PhotoCat

  • Freshman
  • **
  • Posts: 63
Re: Compiling Magic Lantern in the Cloud
« Reply #88 on: June 24, 2015, 09:10:32 PM »
Tks Garry23 once again for the pointer!
Script writing as in DOS script or AWK/Perl script? I have played with them a little bit but far from being proficient!
For now, I don't dream of coding ML in C. Just modifying some constants and get a working binary in my camera
will excite me very much LOL!
I also heard someone booted Linux on a Canon DSLR...   Not sure how that will change
ML development work flow in the future...
Anyway thanks for your help once again and I will see if I can get this cloud compile to work first :)

PhotoCat

  • Freshman
  • **
  • Posts: 63
Re: Compiling Magic Lantern in the Cloud
« Reply #89 on: June 24, 2015, 11:31:10 PM »
now I know what jipo is taking about:

 "Installing Software and Box access is only available if you have an active subscription."

I guess "Installing software" and "terminal" functions are not free any more...

I signed in via bitbucket... Can that be a problem?  Tks!

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Compiling Magic Lantern in the Cloud
« Reply #90 on: June 25, 2015, 04:02:29 AM »
https://codio.com/docs/boxes/installsw/box-parts/
Quote
As of June 2015 a subscription is required to install software packages. Existing users are not affected.

So you won't be able install the zip package, but everything else should work, and you still be able to compile ML (you just won't be able to 'make zip'). You can manually install zip though (compile it from source).

They have not taken away the "terminal", that would essentially defeat the purpose of having codio at all.

PhotoCat

  • Freshman
  • **
  • Posts: 63
Re: Compiling Magic Lantern in the Cloud
« Reply #91 on: June 25, 2015, 04:24:18 AM »
Thank you for your info dmilligan but for my beginner level, I am really at a lost here.
Perhaps I should just go back to the good old way of compiling ML on my computer with VM,
which I was successful at one time.

I think what I really need to know is how I could tell if the compiled binary file is working and not corrupted,
due to any compilation mistakes I may have.   Any tools available to test ML binary file without
risking our own camera?   Thanks a lot!

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Compiling Magic Lantern in the Cloud
« Reply #92 on: June 25, 2015, 01:02:48 PM »
I think what I really need to know is how I could tell if the compiled binary file is working and not corrupted,
due to any compilation mistakes I may have.
Try to load it on the camera.

This scenario is extremely unlikely anyway. 99.999% of the time, if you made a "compilation mistake" then the compilation would simply fail. If there were no errors during compilation and you successfully ended up with an autoexec.bin, the probability that it is somehow corrupted is extremely low. Further, even if it is "corrupted" the most likely thing to happen will be that it simply won't boot, and you'll have to pull the card and the battery. Pretty much the only thing you can do wrong is compile for the wrong camera, and if you compiled for the wrong camera, there is now an error message that shows on the screen and tells you what to do.

Any tools available to test ML binary file without risking our own camera?
There is QEMU

Just wondering what is the advantage of cloud compiling versus the "old" way?
Nothing much. It's just probably easier to set up for some folks. It doesn't require setting up a VM or the toolchain on your own computer, and there's no requirements for you own computer other simply having a web browser (so it is actually possible to do this from a tablet or smart phone). If you already have a VM setup on your computer, then that is probably the way to go.

PhotoCat

  • Freshman
  • **
  • Posts: 63
Re: Compiling Magic Lantern in the Cloud
« Reply #93 on: June 25, 2015, 05:14:16 PM »
Kindly thanks dmilligan for your pointers and encouragement once again! OK I will try to setup the VM environment agn on my win7 machine...
and compile...
Hopefully I will have the courage to load the binaries into my cam!

btw, I will follow this video this time:

http://www.magiclantern.fm/forum/index.php?topic=6425.msg55525#msg55525

Licaon_Kter

  • Hero Member
  • *****
  • Posts: 519
  • M
Re: Compiling Magic Lantern in the Cloud
« Reply #94 on: June 25, 2015, 07:03:21 PM »
I did not see the youtube clip, but I advise you to use this compiler: https://launchpad.net/gcc-arm-embedded/+milestone/4.8-2014-q3-update -> gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2
you unpack it in /home/<username>/arm-toolchain

Makefile.user (to put in the root of magic-lantern)

Code: [Select]
SUPPORTED_MODELS:=EOSM
SUPPORTED_UNIFIED_MODELS:=
ARM_ABI=none-eabi
ARM_PATH=~/arm-toolchain
GCC_VERSION=-4.8.4
ARM_BINPATH=$(ARM_PATH)/bin
CONFIG_TCC          = y
CONFIG_MODULES      = y
CONFIG_PICOC        = y

Replace EOSM with your camera model, see these two lists, leave only your targets:
Code: [Select]
SUPPORTED_MODELS:=50D 60D 550D 600D 500D 5D2 5D3 7D 650D 700D EOSM 1100D 6D
SUPPORTED_UNIFIED_MODELS:=50D 60D 550D 600D 500D 5D2 1100D

in the magic-lantern folder run:
Code: [Select]
make clean && make && make all_modules && cd platform/<yourcamera> && make zip(yeah yeah it's a bit redundant but works ok and you make sure it's a clean slate before re-compile ;) )

PhotoCat

  • Freshman
  • **
  • Posts: 63
Re: Compiling Magic Lantern in the Cloud
« Reply #95 on: June 25, 2015, 09:07:01 PM »
Thanks Licaon_Kter for the good info!  I think last time I only used gcc!
Wow, this gcc-arm-embedded one sound wonderful!  Tks!!   :)

josepvm

  • Member
  • ***
  • Posts: 212
Re: Compiling Magic Lantern in the Cloud
« Reply #96 on: June 25, 2015, 10:00:46 PM »
The default gcc compiler for a Linux distro builds binary code intended to run in your computer, usually with a x86 compatible processor. You cannot run code built this way on a Canon camera, that uses an embedded ARM processor. So you need the gcc-arm-embedded compiler to build ML and get binary code that your camera can execute, there is not another way.

PhotoCat

  • Freshman
  • **
  • Posts: 63
Re: Compiling Magic Lantern in the Cloud
« Reply #97 on: June 25, 2015, 10:13:13 PM »
thks josepvm for the good info and I am getting more confident to give it a 2nd try...    :)

PhotoCat

  • Freshman
  • **
  • Posts: 63
Re: Compiling Magic Lantern in the Cloud
« Reply #98 on: June 30, 2015, 04:53:19 AM »
Yay! I did it  :)   Thanks for all your encouragements! Got the ML codes to compile and loaded the autoexec.bin into my camera... no smoke...  8)

Got Virtualbox 4.3.28 and installed new toolchain 4.8.3 as per A1ex's recommendation.

https://launchpad.net/gcc-arm-embedded/+download

gcc-arm-none-eabi-4_8-2013q4-20131204-linux.tar.bz2 (md5)   Linux installation tarball

(not tried 4.8.4 yet)

Mathew's tutorial was great:

But somehow probably due to the newer Virtualbox version, I was unable to get the
copy-and-paste from host to VM function to work. Trying to install this function as per the video will crash Virtualbox.
So I skipped this part of the video but everything else seemed to work ok.

BTW, sorry to hijack this thread!  Now what??  Should I open a new thread or post in an existing thread?
How do I get help from now on as I am ready to do some very very minor mods to the codes?
Also I need to know the procedure to submit my new codes (if any) to the ML team... absolutely no clues...
Any pointers would be appreciated! Thanks!

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3307
  • 5D3 | M1 | 7D | 70D | SL1 | M2 | 50D
Re: Compiling Magic Lantern in the Cloud
« Reply #99 on: June 30, 2015, 05:39:38 AM »
Hello everyone -

I've decided to bite the bullet once again and get myself into this whole world of CITC... In effort to keep the development alive in the ML community. I ain't no coder but am pretty computer savvy and definitely have the patience for troubleshooting down bugs and whatnot.

Here's my 2nd take and since it has quite been a while since I last played with this... so I got to this point where it says:



Here's the clip of the entire process:

 

Perhaps it has to do with 'abort: destination 'magic-lantern' is not empty' according to Terminal?

Any suggestions or thoughts?
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109