Author Topic: External audio issue with 5D Mark II  (Read 1305 times)

masc

  • Contributor
  • Hero Member
  • *****
  • Posts: 1650
External audio issue with 5D Mark II
« on: March 13, 2020, 07:58:15 PM »
I got an external microphone for my cams and I have a problem with it, when using with my 5D Mark II. For the first few frames the signal is as expected, then it feels like digital gain goes to max - just for 5..20 frames (length different in each clip), and after this the audio level is as expected again. This only happens for the very first clip after switching the cam on. The second clip+ is okay.
Has someone had this problem before and knows what's the reason?

My ML setup:
- standard nightly build
- modules mlv_rec + mlv_snd enabled
- Analog Gain = 32dB
- Digital Gain = all off
- Input Source = external stereo (it is a stereo microphone)
- Wind Filter = off
- Mic Power = on or off (Mic has battery but alternatively works with phantom. Problem is for both combinations identical.)
- MLV Sound = on
- RAW Video = on

When I disable RAW Video, but use ML, this problem is gone (h.264). Same, if I use the same cam without ML. If I try the same with my EOSM, there is also no problem at all.

So I also tried to toggled more or less all RAW Video options, but without any success.



Any ideas? Thanks for your help!

Edit: when enabling AGC, the signal looks the opposite:
5D3.113 | EOSM.202

yourboylloyd

  • Senior
  • ****
  • Posts: 293
Re: External audio issue with 5D Mark II
« Reply #1 on: March 13, 2020, 11:44:52 PM »
Hey. I've never had this problem and I've been using the standard build for a while.

Maybe change the input source = external stereo    to    input source = Auto int/ext   ??

That's what I use regardless if I'm plugged in with an external mic or not.

An Analog Gain of 32db is pretty high though. I usually don't have to go past 26db no matter what I'm shooting. Maybe try dropping your Analog Gain down to 26db or 29db?

For MLV Sound, is your sampling rate 48kHz? That's the only one I use.

Join the ML discord! https://discord.gg/H7h6rfq

reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2259
Re: External audio issue with 5D Mark II
« Reply #2 on: March 14, 2020, 05:57:11 AM »
You forgot the most important piece of information , the ml build date & branch ?
without this no one can help .

FYI , never seen this problem before , It's never happen to me but  I use a Zoom N4h on 48v phantom power XLR ( Apex150  250 Ohms mic)
I use the internal mic most of the time just to sync to the Zoom N4h , I do thou us a Rode Zoom video mic for time to time and had never seen
this problem .
I set 5d2 cam audio to 44.1 kHz sampling and no more then 23db anything above that is just to noisy .
Input source: Auto int/ext
Mic Power: ON (if I use a external mic) Off (if on Cam mic)
Headphone Mon: ON (passes it to the AV connection by 1/8 audio jack)
Sometimes times I will pass the cam audio (via Rode Zoom Mic) though to the Zoom N4h from the headphone mon jack
and it never has any issue .




masc

  • Contributor
  • Hero Member
  • *****
  • Posts: 1650
Re: External audio issue with 5D Mark II
« Reply #3 on: March 14, 2020, 11:19:08 AM »
Thanks guys.

I tried 4 different ML versions now and all behave 100% the same, that's why I did not write it. But here it is:
- magiclantern-Nightly.2014Sept01.5D2212
- magiclantern-Nightly.2017Mar30.5D2212
- magiclantern-Nightly.2018Jul03.5D2212
- crop_rec-4k3x1-2.8k24p_3x3-48p-all-centered_8.18pm-5D2-eXperimental.2019Dec31.5D2212

I also tried reducing the Analog Gain to 23dB: all is identically (just audio is some dB quieter).
Changing the audio source to Auto, or the sample rate to 44.1kHz also behaves as expected and unfortunately does not change or solve my problem.

From the sounding of the audio signal I would say the Digital Gain is changed 2 times (1x up and 1x down) on the start of recording - whyever. And always just for the first recorded clip after switching the cam on, for RAW Video only. For the internal mic all is fine.

