Re: magiclantern for 550D, compiled with shorter config file

141 views
Skip to first unread message
Message has been deleted

piers

unread,
Nov 10, 2010, 7:30:58 PM11/10/10
to Magic Lantern firmware development
I made the same changes & rebuilt a week ago and they seem to be
working well (I've been waiting for my group membership to be
approved). Will try this one in a few hours. I see two obvious issues,
mentioned below.

I note that there seems to be some need for an rc3 release and update
to the wiki documentation - I'm here to help! Happy to update the
wiki, but I thought I should probably get on the dev list before
making wholesale changes to the wiki.

While ML works well, I do note the following which I've seen mentioned
on the web but not here:

* There's no audio playback out the camera's speaker (not in new
sounddev task?)
* The internal mic is never used (Seems to me a workable solution
would be Internal+AGC if no mic plugged in, settings as-per config
file if mic plugged in)

I have mild coding and assembly skills, and might be able to work this
out eventually, but I thought I'd discuss it in case someone's just
about to release some fixes.

I guess I should raise issues for those two, yeah?

PG

On Nov 11, 9:01 am, indy arm <arm.indi...@gmail.com> wrote:
> Hi,
>
> I just compiled ML for 550D/Rebel T2i with a shorter filename for the config
> file (in 5d-hack.c)
> as done by Phil here in September:http://groups.google.com/group/ml-devel/browse_thread/thread/1192bdee...
>
> it is now
>     const char * config_filename = "B:/mlantern.cfg";
> instead of
>     const char * config_filename = "B:/magiclantern.cfg";
>
> Please tell me if it is better.
> It runs on my camera, but I do not know if the audio is working as
> expected...
>
> Additionally, my advice to build Magiclantern on Linux ishttp://www.openhardware.net/Embedded_ARM/Toolchain/
>
> Indy
>
>  autoexec.bin
> 226KViewDownload
>
>  mlantern.cfg
> 1KViewDownload

arm.indy

unread,
Nov 11, 2010, 4:03:25 AM11/11/10
to Magic Lantern firmware development
Welcome Piers,

I invited you to the the list and but it told me you're already a
member...

Do you have the tool to read IDC database applied to a 550d dump ?

Indy

Piers

unread,
Nov 11, 2010, 5:10:40 AM11/11/10
to Magic Lantern firmware development
Hi Indy,

Yeah, I think I finally got let in some hours before - whenever my
"hello, help" message got actually posted.