Now I connected one of my synthesizers to the 5D, just to try out another audio source, and to try out an audio source which don't needs the "Mic Power" (I switched it off). Result: the same. Here are two MLV files:
https://www.dropbox.com/s/m1f875mks1hr7km/M14-1044.MLV?dl=0
https://www.dropbox.com/s/tkxgdx1dkqoh6bv/M14-1043.MLV?dl=0
(Recorded at 44.1kHz, AnalogGain = 23dB, DigitalGain all Off)

Edit:
I now loaded the oldest ML I could get: magiclantern-v2.3.NEXT.2013Aug22.5D2212
It can't record MLV, but single WAV files. And: I get exactly the same issue! Already in this old version, up to the latest.
5D3.113 | EOSM.202

reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2259
Re: External audio issue with 5D Mark II
« Reply #4 on: March 15, 2020, 12:47:49 AM »
Thanks for the samples , but I can't see the images just garbage/color lines



but thats ok I just wanted the audio track , I loaded it in to Sony Spectral Layers Pro (now magix owns them but sadly it's now discontinued)  >:(
Basically is load the audio file as a 3D image frequency spectrum and it can be edited , plus you can analyze the file in a 3D space  :D
What I notice is right channel has 2 pops & the left channel has only one pop , Did you try the mic on only 1 channel in mono ?

Here same screen shots for Spectral Pro

M14-1044-right-channel
You can see at the bottom by the curser where the second pop levels are , the faded green overlay is the width of the pop .

M14-1044-left-channel
Only one pop and width on the left channel is less , so I almost think there could be a bad connection or a bad cable.
The reason I say this the pop is full range 248Hz to 21727Hz with the right channel having more issue .

I can investigate this further on my 5D2 and see if it a hardware (cam/audio gear) or software (ML) .


masc

  • Contributor
  • Hero Member
  • *****
  • Posts: 1650
Re: External audio issue with 5D Mark II
« Reply #5 on: March 15, 2020, 11:06:54 AM »
Thanks for your analysis. Very interesting.
Thanks for the samples , but I can't see the images just garbage/color lines
Oh, strange. I just shortened the clip and compressed it to upload it faster. But yes, the audio track is more important. I wanted to provide the MLV because maybe some important metadata is included.
What I notice is right channel has 2 pops & the left channel has only one pop , Did you try the mic on only 1 channel in mono ?
For the clips I provided: I connected a stereo synthesizer instead of a mic, to get a more or less non-changing pad sound with wide spectrum. I thought this could help. But yes... with those pops: looks like there is an analog problem (but I don't think there is one outside the cam).
Here another (uncompressed) clip with very silent and noisy microphone audio.
https://www.dropbox.com/s/htkii4y4x3wf7rr/M14-1331.MLV?dl=0
There is no pop, but other interesting facts:
The amplified part starts for one channel earlier than for the other:

The amplified part ends with a high amplitude:

When seeing this last picture with this peak: it don't makes me believe this is a digital gain problem. Looks more like a analog problem.
On the other side: if it would be cable or plug problem, I must be very lucky, because it is in each first clip after switching the cam on, in the first few frames, but never in the second clip onwards, or later in a clip.

Now I recorded another clip: one channel internal mic, one channel external mic (at least one mono channel of it). Now the issue happens on both mics. I expected to only see this on the external mic. BUT: with this ML Setting "internal mic only", it never happens.
https://www.dropbox.com/s/rg9cxqt7j6iahhj/M15-1042.MLV?dl=0

I started to read the code in mlv_snd.c, but it is hard to find a hint in this direction. In the function "mlv_snd_alloc_buffers" I found two times this same call "mlv_snd_queue_slot()" and the buffer size is calculated with something proportional to 5fps...
Code: [Select]
static void mlv_snd_alloc_buffers()
{
    /* calculate buffer size */
    int fps = 5;

    mlv_snd_in_buffer_size = (mlv_snd_in_sample_rate * (mlv_snd_in_bits_per_sample / 8) * mlv_snd_in_channels) / fps;
    trace_write(trace_ctx, "mlv_snd_alloc_buffers: mlv_snd_in_buffer_size = %d", mlv_snd_in_buffer_size);
   
    mlv_snd_queue_slot();
    mlv_snd_queue_slot();

    /* now everything is ready to fire - real output activation happens as soon mlv_snd_running is set to 1 and mlv_snd_vsync() gets called */
    mlv_snd_state = MLV_SND_STATE_READY;
}
Btw: very often this trace_write(..) is used which I can enable from the ML menu. But where is this log file saved to? I don't find it... maybe there would be some inportant hints included.

I can investigate this further on my 5D2 and see if it a hardware (cam/audio gear) or software (ML) .
This would be really awesome. Thank you very much for this.
5D3.113 | EOSM.202

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 6863
Re: External audio issue with 5D Mark II
« Reply #6 on: March 15, 2020, 01:39:10 PM »
And if you compile from those branches and enable the same modules for eosm there's no such error?
You should do the test with another 5D2 with exact same settings and builds. Maybe reset canon settings as well to really compare from a fresh stand point. Maybe RD will be the second cam.

masc

  • Contributor
  • Hero Member
  • *****
  • Posts: 1650
Re: External audio issue with 5D Mark II
« Reply #7 on: March 15, 2020, 05:29:02 PM »
If I try the build "magiclantern-Nightly.2018Jul03.EOSM202" (has it the same code base like "magiclantern-Nightly.2018Jul03.5D2212"?) I don't get this problem. But on the other side, the first tab (sound) of the ML menu looks very different: for the 5D2 I have many options, while on EOSM I can switch sound recording on and off only.
Unfortunately I don't have a second 5D2. I just could send my settings folder over to @reddeercity. The builds can be downloaded, but I haven't found a single one without this issue.
5D3.113 | EOSM.202

Bender@arsch

  • Freshman
  • **
  • Posts: 76
Re: External audio issue with 5D Mark II
« Reply #8 on: March 17, 2020, 04:03:28 PM »
Hey. I tested this Phänomen on my 5D II and yes... I have the same issues.

I use the crop_rec-4k3x1-2.8k24p_3x3-48p-all-centered_8.18pm-5D2-eXperimental.2019Dec31.5D2212.

masc

  • Contributor
  • Hero Member
  • *****
  • Posts: 1650
Re: External audio issue with 5D Mark II
« Reply #9 on: March 18, 2020, 09:35:57 PM »
Thank you for testing. So my 5D2 is not the only one.
5D3.113 | EOSM.202

yourboylloyd

  • Senior
  • ****
  • Posts: 293
Re: External audio issue with 5D Mark II
« Reply #10 on: March 18, 2020, 11:18:34 PM »
I've tested that build.... and now I can't UN-REPLICATE the issue... I've even switched back to the old one I was using HELP! lol



I'll just record one raw file first before i start shooting now.

Hey is there a way that when you turn the camera on for RAW files on the 5D2 it'll record a RAW file for 3 seconds and then delete it automatically? Of course that would skyrocket startup times. Just trying to think of a solution. My other 5D2 isn't having that problem.
Join the ML discord! https://discord.gg/H7h6rfq

reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2259
Re: External audio issue with 5D Mark II
« Reply #11 on: March 19, 2020, 01:58:31 AM »
Did some more testing & I still don't have this issue , used my latest crop_rec build
 "crop_rec-4k3x1-2.8k24p_3x3-48p-all-centered_8.18pm-5D2-eXperimental.2019Dec31.5D2212.zip"
Screen shot 7second wave from 3x3 (FHD 1856x1248 10bit 29.97fps) Loaded in to Sony Acid Music Studio ,


Mic used was self powered(9vdc) RØDE VideoMic with ML Mic Power:"Off" in the sound module

I still checking files , but so far I have not come across @masc problem .
I made test files in 3x1 4k , 2.8k 1x1, 3x3 FHD & 3x crop_mode (2177x1076)

I also used my "Sennheiser ew 100 3G" microphone which is low impedance mono channel (Left on the 5d2 audio meters)
and still looks good , but need to take a closer look to see if I missed something .

I did try different mic_power and still no problem
review the userguide#input_source on the magic lantern wiki and see if you have missed a setup option

Also found this from a1ex in 2011 on the Magic Lantern firmware development Google Groups
Quote
Alex - 06/06/2011
 After a comment regarding input impedance for microphone, I took a
quick look in the AK4646 datasheet and noticed this [p.31]:
"The AK4646 has a gain amplifier for microphone input. The gain of
MIC-Amp is selected by the MGAIN2-0 bits (Table 19). The typical input
impedance is 30kΩ (typ)."

In audio.c, ML enables microphone power by default, and in this case:

"When PMMP bit = “1”, the MPWR pin supplies power for the microphone.
This output voltage is typically 0.8 x AVDD and the load resistance is
minimum 0.5kΩ. In case of using two sets of stereo microphone, the
load resistance is minimum 2kΩ for each channel. "
Quote
There are quite a bit of issues saying certain microphones have low
input levels with Magic Lantern (e.g. Rode VideoMic). It may be
possible that the cause may be the lower input impedance caused by
forcing mic-power on
, even if it's not needed.
Quote
Therefore, I've created an experimental changeset which adds mic power
control to the user interface, to see if it helps fixing low input
level issues:
Thou I don't have a issue with my RØDE VideoMic on my 5D2 , but this could be a problem for other Microphones

Below is a quote from the Magic Lantern Wiki User Guide
Quote
Input source:
Audio input source for recording:
◾ internal mic
◾ L:int R:ext
◾ external stereo
◾ L:int R:balanced (internal mic on Left, external mic on Right from both external pins as balanced audio)
◾ Auto int/ext: camera detects if a mic is plugged in. Int is dual mono, ext is stereo.
XLR microphone to Balanced input pinouts


Balanced audio allows for very long cable runs without interference.
Usually balanced mics have three pin XLR connectors and it is very easy to out together an XLR to Canon mic input cable.
Balanced allows us to use such pro mics with our little Canons and this is a very welcome surprise for audio guys.


So after reading this I can see there my be issue with certain bands of microphones , so there may be no real fix for @masc issue
But like a said I'll still look at the other file I made and look for any problem .

@ masc what band of microphone do you use ? and did you try the other input option ?

masc

  • Contributor
  • Hero Member
  • *****
  • Posts: 1650
Re: External audio issue with 5D Mark II
« Reply #12 on: March 19, 2020, 08:58:34 AM »
@reddeercity:
This is interesting.
There are quite a bit of issues saying certain microphones have low
input levels with Magic Lantern (e.g. Rode VideoMic). It may be
possible that the cause may be the lower input impedance caused by
forcing mic-power on, even if it's not needed.

Therefore, I've created an experimental changeset which adds mic power
control to the user interface, to see if it helps fixing low input
level issues:
But I think for my mics the mic-power was always on (except mic with battery) and for the synthesizer it was off.

I connected:
  • RØDE Video­Micro (this very small one, Mono, Mic-Power=On, no info about impedance)
  • Audiotechnica Pro24 (Stereo, Mic-Power=Off, with battery) (manual says impedance = 600 Ω)
  • Audiotechnica Pro24 (Stereo, Mic-Power=On, without battery) (manual says impedance = 600 Ω)
  • Synthesizer Access ViRUS Indigo (Stereo, direct line-out to mic-in connection, Mic-Power=Off) (no info about impedance, Wiki: "A typical line out connection has an output impedance from 100 to 600 Ω")
All bring the same issue.
5D3.113 | EOSM.202

Skinny

  • New to the forum
  • *
  • Posts: 38
Re: External audio issue with 5D Mark II
« Reply #13 on: March 19, 2020, 05:57:33 PM »
If the camera sees the DC resistance of the connected microphone, as when applying power to the microphone, then connecting a capacitor in the signal path would help to cut off the direct current and this would give an almost infinite DC resistance.

Although in the synthesizer output most likely have a capacitor..