I have a vm where I could download the free IDA (I think I sort of got
it to run under Wine, but I don't know how well it would work). Is
that enough?

PG

Alex

unread,
Nov 11, 2010, 5:18:10 AM11/11/10
to ml-d...@googlegroups.com
It works well under Wine (I use it that way). VM is fine too. Best of all, the IDA demo runs IDAPython, so you can do lots of cool stuff.

http://magiclantern.wikia.com/wiki/IDAPython


Piers

unread,
Nov 11, 2010, 5:25:53 AM11/11/10
to Magic Lantern firmware development
Yes, runs on my KissX4 - auto gain not apparent, did a short test
record.

I did notice, however, that the aperture when it first started was
from the previous lens. Also, while zooming, the aperture change was
not reflected (while the Canon "DISP" menu at the bottom was fine.

Not sure what the point of the ML readouts of the same stuff are ... )

Anyway, I say release it!

Alex

unread,
Nov 11, 2010, 5:50:02 AM11/11/10
to Magic Lantern firmware development
Also, it's time to release my IDAPython scripts:

http://magiclantern.wikia.com/wiki/IDAPython

Renny Hayes

unread,
Nov 11, 2010, 2:18:15 PM11/11/10
to Magic Lantern firmware development
My camera will only start once with this build. I have to hard-reset
(remove and re-insert the battery) to turn it on more than once. This
may be an issue with my mlantern.cfg rather than the firmware itself.
Were there any changes made since rc2 besides the shortened cfg name
that could be causing this?

Other than that, it's great! I finally have the manual gain that I've
been wishing for since I started using the 550d. This camera produces
great audio when it's not impeded by the AGC.

indy arm

unread,
Nov 11, 2010, 3:35:56 PM11/11/10
to ml-d...@googlegroups.com
You're right Renny, I just tested the autoexec.bin sent 2 days ago and the camera hangs after being switched off and on.

So I switched back to this compiler:
 http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source
instead of (easier to install):
 http://www.openhardware.net/Embedded_ARM/Toolchain/

And everything seems OK now.

yes, the only changes made are "mlantern.cfg" in 5d-hack.c and the Makefile for the "install" target.

Here is the autoexec.bin rebuilt with the "hermann-uwe" toolchain (gcc 4.4.2).

Indy





2010/11/10 indy arm <arm.i...@gmail.com>
Hi,

I just compiled ML for 550D/Rebel T2i with a shorter filename for the config file (in 5d-hack.c)
as done by Phil here in September:
autoexec.bin
mlantern.cfg

Alex

unread,
Nov 11, 2010, 4:03:36 PM11/11/10
to Magic Lantern firmware development
Magiclantern.cfg is also used in debug.c (I'm not sure if the build
actually uses some code from there, though). Here is my changeset:

https://bitbucket.org/a1ex/magic-lantern/changeset/8bc0b6df2347
https://bitbucket.org/a1ex/magic-lantern/changeset/88b6e5761010


On Nov 11, 10:35 pm, indy arm <arm.indi...@gmail.com> wrote:
> You're right Renny, I just tested the autoexec.bin sent 2 days ago and the
> camera hangs after being switched off and on.
>
> So I switched back to this compiler:
>
> http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-b...
> instead of (easier to install):
>  http://www.openhardware.net/Embedded_ARM/Toolchain/<http://www.openhardware.net/Embedded_ARM/Toolchain/>
>
> And everything seems OK now.
>
> yes, the only changes made are "mlantern.cfg" in 5d-hack.c and the Makefile
> for the "install" target.
>
> Here is the autoexec.bin rebuilt with the "hermann-uwe" toolchain (gcc
> 4.4.2).
>
> Indy
>
> 2010/11/10 indy arm <arm.indi...@gmail.com>
>
> > Hi,
>
> > I just compiled ML for 550D/Rebel T2i with a shorter filename for the
> > config file (in 5d-hack.c)
> > as done by Phil here in September:
>
> >http://groups.google.com/group/ml-devel/browse_thread/thread/1192bdee...
>
> > it is now
> >     const char * config_filename = "B:/mlantern.cfg";
> > instead of
> >     const char * config_filename = "B:/magiclantern.cfg";
>
> > Please tell me if it is better.
> > It runs on my camera, but I do not know if the audio is working as
> > expected...
>
> > Additionally, my advice to build Magiclantern on Linux is
> >http://www.openhardware.net/Embedded_ARM/Toolchain/
>
> > Indy
>
>
>
>  autoexec.bin
> 227KViewDownload
>
>  mlantern.cfg
> 1KViewDownload

Piers

unread,
Nov 11, 2010, 8:11:36 PM11/11/10
to Magic Lantern firmware development
We *really* need to standardise that 8.3 config filename!

I guess based on his modifying of four files, I'll vote for alex's
"magic.cfg" (although it doesn't mention "lantern")

PG

On Nov 12, 8:03 am, Alex <broscutama...@gmail.com> wrote:
> Magiclantern.cfg is also used in debug.c (I'm not sure if the build
> actually uses some code from there, though). Here is my changeset:
>
> https://bitbucket.org/a1ex/magic-lantern/changeset/8bc0b6df2347https://bitbucket.org/a1ex/magic-lantern/changeset/88b6e5761010

Piers

unread,
Nov 11, 2010, 8:37:58 PM11/11/10
to Magic Lantern firmware development
Indy,

I (think) I used the uwe-hermann script to get myself able to build ML
(from the wiki how-to-build pages). I just note that the page you
linked to says "Don't use this, there's a fixed one on Git" -
http://github.com/esden/summon-arm-toolchain .

I ended up with a much newer gcc ... not sure whether my home-built
one restarts properly or not.

PG

On Nov 12, 7:35 am, indy arm <arm.indi...@gmail.com> wrote:
> You're right Renny, I just tested the autoexec.bin sent 2 days ago and the
> camera hangs after being switched off and on.
>
> So I switched back to this compiler:
>
> http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-b...
> instead of (easier to install):
>  http://www.openhardware.net/Embedded_ARM/Toolchain/<http://www.openhardware.net/Embedded_ARM/Toolchain/>
>
> And everything seems OK now.
>
> yes, the only changes made are "mlantern.cfg" in 5d-hack.c and the Makefile
> for the "install" target.
>
> Here is the autoexec.bin rebuilt with the "hermann-uwe" toolchain (gcc
> 4.4.2).
>
> Indy
>
> 2010/11/10 indy arm <arm.indi...@gmail.com>
>
>
>
> > Hi,
>
> > I just compiled ML for 550D/Rebel T2i with a shorter filename for the
> > config file (in 5d-hack.c)
> > as done by Phil here in September:
>
> >http://groups.google.com/group/ml-devel/browse_thread/thread/1192bdee...
>
> > it is now
> >     const char * config_filename = "B:/mlantern.cfg";
> > instead of
> >     const char * config_filename = "B:/magiclantern.cfg";
>
> > Please tell me if it is better.
> > It runs on my camera, but I do not know if the audio is working as
> > expected...
>
> > Additionally, my advice to build Magiclantern on Linux is
> >http://www.openhardware.net/Embedded_ARM/Toolchain/
>
> > Indy
>
>  autoexec.bin
> 227KViewDownload
>
>  mlantern.cfg
> 1KViewDownload

Alex

unread,
Nov 12, 2010, 2:12:07 AM11/12/10
to Magic Lantern firmware development
Right. I think we have 4 votes for magic.cfg (first is from Phil, who
found the fix, and another one from Tapani Toivanen; see "Update 550D
beta, now with gain control"). It does not mention "lantern", but
sounds nicer, imo.

Maybe it's good to change the config name in the 5D branch, too, and
then on the wiki.

Another change to be pushed is audio.gain.l and .r in config file. I'd
push it myself, but I'm still waiting for getting write access to the
repo...

audio.dgain = 18 # dB
audio.dgain.l = 0
audio.dgain.r = 0

Piers: yes, please try if your 4.5.2 build restarts properly. Of
course, it's also good to standardize the compiler used (I vote for
the uwe-hermann's script, the new one from git). Your test will show
whether we do need 4.3.2 or it also works with newer versions.

Piers

unread,
Nov 12, 2010, 7:02:48 AM11/12/10
to Magic Lantern firmware development
It doesn't seem to restart. But it is: late on a friday night (I'm GMT
+10), I can't be totally sure that the autoexec.bin is the one I built
and I didn't use the git script.

So there's slender hope still. Will build for sure shortly and reoprt
back.

PG

Piers

unread,
Nov 12, 2010, 5:05:41 PM11/12/10
to Magic Lantern firmware development
OK, what's happening with my build is that it will not start up again
properly if it fails to read the config file (mine's been getting
renamed left and right and I didn't have the right name last night).

I wonder if that is the no-restart bug more generally, and not the
compiler? You can tell if your config file is not read because the
whole splash message is not there (at least, that's the symptom on my
build.)

With the right config file name, my uwe-hermann gcc 4.5.2 build is
able to restart consistently.

PG

tylerwebb

unread,
Nov 12, 2010, 6:37:33 PM11/12/10
to Magic Lantern firmware development
Just installed this build that indy.arm posted. It seems to be working
for me, installed very smoothly. This is the first time I have used ML
however and so I am very unfamiliar with it, but the spash loaded the
first time, and now it loads with version number and says "Built on
2010-11-11..." etc

Just wanted to verify that it works for me consistently.

Chris Barcellos

unread,
Nov 13, 2010, 2:44:32 AM11/13/10
to Magic Lantern firmware development
Hey guys, I have been following your T21 progress. Several months
back I configured a card, a 4 gig card. Today I loaded the one
posted by indy.arm, and I was able to run with and get signal into
camera with a separate mic.

I was involved in original testing of 5D version. So far this
looks rather simple, and seems to accomplish the basic need to shut
down AGC. I know you guys are probably look at other mods, but
this version seems to be running clean. A couple of questions:

1. Has anyone devised a simple method of preparing the card. I
don't even know if I could go back and figure out how I did the last
one, and I also remember I couldn't use any bigger than a 4 gig
card. What is latest there.

2. 5D ML has a menu option to turn on external mic or turn back
to on board mic. I remember it was in the config file to, I think.
Has anyone tried adding that script to the config ?

Great work you guys !!

Chris Barcellos

Piers

unread,
Nov 13, 2010, 5:09:42 AM11/13/10
to Magic Lantern firmware development


On Nov 13, 6:44 pm, Chris Barcellos <ba...@aol.com> wrote:
>    1.   Has anyone devised a simple method of preparing the card.    I
> don't even know if I could go back and figure out how I did the last
> one,  and I also remember I couldn't use any bigger than a 4 gig
> card.    What is latest there.

I am flirting with the idea of putting a little GUI wrapper around the
Mac OS X terminal steps, partly because it's something I can do
readily, whereas wading thru diassembled firmware, well ... not sure
how much progress I'll be making there.

My idea is it would make a card bootable, copy the bits on and you
could even set the gain.

PG

Trammell Hudson

unread,
Nov 13, 2010, 10:21:54 AM11/13/10
to ml-d...@googlegroups.com
On Sat, Nov 13, 2010 at 02:09:42AM -0800, Piers wrote:
> I am flirting with the idea of putting a little GUI wrapper around the
> Mac OS X terminal steps, [...]

The easiest approach to make a card bootable in a portable fashion
is to do it in the camera. In the 5Dm2 release there is a menu option
to write the partition table, but I was not able to get this to
work on the 550D.

If you look in bootflags.c, I have commented out the call to
bootflag_write_bootblock(). I did not figure out what has changed
in the sd_device structure that is hanging the camera when I try
to write the boot block..

--
Trammell

arm.indy

unread,
Nov 13, 2010, 3:58:01 PM11/13/10
to Magic Lantern firmware development
I noticed that the buffer allocated and stored at offset 0x14 had
grown from 0x84 bytes (in 5d2 204) to 0x98 in 550d 108.
Does it help ?


ROM:FF3EBC4C ADRNE R2, aCf_devicecre_0 ;
"CF_DeviceCreate: StorageID Invalid"
ROM:FF3EBC50 BNE loc_FF3EBC7C
ROM:FF3EBC54 LDR R5, =cf_device
ROM:FF3EBC58 LDR R0, [R5,#0x14]
ROM:FF3EBC5C CMP R0, #0
ROM:FF3EBC60 BNE loc_FF3EBC8C
ROM:FF3EBC64 MOV R0, #0x98 ; 'ÿ' ; len
ROM:FF3EBC68 BL AllocateMemory
ROM:FF3EBC6C CMP R0, #0
ROM:FF3EBC70 STR R0, [R5,#0x14]

ROM:FF3F1914 ADRNE R2, aSd_devicecre_0 ;
"SD_DeviceCreate: StorageID Invalid"
ROM:FF3F1918 BNE debug_failure
ROM:FF3F191C LDR R5, =sd_device
ROM:FF3F1920 LDR R0, [R5,#4]
ROM:FF3F1924 CMP R0, #0
ROM:FF3F1928 BNE loc_FF3F1954
ROM:FF3F192C MOV R0, #0x98 ; 'ÿ' ; len
ROM:FF3F1930 BL AllocateMemory

Chris Barcellos

unread,
Nov 14, 2010, 3:41:13 AM11/14/10
to Magic Lantern firmware development
I did find the method of setting up the larger cards in WIKI, and it
looks fairly simple to set up my bigger cards now.

I also tried the audio controls with my Juiced Link CX231. The 231
was definitely powerfull enought to get a decent sound signal from my
Rode NTG 3, when I set the analog and digital gain to zero. I had
the CX231 set on high, and the dial turned to 3 oclock position.
Looking at audio track in Vegas, the floor was still around 42-44 db,
and I remember we could get the 5D to around 58 or higher. Kicking
the gain switch on the CX231 down to medium, and leaving the dial
around 3 oclock, I got a lower floor db, but also had to raise the
level in Vegas by normalizing, which raise the back ground noise.

arm.indy

unread,
Nov 14, 2010, 4:23:20 AM11/14/10
to Magic Lantern firmware development
Hi Chris,

what would be the process to improve audio quality in 550d ?
do you need audio register outputs ?

do you want a special build with CONFIG_AUDIO_REG_LOG defined, so that
registers will be logged ?

from https://bitbucket.org/hudson/magic-lantern/src/tip/audio.c
"
#ifdef CONFIG_AUDIO_REG_LOG

// Do not write the value; just read them and record to a logfile
static uint16_t audio_regs[] = {
"

Indy

Tapani Toivanen

unread,
Nov 14, 2010, 6:29:43 AM11/14/10
to ml-d...@googlegroups.com
I don't know if this is an issue for others, but at least I liked the audio better, when turning the in-camera filters off. This could be set as a configurable option for the release. There is some LPF register setting hard coded in audio.c and also the stereo emphasis filter, AUDIO_IC_FIL1, which was set at 20.

Best,
Tapani Toivanen

2010/11/14 arm.indy <arm.i...@gmail.com>
--
http://magiclantern.wikia.com/

To post to this group, send email to ml-d...@googlegroups.com
To unsubscribe from this group, send email to ml-devel+u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/ml-devel?hl=en

arm.indy

unread,
Nov 14, 2010, 9:21:01 AM11/14/10
to Magic Lantern firmware development
On 14 nov, 12:29, Tapani Toivanen <toivasentap...@gmail.com> wrote:
> There is some LPF register setting hard
> coded in audio.c

do you think about that ? how to improve this ?

// Enable the LPF
// Canon uses F2A/B = 0x0ED4 and 0x3DA9.
audio_ic_write( AUDIO_IC_LPF0 | 0xD4 );
audio_ic_write( AUDIO_IC_LPF1 | 0x0E );
audio_ic_write( AUDIO_IC_LPF2 | 0xA9 );
audio_ic_write( AUDIO_IC_LPF3 | 0x3D );

> and also the stereo emphasis filter, AUDIO_IC_FIL1, which
> was set at 20.

audio_ic_write( AUDIO_IC_FIL1
| audio_ic_read( AUDIO_IC_FIL1 )
| (1<<5)
);

what variables names for these audio configurations are you
suggesting ?
"audio.lpf1" to lpf3 ?
"audio.fil1" ?

is their any risk to burn something if mlantern.cfg has wrong/extreme
values ?

what default and safe range for these values ?

I thing I understood how to add this, but I do not want to crash
anything.

Indy

>
> Best,
> Tapani Toivanen
>
> 2010/11/14 arm.indy <arm.indi...@gmail.com>
>
> > Hi Chris,
>
> > what would be the process to improve audio quality in 550d ?
> > do you need audio register outputs ?
>
> > do you want a special build with CONFIG_AUDIO_REG_LOG defined, so that
> > registers will be logged ?
>
> > fromhttps://bitbucket.org/hudson/magic-lantern/src/tip/audio.c
> > ml-devel+u...@googlegroups.com<ml-devel%2Bunsu...@googlegroups.com>

Tapani Toivanen

unread,
Nov 14, 2010, 9:49:19 AM11/14/10
to ml-d...@googlegroups.com
Good questions, and I'm not sure if I can answer these, as I don't know the whole story behind the code. What I did was just commenting out the LPF write calls and set the AUDIO_IC_FIL1 to 0. Maybe a simple enable/disable in conf? Surely if there's a doubt of any risks involved, it should not be in a public release yet.

Tapani

2010/11/14 arm.indy <arm.i...@gmail.com>

arm.indy

unread,
Nov 14, 2010, 10:47:31 AM11/14/10
to Magic Lantern firmware development

pages 34 and 35:
http://www.asahi-kasei.co.jp/akm/en/product/ak4646/ak4646_f03e.pdf

Indy

On 14 nov, 15:49, Tapani Toivanen <toivasentap...@gmail.com> wrote:
> Good questions, and I'm not sure if I can answer these, as I don't know the
> whole story behind the code. What I did was just commenting out the LPF
> write calls and set the AUDIO_IC_FIL1 to 0. Maybe a simple enable/disable in
> conf? Surely if there's a doubt of any risks involved, it should not be in a
> public release yet.
>
> Tapani
>
> 2010/11/14 arm.indy <arm.indi...@gmail.com>
> > <ml-devel%2Bunsu...@googlegroups.com<ml-devel%252Buns...@googlegroups.com>

Tapani Toivanen

unread,
Nov 14, 2010, 12:32:20 PM11/14/10
to ml-d...@googlegroups.com
Okay, I checked out the datasheet again and I think I previously confused the FIL1(Wind Reduction filter) and FIL3(Stereo Emphasis Filter). Looks like setting FIL1 to 0 doesn't necessarily disable this the wind reduction filter. It's possible that it sets the filter coefficients. If FIL1 setting in audio.c corresponds to the FIL1 in data sheet, then we have (data sheet page 62):

F1A13-0, F1B13-0: FIL1 (Wind-noise Reduction Filter) Coefficient (14bit x 2)
Default: F1A13-0 bits = 0x1FA9, F1B13-0 bits = 0x20AD
fc = 150Hz@fs=44.1kHz

The FIL1 (Wind-noise reduction filter) ON/OFF function is controlled as follows (from page 34):
HPFAD bit controls ON/OFF of the 1st
step HPF and HPF bit controls ON/OFF of the 2nd step HPF. When the HPF is OFF, the audio data passes this block by
0dB gain. The coefficient should be set when HPFAD=HPF bits = “0” or PMADL=PMADR= PMDAC bits = “0”.

I don't know if there is a known register address for the HPF and HPFAD bits. And since I don't completely understand the effects of setting the AUDIO_IC_FIL1, maybe it's best to leave it untouched until further investigation. For my camera, setting AUDIO_IC_FIL1 to 0x00 seems to disable a low pass filter, but I'm now unsure that this is the right way to do it.

Thanks,
Tapani

2010/11/14 arm.indy <arm.i...@gmail.com>

Tapani Toivanen

unread,
Nov 14, 2010, 12:33:32 PM11/14/10
to ml-d...@googlegroups.com
Sorry, in the previous post ment to say:
For my camera, setting AUDIO_IC_FIL1 to 0x00 seems to disable a HIGH PASS filter, but I'm now unsure that this is the right way to do it.


2010/11/14 Tapani Toivanen <toivase...@gmail.com>

Morgan Look

unread,
Nov 14, 2010, 2:39:33 PM11/14/10
to ml-d...@googlegroups.com
Hi Guys, just eavesdropping on your thread.

I think that setting FIL1 to 0x00 might be disabling ALL filter functions (which is consistent with your observation of disabling the HPF), see below.

AUDIO_IC_FIL1 could possibly refer to "Digital Filter Select 1" byte as shown on page 53 (and again on page 61)

Addr��� Register Name����������� D7���� D6��� D5���� D4���� D3���� D2�� D1� D0
11H���� Digital Filter Select 1� GN1� GN0� LPF� HPF� EQ0� FIL3� 0��� HPFAD

where the bits are as follows (Table 21 on page 32 has a diagram showing where these bits plug into the filter block)
GN1-0� = Gain Compensation is used to compensate the frequency response and the gain that is changed by Stereo Separation Emphasis Filter
LPF = LPF bit controls ON/OFF of the LPF
HPF = HPF bit controls ON/OFF of the 2nd step HPF
EQ0 = EQ0 bit controls ON/OFF of EQ0 (Part of Gain Compensation Filter)
FIL3 = FIL3 bit controls ON/OFF of FIL3, FIL3 is used to emphasize the stereo separation of stereo mic recording data or playback data
HPFAD = HPFAD bit controls ON/OFF of the 1st step HPF

Hope this helps.

Regards,
Morgan.


On 15/11/2010 6:33 a.m., Tapani Toivanen wrote:
Sorry, in the previous post ment to say:
For my camera, setting AUDIO_IC_FIL1 to 0x00 seems to disable a HIGH PASS filter, but I'm now unsure that this is the right way to do it.


2010/11/14 Tapani Toivanen <toivase...@gmail.com>
Okay, I checked out the datasheet again and I think I previously confused the FIL1(Wind Reduction filter) and FIL3(Stereo Emphasis Filter). Looks like setting FIL1 to 0 doesn't necessarily disable this the wind reduction filter. It's possible that it sets the filter coefficients. If FIL1 setting in audio.c corresponds to the FIL1 in data sheet, then we have (data sheet page 62):

F1A13-0, F1B13-0: FIL1 (Wind-noise Reduction Filter) Coefficient (14bit x 2)
Default: F1A13-0 bits = 0x1FA9, F1B13-0 bits = 0x20AD
fc = 150Hz@fs=44.1kHz

The FIL1 (Wind-noise reduction filter) ON/OFF function is controlled as follows (from page 34):
HPFAD bit controls ON/OFF of the 1st
step HPF and HPF bit controls ON/OFF of the 2nd step HPF. When the HPF is OFF, the audio data passes this block by
0dB gain. The coefficient should be set when HPFAD=HPF bits = �0� or PMADL=PMADR= PMDAC bits = �0�.


I don't know if there is a known register address for the HPF and HPFAD bits. And since I don't completely understand the effects of setting the AUDIO_IC_FIL1, maybe it's best to leave it untouched until further investigation. For my camera, setting AUDIO_IC_FIL1 to 0x00 seems to disable a low pass filter, but I'm now unsure that this is the right way to do it.

Thanks,
Tapani

2010/11/14 arm.indy <arm.i...@gmail.com>


pages 34 and 35:
http://www.asahi-kasei.co.jp/akm/en/product/ak4646/ak4646_f03e.pdf

Indy

On 14 nov, 15:49, Tapani Toivanen <toivasentap...@gmail.com> wrote:
> Good questions, and I'm not sure if I can answer these, as I don't know the
> whole story behind the code. What I did was just commenting out the LPF
> write calls and set the AUDIO_IC_FIL1 to 0. Maybe a simple enable/disable in
> conf? Surely if there's a doubt of any risks involved, it should not be in a
> public release yet.
>
> Tapani
>
> 2010/11/14 arm.indy <arm.indi...@gmail.com>
>
> > On 14 nov, 12:29, Tapani Toivanen <toivasentap...@gmail.com> wrote:
> > > �There is some LPF register setting hard

> > > coded in audio.c
>
> > do you think about that ? how to improve this ?
>
> > � � � �// Enable the LPF
> > � � � �// Canon uses F2A/B = 0x0ED4 and 0x3DA9.
> > � � � �audio_ic_write( AUDIO_IC_LPF0 | 0xD4 );
> > � � � �audio_ic_write( AUDIO_IC_LPF1 | 0x0E );
> > � � � �audio_ic_write( AUDIO_IC_LPF2 | 0xA9 );
> > � � � �audio_ic_write( AUDIO_IC_LPF3 | 0x3D );

>
> > > and also the stereo emphasis filter, AUDIO_IC_FIL1, which
> > > was set at 20.
>
> > � � � � audio_ic_write( AUDIO_IC_FIL1
> > � � � � � � � �| audio_ic_read( AUDIO_IC_FIL1 )
> > � � � � � � � �| (1<<5)
> > � � � �);

>
> > what variables names for these audio configurations are you
> > suggesting ?
> > "audio.lpf1" to lpf3 ?
> > "audio.fil1" ?
>
> > is their any risk to burn something if mlantern.cfg has wrong/extreme
> > values ?
>
> > what default and safe range for these values ?
>
> > I thing I understood how to add this, but I do not want to crash
> > anything.
>
> > Indy
>
> > > Best,
> > > Tapani Toivanen
>
> > > 2010/11/14 arm.indy <arm.indi...@gmail.com>
>
> > > > Hi Chris,
>
> > > > what would be the process to improve audio quality in 550d ?
> > > > do you need audio register outputs ?
>
> > > > do you want a special build with CONFIG_AUDIO_REG_LOG defined, so that
> > > > registers will be logged ?
>
> > > > fromhttps://bitbucket.org/hudson/magic-lantern/src/tip/audio.c
> > > > "
> > > > #ifdef CONFIG_AUDIO_REG_LOG
>
> > > > // Do not write the value; just read them and record to a logfile
> > > > static uint16_t audio_regs[] = {
> > > > "
>
> > > > Indy
>
> > > > On 14 nov, 09:41, Chris Barcellos <ba...@aol.com> wrote:
> > > > > I did find the method of setting up the larger cards in WIKI, � and

> > it
> > > > > looks fairly simple to set up my bigger cards now.
>
> > > > > I also tried the audio controls with my Juiced Link CX231. � The 231

> > > > > was definitely powerfull enought to get a decent sound signal from my
> > > > > Rode NTG 3, �when I set the analog and digital gain to zero. � I had
> > > > > the CX231 set on high, �and the dial turned to 3 oclock position.

> > > > > Looking at audio track in Vegas, the floor was still around 42-44 db,
> > > > > and I remember we could get the 5D to around 58 or higher. � Kicking
> > > > > the gain switch on the CX231 down to medium, �and leaving the dial
> > > > > around 3 oclock, � I got a lower floor db, �but also had to raise the
> > > > > level in Vegas by normalizing, �which raise the back ground noise.

>
> > > > > On Nov 13, 2:09 am, Piers <pie...@gmail.com> wrote:
>
> > > > > > On Nov 13, 6:44 pm, Chris Barcellos <ba...@aol.com> wrote:
>
> > > > > > > � �1. � Has anyone devised a simple method of preparing the card.
> > > > �I

> > > > > > > don't even know if I could go back and figure out how I did the
> > last
> > > > > > > one, �and I also remember I couldn't use any bigger than a 4 gig
> > > > > > > card. � �What is latest there.

Tapani Toivanen

unread,
Nov 14, 2010, 6:02:03 PM11/14/10
to ml-d...@googlegroups.com
Yep, with that assumption a setting 0x20 (00010100) would mean that the 2nd step of the HPF and the FIL3 would be in use. With 0x00 no filtering would be in use. Can someone confirm, or is testing the only option?


2010/11/14 Morgan Look <morga...@gmail.com>
Hi Guys, just eavesdropping on your thread.

I think that setting FIL1 to 0x00 might be disabling ALL filter functions (which is consistent with your observation of disabling the HPF), see below.

AUDIO_IC_FIL1 could possibly refer to "Digital Filter Select 1" byte as shown on page 53 (and again on page 61)

Addr    Register Name            D7     D6    D5     D4     D3     D2   D1  D0
11H     Digital Filter Select 1  GN1  GN0  LPF  HPF  EQ0  FIL3  0    HPFAD


where the bits are as follows (Table 21 on page 32 has a diagram showing where these bits plug into the filter block)
GN1-0  = Gain Compensation is used to compensate the frequency response and the gain that is changed by Stereo Separation Emphasis Filter

LPF = LPF bit controls ON/OFF of the LPF
HPF = HPF bit controls ON/OFF of the 2nd step HPF
EQ0 = EQ0 bit controls ON/OFF of EQ0 (Part of Gain Compensation Filter)
FIL3 = FIL3 bit controls ON/OFF of FIL3, FIL3 is used to emphasize the stereo separation of stereo mic recording data or playback data
HPFAD = HPFAD bit controls ON/OFF of the 1st step HPF

Hope this helps.

Regards,
Morgan.


On 15/11/2010 6:33 a.m., Tapani Toivanen wrote:
Sorry, in the previous post ment to say:
For my camera, setting AUDIO_IC_FIL1 to 0x00 seems to disable a HIGH PASS filter, but I'm now unsure that this is the right way to do it.


2010/11/14 Tapani Toivanen <toivase...@gmail.com>
Okay, I checked out the datasheet again and I think I previously confused the FIL1(Wind Reduction filter) and FIL3(Stereo Emphasis Filter). Looks like setting FIL1 to 0 doesn't necessarily disable this the wind reduction filter. It's possible that it sets the filter coefficients. If FIL1 setting in audio.c corresponds to the FIL1 in data sheet, then we have (data sheet page 62):

F1A13-0, F1B13-0: FIL1 (Wind-noise Reduction Filter) Coefficient (14bit x 2)
Default: F1A13-0 bits = 0x1FA9, F1B13-0 bits = 0x20AD
fc = 150Hz@fs=44.1kHz

The FIL1 (Wind-noise reduction filter) ON/OFF function is controlled as follows (from page 34):
HPFAD bit controls ON/OFF of the 1st
step HPF and HPF bit controls ON/OFF of the 2nd step HPF. When the HPF is OFF, the audio data passes this block by
0dB gain. The coefficient should be set when HPFAD=HPF bits = “0” or PMADL=PMADR= PMDAC bits = “0”.


I don't know if there is a known register address for the HPF and HPFAD bits. And since I don't completely understand the effects of setting the AUDIO_IC_FIL1, maybe it's best to leave it untouched until further investigation. For my camera, setting AUDIO_IC_FIL1 to 0x00 seems to disable a low pass filter, but I'm now unsure that this is the right way to do it.

Thanks,
Tapani

2010/11/14 arm.indy <arm.i...@gmail.com>


pages 34 and 35:
http://www.asahi-kasei.co.jp/akm/en/product/ak4646/ak4646_f03e.pdf

Indy

On 14 nov, 15:49, Tapani Toivanen <toivasentap...@gmail.com> wrote:
> Good questions, and I'm not sure if I can answer these, as I don't know the
> whole story behind the code. What I did was just commenting out the LPF
> write calls and set the AUDIO_IC_FIL1 to 0. Maybe a simple enable/disable in
> conf? Surely if there's a doubt of any risks involved, it should not be in a
> public release yet.
>
> Tapani
>
> 2010/11/14 arm.indy <arm.indi...@gmail.com>
>
> > On 14 nov, 12:29, Tapani Toivanen <toivasentap...@gmail.com> wrote:
> > >  There is some LPF register setting hard
> > > coded in audio.c
>
> > do you think about that ? how to improve this ?
>
> >        // Enable the LPF

> >        // Canon uses F2A/B = 0x0ED4 and 0x3DA9.
> >        audio_ic_write( AUDIO_IC_LPF0 | 0xD4 );
> >        audio_ic_write( AUDIO_IC_LPF1 | 0x0E );
> >        audio_ic_write( AUDIO_IC_LPF2 | 0xA9 );
> >        audio_ic_write( AUDIO_IC_LPF3 | 0x3D );
>
> > > and also the stereo emphasis filter, AUDIO_IC_FIL1, which
> > > was set at 20.
>
> >         audio_ic_write( AUDIO_IC_FIL1
> >                | audio_ic_read( AUDIO_IC_FIL1 )
> >                | (1<<5)
> > > > > I did find the method of setting up the larger cards in WIKI,   and

> > it
> > > > > looks fairly simple to set up my bigger cards now.
>
> > > > > I also tried the audio controls with my Juiced Link CX231.   The 231

> > > > > was definitely powerfull enought to get a decent sound signal from my
> > > > > Rode NTG 3,  when I set the analog and digital gain to zero.   I had
> > > > > the CX231 set on high,  and the dial turned to 3 oclock position.

> > > > > Looking at audio track in Vegas, the floor was still around 42-44 db,
> > > > > and I remember we could get the 5D to around 58 or higher.   Kicking
> > > > > the gain switch on the CX231 down to medium,  and leaving the dial
> > > > > around 3 oclock,   I got a lower floor db,  but also had to raise the
> > > > > level in Vegas by normalizing,  which raise the back ground noise.

>
> > > > > On Nov 13, 2:09 am, Piers <pie...@gmail.com> wrote:
>
> > > > > > On Nov 13, 6:44 pm, Chris Barcellos <ba...@aol.com> wrote:
>
> > > > > > >    1.   Has anyone devised a simple method of preparing the card.

> > > >  I
> > > > > > > don't even know if I could go back and figure out how I did the
> > last
> > > > > > > one,  and I also remember I couldn't use any bigger than a 4 gig
> > > > > > > card.    What is latest there.

Morgan Look

unread,
Nov 14, 2010, 7:09:58 PM11/14/10
to ml-d...@googlegroups.com
On an unrelated note...

Has anyone attempted to increase the sampling rate to 48kHz?� This could produce higher quality recordings.
Any filters in use would need recalculating for the same cut-off frequencies etc.. (or simply turn them all off, as we may have just done).

It looks to me that the settings are in "Mode Control 2" register (AUDIO_IC_PM2 in audio.c) (See table 5, on page 20).

The register definition on Page 52
Addr Register Name� D7���� D6��� D5��� D4 D3 D2 � � D1��� D0
05H� Mode Control 2� PS1� PS0� FS3� 0 � 0 ��� FS2� FS1� FS0

If someone is able to read the value of this register, they should observe (for fs=44.1kHz) FS3 = FS2 = FS1 = FS0 = 1
to change this to 48kHz, FS2 should be set to 0, (leaving FS3 = FS1 = FS0 = 1).

Not sure what effect this would have on the rest of the system, i.e. can the camera still play back movies etc...� Ideally it would simply increase the frequency response of the recordings, with a small increase in file size.� Could potentially crash the camera if it's trying to encode audio at the wrong sample rate.

Morgan.


On 15/11/2010 12:02 p.m., Tapani Toivanen wrote:
Yep, with that assumption a setting 0x20 (00010100) would mean that the 2nd step of the HPF and the FIL3 would be in use. With 0x00 no filtering would be in use. Can someone confirm, or is testing the only option?


2010/11/14 Morgan Look <morga...@gmail.com>
Hi Guys, just eavesdropping on your thread.

I think that setting FIL1 to 0x00 might be disabling ALL filter functions (which is consistent with your observation of disabling the HPF), see below.

AUDIO_IC_FIL1 could possibly refer to "Digital Filter Select 1" byte as shown on page 53 (and again on page 61)

Addr��� Register Name����������� D7���� D6��� D5���� D4���� D3���� D2�� D1� D0
11H���� Digital Filter Select 1� GN1� GN0� LPF� HPF� EQ0� FIL3� 0��� HPFAD


where the bits are as follows (Table 21 on page 32 has a diagram showing where these bits plug into the filter block)
GN1-0� = Gain Compensation is used to compensate the frequency response and the gain that is changed by Stereo Separation Emphasis Filter

Piers

unread,
Nov 14, 2010, 8:58:45 PM11/14/10
to Magic Lantern firmware development
For the record, while you can never be 100% certain about things when
you're reverse engineering consumer products, I cannot think of, and
have never seen, a way that removing some digital audio filters could
do any harm to hardware, or file integrity.

I would think at this stage a simple "audio filters off" flag cover
things. Like AGC, you either want the Canon defaults, or you want you
signal totally unprocessed.

PG
> > > > > ml-devel+u...@googlegroups.com<ml-devel%2Bunsubscribe@googlegroups.c om>
> > > <ml-devel%2Bunsu...@googlegroups.com<ml-devel%252Bunsubscribe@googlegro ups.com>
>
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/ml-devel?hl=en
>
> > > --
> > >http://magiclantern.wikia.com/
>
> > > To post to this group, send email to ml-d...@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > ml-devel+u...@googlegroups.com<ml-devel%2Bunsubscribe@googlegroups.c om>

Antony Newman

unread,
Nov 15, 2010, 7:53:04 AM11/15/10
to ml-d...@googlegroups.com
Morgan,
 
The 5D2 dryos used to set the sampling rate to 44.1 Khz.
Canon then upped this to 48Hkz when recording,  HDMI audio output when not recording is kept at 44.1khz.
 
Comparison of the two firmware versions will highlight what 48Khz audio related changes Canon made to the dryos (could be a bit time consuming!).
 
Antony 
 

arm.indy

unread,
Nov 15, 2010, 2:34:43 PM11/15/10
to Magic Lantern firmware development
In which firmware Antony?

Antony Newman

unread,
Nov 15, 2010, 2:57:08 PM11/15/10
to ml-d...@googlegroups.com
Indy,

It was in the 5D2 upgrade to 2.0.4

http://www.usa.canon.com/dlc/controller?act=GetArticleAct&articleID=3287

Regards,
Antony

Piers

unread,
Nov 16, 2010, 3:00:40 AM11/16/10
to Magic Lantern firmware development
I just checked and the files from my Kiss X4 are 48KHz already,
according to QuickTime player.

Am I missing something obvious here?

PG

Morgan Look

unread,
Nov 16, 2010, 5:23:40 PM11/16/10
to ml-d...@googlegroups.com
Well, that was going to be my next question. Has anyone checked what
sample rate is being used currently, looks like you've answered that.

Morgan.

Morgan Look

unread,
Nov 16, 2010, 6:39:12 PM11/16/10
to ml-d...@googlegroups.com
Hi again.

Looking into the audio ic data sheet further, it seems it may be
possible to use the external stereo microphone input as a single
differential/balanced input. This could potentially provide a very
quiet signal path to the ADC.

Obviously - as this uses both (left and right) inputs - the resulting
recording will be mono. However depending on how Canon have connected
the internal microphone. This signal may be available as a separate
channel which can be recorded at the same time (depending on register
settings).

Also this is all largely dependent on what Canon have connected between
the stereo input and audio IC.
I do not see any mention in the 550D manual of whether mic power is
supplied out the external microphone input.
If it is, this will not work for providing power to a balanced
microphone, since both sides of the differential pair will be at the
same voltage.
This could possibly be blocked on the -ve input with a capacitor, then a
separate 1k resistance to ground could complete the mic power circuit.
Otherwise the power could be blocked on both inputs with capacitors, and
separate external power injected to the mic (9v battery).

Page 30 of the datasheet has information about connections and register
configurations used to configure the IC for this type of input.
Page 29 has information about stereo/mono configuration which may be
useful depending if it was desirable to have the built in mic as a
second recorded channel (or not).

Does this look feasible to anyone else?

Regards, Morgan.

Ba...@aol.com

unread,
Nov 16, 2010, 9:52:38 PM11/16/10
to ml-d...@googlegroups.com
One thing I have noticed with the 5d,  and the 2ti,  is when we introduce Magic Lantern,   one channel is at an appreciably lower level than the other when I feed both channels into the camera.    Not sure why.
 
--
http://magiclantern.wikia.com/

To post to this group, send email to ml-d...@googlegroups.com
To unsubscribe from this group, send email to ml-devel+u...@googlegroups.com

Piers

unread,
Nov 17, 2010, 4:15:17 AM11/17/10
to Magic Lantern firmware development
Ah, when I skimmed the data sheet I just assumed they were running it
with one leg off in unbalanced mode (i.e. hardware hacking required
for balanced). Buy I see, yes, they use L and R for balanced.

The mic power is definitely a register we can turn off (at least, it's
defined in ML header files, so I assume it works) so, yeah, maybe you
can get balanced audio in the line in port, and record VERY quiet mono
in the other channel from the internal mic.

Hey! you can ALSO set it to record, e.g., L from the internal mic and
R from the external. That could be quite handy indeed ...

PG

Piers

unread,
Nov 17, 2010, 4:17:27 AM11/17/10
to Magic Lantern firmware development
In fact, you can also record track 1 from internal unbalanced, and
track 2 from external balanced - see the table at the top of p. 30 on
the data sheet (this one http://www.asahi-kasei.co.jp/akm/en/product/ak4646/ak4646_f03e.pdf
)

PG

Moira O'Brien LIPF

unread,
Nov 17, 2010, 5:21:34 AM11/17/10
to ml-d...@googlegroups.com
Can this be done for the 5D? It would be most useful.

Moira

Moira O'Brien LIPF
Tel: +353 (0)766-153852 | Mob: +353 (0)876-214532 | eFax: +44 (0)1892 800020



--
http://magiclantern.wikia.com/

To post to this group, send email to ml-d...@googlegroups.com
To unsubscribe from this group, send email to ml-devel+u...@googlegroups.com

cacasodo

unread,
Jan 4, 2011, 8:53:41 PM1/4/11
to Magic Lantern firmware development
On Nov 17 2010, 5:21 am, "Moira O'Brien LIPF" <mo...@moiraobrien.com>
wrote:
> Can this be done for the 5D? It would be most useful.
>
> Moira
>

Guys,
I'm going to bump this thread a bit, as I spent a number of days
testing and trying to get the best recordings out of the 5D as
possible. My mate was listening back to the recording (http://
vimeo.com/18287163) and found, not surprisingly, the bass was a little
lacking. Though in the live setting, the bass was most definetly
present.

So this would be a great feature to have on the 5D. Seems like you
folks on this thread have all information necessary to make it happen:

The technical datasheet on the audio chip in the cam:
http://www.asahi-kasei.co.jp/akm/en/product/ak4646/ak4646.html

And the memory register locations of the "Wind-noise Reduction
Filter" (page 62 in the linked pdf below):
http://www.asahi-kasei.co.jp/akm/en/product/ak4646/ak4646_f03e.pdf

We are but your humble servants.

I will also get off my duff and setup a cross compile environment for
the ARM and see what I can break.

Domo arigato,
'sodo

Piers

unread,
Jan 4, 2011, 9:37:06 PM1/4/11
to ml-d...@googlegroups.com
I will happily port this simple feature (which is my entire 7-line contribution to ML so far) as soon as someone lends me their 5D for 3 months or so (although a wiser person would probably buy one for Alex*)

But seriously, the code's in audio.c (naturally) in audio_configure() around line 557 if you look in the 550D branch, I would expect it to move to 5D pretty easily. And if you get it going, I'd love some actual confirmation that balanced audio really works.

PG

(* at which point I would scream "Nooooo, we need him for 550D!")

cacasodo

unread,
Jan 4, 2011, 11:05:28 PM1/4/11
to Magic Lantern firmware development
On Jan 4, 9:37 pm, Piers <pie...@gmail.com> wrote:
> I will happily port this simple feature (which is my entire 7-line
> contribution to ML so far) as soon as someone lends me their 5D for 3 months
> or so (although a wiser person would probably buy one for Alex*)
>
> But seriously, the code's in audio.c (naturally) in audio_configure() around
> line 557 if you look in the 550D branch, I would expect it to move to 5D
> pretty easily. And if you get it going, I'd love some actual confirmation
> that balanced audio really works.
>
Piers,
Not having used them for 15 years, my C chops are pretty lousy. At a
basic level though, I can setup a chroot jail and compile code. If it
pleases, one option could be for you to give me the changes to the
code and I could compile and test them on my 5D.

Alternatively, if you live near NYC, I'd be happy to loan you my 5D
for a weekend.
'sodo

Piers

unread,
Jan 4, 2011, 11:32:27 PM1/4/11
to ml-d...@googlegroups.com
;-) almost as far as it is possible to live from NYC actually ....

If you can get it to build, I can certainly show you the 15 or so lines to change

PG

Alex

unread,
Jan 5, 2011, 1:52:43 AM1/5/11
to ml-d...@googlegroups.com
Here's the audio patch from Piers for the 550D:

https://bitbucket.org/hudson/magic-lantern/changeset/3d4f7f55273e

if (disable_filters) {
audio_ic_write( AUDIO_IC_FIL1 | 0x00 ); //no need to set them all to
0Hz, just turn em off, in one easy register
}

Piers

unread,
Jan 5, 2011, 3:25:00 AM1/5/11
to ml-d...@googlegroups.com
The actual lines for selectable input are ...

55
CONFIG_INT( "audio.mic-in",	mic_in,		0 );
55
//CONFIG_INT( "audio.mic-in",	mic_in,		0 ); // not used any more?
56
56
CONFIG_INT( "audio.loopback",	loopback,	1 );
57
CONFIG_INT( "audio.input-source",	input_source,		0 ); //0=internal; 1=L int, R ext; 2 = stereo ext; 3 = L int, R ext balanced
58
CONFIG_INT( "audio.disable-filters",	disable_filters,	1 ); //disable the HPF, LPF and pre-emphasis filters
57
59



510
	
511
	int pm3[] = { 0x00, 0x05, 0x07, 0x11 }; //should this be in a header file?
502
512
503
513
	if( !force )
504
514
	{
@@ -513,6 +523,10 @@ audio_configure( int force )
513
523
	}
514
524
515
525
	audio_ic_write( AUDIO_IC_PM1 | 0x6D ); // power up ADC and DAC
526
	
527
	//mic_power is forced on if input source is 0, 1 or 3
528
	mic_power = (input_source == 2) ? mic_power : 1;
529
				 
516
530
	audio_ic_write( AUDIO_IC_SIG1
517
531
		| 0x10
518
532
		| ( mic_power ? 0x4 : 0x0 )
@@ -523,10 +537,8 @@ audio_configure( int force )
523
537
		| ( lovl & 0x3) << 0 // line output level
524
538
	);
525
539
526
	if( mic_in )
527
		audio_ic_write( AUDIO_IC_PM3 | 0x00 ); // internal mic
528
	else
529
		audio_ic_write( AUDIO_IC_PM3 | 0x07 ); // external input
540
	//PM3 is set according to the input choice
541
	audio_ic_write( AUDIO_IC_PM3 | pm3[input_source] );
530
542
531
543
	gain.alc1 = alc_enable ? (1<<5) : 0;
532
544
	audio_ic_write( AUDIO_IC_ALC1 | gain.alc1 ); // disable all ALC
@@ -536,28 +548,11 @@ audio_configure( int force )
536
548
537
549
	audio_ic_set_input_volume( 0, dgain_r );
538
550
	audio_ic_set_input_volume( 1, dgain_l );
551
	audio_ic_set_mgain( mgain );


553
	if (disable_filters) {
554
		audio_ic_write( AUDIO_IC_FIL1 | 0x00 ); //no need to set them all to 0Hz, just turn em off, in one easy register

I think that's all, that changeset also includes some audio meter drawing changes...

PG

Antony Newman

unread,
Jan 5, 2011, 3:47:51 AM1/5/11
to ml-d...@googlegroups.com
If it helps, I have a 'healthy' interest in audio  (  http://picasaweb.google.com/antony.newman/2009_08NestHiFi#  ) and will join in the 'fun' in this area after later on.

AJ.

cacasodo

unread,
Jan 5, 2011, 9:33:44 AM1/5/11
to Magic Lantern firmware development
Guys,
Thanks very much! I will get my ARM environment setup after work
today and give it a shot.
:)))
'sodo

cacasodo

unread,
Jan 8, 2011, 5:28:58 PM1/8/11
to Magic Lantern firmware development
Hi folks,
I was successful at getting the compiler installed using the summon-
arm-toolchain instructions here:
http://magiclantern.wikia.com/wiki/Build_instructions/550D

I made a few changes to the Makefile as outlined on that page and on
Step 6 of this page:
http://magiclantern.wikia.com/wiki/2.0.4_Building_ML

I can successfully compile hello.c and get a valid object file.
However, when I go to build the 550D version of the firmware, I get
this error message:
make: *** No rule to make target `/arm-elf/lib/libc.a', needed by
`lib_a-setjmp.o'. Stop.

Here is my Makefile:
http://content.serveftp.net/video/Makefile

any help would be appreciated..thanks,
sodo

Alex

unread,
Jan 9, 2011, 1:05:53 AM1/9/11
to ml-d...@googlegroups.com
Is libc.a present in ~/arm-toolchain/arm-elf/lib/libc.a ?

Here's my summon-arm script. It's also worth to try a fresh Ubuntu in a virtual machine (see the wiki page for a ready-to-run one).




any help would be appreciated..thanks,
sodo

summon-arm-toolchain

cacasodo

unread,
Jan 9, 2011, 2:03:50 AM1/9/11
to Magic Lantern firmware development
> Is libc.a present in ~/arm-toolchain/arm-elf/lib/libc.a ?
>
> Here's my summon-arm script. It's also worth to try a fresh Ubuntu in a
> virtual machine (see the wiki page for a ready-to-run one).
>
Hi Alex,
I will give your summon-arm script a shot. I am also using a fresh
Ubuntu 10.04LTS system in a vmware virtual machine and have used my
last couple of days struggling with the compile as more of an
intellectual exercise than anything else. Of course today, I saw at
the bottom of your notes that you had a vm available. Ah well. At
least I'm a little more familiar with cross compiling and the Makefile
process now.

I'll let u know how your summon-arm script goes. If I tire of my
pursuit, I will download your VM.

thanks!
sodo

Alex

unread,
Jan 9, 2011, 4:22:09 AM1/9/11
to ml-d...@googlegroups.com
It's not my VM, but Indy uses it successfully. I run it under a Karmic box upgraded to Lucid.

Maybe it's a good idea to publish a small VM with all the compiling tools for ML.


thanks!
sodo

cacasodo

unread,
Jan 9, 2011, 10:42:50 AM1/9/11
to Magic Lantern firmware development
> Maybe it's a good idea to publish a small VM with all the compiling tools
> for ML.
>
Alex,
First things first, I ran your version of summon and I can
successfully compile hello.c. However, when running make in the ML
directory, I get this error:
[: 1: 1: unexpected operator
[ CPP ] magiclantern.lds
/bin/sh: /home/sfrase/arm-toolchain: Permission denied
make: *** [magiclantern.lds] Error 1

Second, I ran make as root..no diff. I do not have any compiler flags
in my environment (CFLAGS/LDFLAGS/CPPFLAGS/CC). I only have the PATH
addition to point to arm-elf-gcc. I read the note on Piers seeing a
zero byte lds file..wasn't sure he was referring to magiclantern.lds,
but I zapped it and retried the make, but ended up with the same
error.

Re: a smaller vm. That would a good idea. However, with all the deps
installed, my freshly built 32-bit 10.04LTS VM is a porky 6GB. This
is with all the deps installed. I'm not sure how to slim down an
install once you've installed everything you need without breaking
something. However, I do know how to make a real small kernel. ;)

let me know if you have any ideas regarding the error..
sodo

cacasodo

unread,
Jan 9, 2011, 10:51:41 AM1/9/11
to Magic Lantern firmware development
Forgot to mention that I also ran make with the V=1 option and tee'd
off the std error and std input to a file, but there is no more
additional information than what I've posted below.

cacasodo

unread,
Jan 10, 2011, 7:43:17 PM1/10/11
to Magic Lantern firmware development
So I temporarily switched tracks just to see if I could compile the
firmware from the VM that is linked here:
http://magiclantern.wikia.com/wiki/Build_instructions/550D#Ubuntu

I downloaded chrysaor.info's vm from this page:
http://www.vmware.com/appliances/directory/542303

Which links to here:
http://chrysaor.info/?page=images&filter=Ubuntu#41

and none of the build tools or the ML directories exist on it. Am I
missing something or shouldn't this vm have had the necessary
toolchain in which to compile ML?
'sodo

cacasodo

unread,
Jan 10, 2011, 9:18:20 PM1/10/11
to Magic Lantern firmware development
I have made some headway using my Ubuntu vm with help from Alex's
summon script and the directions here:
http://magiclantern.wikia.com/wiki/Build_instructions/550D

I've gotten a successful build of the 550D firmware. Now I will see
if I can actually get the 5D firmware to build properly.
sodo

cacasodo

unread,
Jan 11, 2011, 12:15:41 AM1/11/11
to Magic Lantern firmware development
Progress has been made. I can compile the 5D firmware without error
from Trammell's mercurial repository:
hg clone https://bitbucket.org/hudson/magic-lantern/

End of process:
~/arm-toolchain/bin/arm-elf-ar cr libstdio.a lib_a-setjmp.o lib_a-
strchr.o lib_a-strrchr.o lib_a-strlen.o lib_a-strcat.o lib_a-strncat.o
lib_a-strcmp.o lib_a-strncmp.o lib_a-strncpy.o lib_a-strstr.o lib_a-
strcspn.o lib_a-memcmp.o lib_a-strcoll.o lib_a-ctype_.o
[ LD ] magiclantern
[ OBJCOPY ] magiclantern.bin
[ CC ] reboot.o
[ LD ] autoexec
[ OBJCOPY ] autoexec.bin
[ ASSEMBLE ] magiclantern.fir
magiclantern.fir: New CRC: ffb878aa OLD b7932bae

However, after I copy the magiclantern.fir file to the CF card and
load the firmware, the menus are there, but the lettering does not
appear. You can see the audio meters though. But it's a bit
difficult to work without being able to see the text in the menus.

In an effort to fix this problem, I copied autoexec.bin to the card,
but that didn't help.

any ideas how to fix?

thanks,
sodo

Alex

unread,
Jan 11, 2011, 12:56:00 AM1/11/11
to ml-d...@googlegroups.com
See the troubleshooting section from 550D build page. Indy also had a
similar problem with fonts. Check font-*.in and font-*.c if they look
right (i.e. with big letters).

cacasodo

unread,
Jan 11, 2011, 8:18:02 AM1/11/11
to Magic Lantern firmware development
On Jan 11, 12:56 am, Alex <broscutama...@gmail.com> wrote:
> See the troubleshooting section from 550D build page. Indy also had a
> similar problem with fonts. Check font-*.in and font-*.c if they look
> right (i.e. with big letters).
>
Yes, the fonts were bollucksed. I deleted the bad font*.in files,
copied over the latest ones, reran the make and the menus are back!
Thanks for the help, Alex.

OK then! Now I can actually get to Piers code addition to disable the
wind filter!
sodo

cacasodo

unread,
Jan 11, 2011, 9:30:47 PM1/11/11
to Magic Lantern firmware development
I was able to successfully build 5D firmware using Piers' new code for
audio.c to defeat the wind filter on the cam. Hoo-ah! I got a few
warnings, but nothing out of the ordinary:
audio.c:317:1: warning: initialization from incompatible pointer type
audio.c: In function 'compute_audio_level_task':
audio.c:326:22: warning: operation on 'audio_levels[1].avg' may be
undefined
audio.c: At top level:
audio.c:336:1: warning: initialization from incompatible pointer type
audio.c:749:1: warning: return type defaults to 'int'
audio.c:808:3: warning: initialization from incompatible pointer type
audio.c: In function 'my_sounddev_task':
audio.c:913:6: warning: unused variable 'count'
audio.c: At top level:
audio.c:924:1: warning: initialization from incompatible pointer type
audio.c:738:1: warning: 'audio_loopback_display' defined but not used
audio.c: In function 'audio_filters_display':
audio.c:758:1: warning: control reaches end of non-void function


It was nice to see the "Filters On/Off" toggle in the menu! I will
get to fully test tomorrow and will post a review video of the on/off
comparison.

thanks for the help, guys.
'sodo

Antony Newman

unread,
Jan 12, 2011, 3:22:10 AM1/12/11
to ml-d...@googlegroups.com
'Sodo,

I have not looked at audio.c yet.  Quick thoughts:


>audio.c:317:1: warning: initialization from incompatible pointer type
>audio.c: In function 'compute_audio_level_task':

probably due to the create task macro defining tasks a pointers to void.  And all tasks having a void as their parameter.
(I don't think this will cause any issues)

>audio.c:326:22: warning: operation on 'audio_levels[1].avg' may be
>undefined

Maybe worth investigating this - it may cause the average level to initially be wrong (eg high for a split second?)

 
>audio.c: At top level:
>audio.c:336:1: warning: initialization from incompatible pointer type
>audio.c:749:1: warning: return type defaults to 'int'
>audio.c:808:3: warning: initialization from incompatible pointer type

Personally I don't like any of these as they may be hiding a signed/unsigned   or a pointer issues.


 
>audio.c: In function 'my_sounddev_task':
>audio.c:913:6: warning: unused variable 'count'

If the variable isn't used - that's not a problem - just need to check this is not two versions of 'count' being used.
Personally - I'd comment out vars not used.

 
>audio.c:924:1: warning: initialization from incompatible pointer type
>audio.c:738:1: warning: 'audio_loopback_display' defined but not used

same again.
 
>audio.c: In function 'audio_filters_display':
>audio.c:758:1: warning: control reaches end of non-void function

If the calling routine is expecting a return number and nothing is returned, then random rubbish may be in R0 and cause unexpected behaviour.
 


Regards,
AJ

cacasodo

unread,
Jan 12, 2011, 11:06:51 AM1/12/11
to Magic Lantern firmware development
AJ,
Thanks for the input. Unfortunately, I'm not much of a C coder these
days outside of simple tasks. The audio.c updates are courtesy of
Piers. I'm in the process of testing the end result of this coding
addition. If you have time to look at the code, I would be glad to
compile and test it out for you.

thanks for looking,
sodo

Antony Newman

unread,
Jan 12, 2011, 12:01:50 PM1/12/11
to ml-d...@googlegroups.com
Cacasodo,

I'm hoping to look at 'audio' in around two weeks (hand full at the moment with other asm code).

Audio Display questions: 
+) What is the ideal audio display?  Are the current ML 'bars' the perfect display?
+) If the sound is distorting in one / both channel - would we want an option to 'AGC Downwards' for the remainder of that movie? (and maybe put something in the log giving the exact point that gain got reduced)?

Regards,
AJ
 


cacasodo

unread,
Jan 12, 2011, 7:04:48 PM1/12/11
to Magic Lantern firmware development
Using Magic Lantern 0.1.9 and a new version of audio.c (thanks
Piers!), I created a comparison of the Audio Filter being defeated
(Filters: OFF) to when the Filters were on (Filters: ON). The source
of the comparison are two videos created on the Canon 5d.
http://vimeo.com/18724051

Signal Chain
-PC #1 playing song in Reaper through Delta 66 card (outs 1/2) -> to -
>
inputs 7/8 on my Mackie 1402-VLZ output through Main Outs -> to ->
mic input on Canon 5D

I used Reaper to play the audio file. This allowed for the signal
analysis to be seen in the video. At this point, the signal analysis
is of the source audio, not the resulting signal coming from the
Canon.

You can see the Magic Lantern outputs on the screen. This is due to
the fact that I fed the composite output of the Canon into the AV/IN
of my JVC HD10U. I then ran the JVC's firewire output to Kino running
on PC2 in order to capture what was happening on the Canon. The
camera was recording the audio and the lens was pointed at the
computer that had Kino running in one window showing the Canon's
display and then the signal meters running in Reaper via an rdesktop
session to PC1.

The two resulting videos from the cam were combined in Cinelerra and
then output to an H264 video using AAC audio compression. Every
stanza or so, I do a fade in and fade out on the video so you can hear
the difference between the two audio tracks in relatively close
proximity.

There is no difference between the recordings using the two settings.
And though I did not include a comparison to the original source
material, the original source really blows it away. If people want me
to make another video that shows that comparison, I will, but it looks
as though the new code didn't take.

'sodo

cacasodo

unread,
Jan 15, 2011, 2:57:39 AM1/15/11
to Magic Lantern firmware development
With a freshly built Ubuntu 32-bit VM, I gave the audio.c changes
another round of testing..same result.

Piers - if you have any time to get to looking at audio.c on the 5D,
I'm here to test whatever code you can throw at me.
thanks.
'sodo

Reply all
Reply to author
Forward
0 new messages