Magic Lantern Forum

Developing Magic Lantern => Feature Requests => Topic started by: Markus on December 12, 2013, 01:18:29 PM

Title: [BROKEN] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 12, 2013, 01:18:29 PM
Now working: =D


This is a request for an additional option in rec tone that would allow automatic start/stop of the external sound recorder H6. All we need is the additional feature to make the sound beep to a continuous tone for the length of the recording.   
see this topic http://www.magiclantern.fm/forum/index.php?topic=9306.0 (http://www.magiclantern.fm/forum/index.php?topic=9306.0)  (Automatic Rec-start on H6 solved!)

If this is done we have automatic start/stop of external sound recording in the H6!   :D
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: a1ex on December 13, 2013, 09:55:58 AM
This is a very cool find and fairly easy to implement IMO.

Start in beep.c and take a look at play_beep and wav_play: you need to combine them, so it keeps playing the same buffer in a loop.

Fine detail: choose the buffer size or tweak the signal frequency so the beep plays without gaps. You need a little math here.

The hard part: locking issues. You have a single audio device, and it requires exclusive access. You should be careful not to block tasks that might want to beep while the continuous beep is running (if you are not careful, these tasks may have to wait for several minutes). The current implementation is not exactly elegant, and some refactoring may be needed.

API: I suggest something like beep_long_start(freq) / beep_long_stop (feel free to think at better names / parameters).

Also, replace the BEEP_LONG implementation with the new one, remove the hacks that try different memory sizes until the allocation succeeds, and make sure the "test tone" feature works.

Once you do that, modifying raw_rec/mlv_rec should be extremely easy.
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 13, 2013, 10:29:25 AM
Step two in this would be to test how many frames the trigger is from perfect sync and then try to compensate with delaying the signal to match.
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: AnotherDave on December 13, 2013, 09:08:20 PM
There is a SMPTE module that already exists.  It puts out a continuous SMPTE timecode signal out of the audio jack when you press record.  Could a SMPTE signal be used to trigger the H6 to start?  If not, the module could be helpful in developing a new module that just outputs a tone, or maybe that feature could be incorporated into this module.

Here is the link.

http://www.magiclantern.fm/forum/index.php?topic=7764.msg80323#msg80323 (http://www.magiclantern.fm/forum/index.php?topic=7764.msg80323#msg80323)
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: rob_6 on December 14, 2013, 09:07:02 PM
I can also add that this feature would work with the H4n as well. The H4n is much cheaper now ($169 on B&H). What a great feature to have audio that could be matched with the Raw video without much work at all. This is such a great feature for single shooters! I hope someone can help by developing this feature. Thanks so much!
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: kgv5 on December 17, 2013, 12:32:10 AM
Quote from: rob_6 on December 14, 2013, 09:07:02 PM
I can also add that this feature would work with the H4n as well.

Are you sure? Does h4n has the same feature as h6 regarding beep start/stop ? I hope you are right, in that case buying h4n would be no-brainer for me.
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: diegolamac on December 17, 2013, 03:33:13 AM
Quote from: kgv5 on December 17, 2013, 12:32:10 AM
Are you sure? Does h4n has the same feature as h6 regarding beep start/stop ?

From the zoom h4n webpage:

"You can set your H4n to automatically record whenever sound above your designated level is detected. This ensures that you capture everything of importance while minimizing blank sections such as when recording a conference or lecture."

http://www.zoom.co.jp/img/products_img_en/h4n/h4n_11.jpg
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: diegolamac on December 17, 2013, 04:24:23 AM
Correct me if I'm wrong, but I've just thought of a huge disadvantage of this method. While recording you can't monitor the audio mix since the continous tone would drive anyone nuts.
Unless there is a function in the recorder to monitor each channel individually. I haven't bought my zoom H6 yet but it would be wise to make test before writing the code.
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: kgv5 on December 17, 2013, 06:18:35 AM
Thanks diegolamac, that is a great news. Yeah, i have been wondering about the tone and if it would be "hearable" from outside. I tried (5d3) and even with headphone jack in ML "beep" was loud.
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 17, 2013, 06:47:44 PM
This is a problem =/, Ill check throu h6 settings to see if you can counter this problem in any way.
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: rob_6 on December 17, 2013, 09:22:33 PM
There is a way to hook up the tone from the camera so that it only goes through the left or right channel. You would need a cable that has either xlr or phone plug for the h6 or H4n left or right inputs. That way you could at least monitor the sound from the other channel with a pair of earbud headphones and just don't put the one with the beep in your ear.

Not an elegant way, but most of the time for me I use the 5d Raw for B-Roll so I don't monitor the sound for each shot anyway. I would still love this feature so that I don't have to stop the H4n or H6 each time I stop the camera recording. I am sure there are other possible solutions. I just wanted to share my thoughts.
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 18, 2013, 12:28:29 AM
The h6 has a monitor mixer function so you can mute the signal track for monitoring so this is no problem =). Just mute the signal track in settings.
Se page. 80 in H6 manual for more info!
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: g3gg0 on December 18, 2013, 05:06:33 PM
as already mentioned, the SMPTE module does exactly that.
just that the output isnt a sine (beep), but a digital noise which should also work.
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 18, 2013, 10:25:02 PM
Ill try the smtp module tomorrow, exiting! =)
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: hjfilmspeed on December 19, 2013, 01:04:07 AM
This would be awesome.
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 19, 2013, 02:30:43 PM
Quote from: g3gg0 on December 18, 2013, 05:06:33 PM
as already mentioned, the SMPTE module does exactly that.
just that the output isnt a sine (beep), but a digital noise which should also work.

g3gg0: When I set the "frames to write to 0" I don't get the smpte to write continuously. Otherwise this works! =D
A bug or am I using an old version? I downloaded the one from the first post in the thread.
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 19, 2013, 06:26:25 PM
I figured out why it did not output continiously! Not a bug in SMPTE.mo, the problem was that the record beep was still activated  witch interfered with the smpte module. When I tured that of it worked =D. So now we have a fully functional solution here!
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: a1ex on December 19, 2013, 06:30:09 PM
Yeah, this is exactly the reason I said that solving the conflicts is hard (the audio device needs exclusive access).
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: AnotherDave on December 19, 2013, 06:54:49 PM
Quote from: Markus on December 19, 2013, 06:26:25 PM
So now we have a fully functional solution here!

Awesome!  Do you have to monitor the SMPTE track in the headphones? 
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 19, 2013, 07:48:21 PM
Quote from: Markus on December 18, 2013, 12:28:29 AM
The h6 has a monitor mixer function so you can mute the signal track for monitoring so this is no problem =). Just mute the signal track in settings.
Se page. 80 in H6 manual for more info!

Nope.
Title: Re: Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 19, 2013, 07:49:50 PM
Making a simple demonstration video for this feature.  :)
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 19, 2013, 08:33:22 PM
Now it would be interesting to try and tweak this feature for perfect sync.
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: diegolamac on December 19, 2013, 09:39:55 PM
That's beautiful, Markus! thanks for the video!
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 19, 2013, 10:32:19 PM
Your welcome =)
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: AnotherDave on December 19, 2013, 11:09:49 PM
Quote from: Markus on December 19, 2013, 08:33:22 PM
Now it would be interesting to try and tweak this feature for perfect sync.

Perfect sync for start/stop probably isn't completely possible.  With MLV, you should be able to sync the audio and video via the SMPTE timecode you're pumping into that 4th channel... but I think development on the SMPTE module has stopped.  If it worked and you were using a recorder with TC in, you'd have perfectly synced audio and video all the time. 

I am on a mac so testing MLVs is a bit of a pain, and the SMPTE doesn't work on my HD-P2 like it should. 

If people want to test the SMPTE feed, you CAN do so on an iPhone with several free apps.
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 19, 2013, 11:20:27 PM
Wouldn't It be possible to delay the signal output, or rec start to get them to start simultaneously. The rec beep only differs +- one frame in my experience. I also noticed that when using the beep to trigger the recording length on sound and video showed the same time down to seconds. I havent tested how many frames they differed though.

For some reason triggering with smpte signal seems to differ moore...
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: AnotherDave on December 19, 2013, 11:41:36 PM
If the beep is that close, why not just leave the recorder roll, and sync by the beeps?
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 20, 2013, 12:24:04 AM
There is no setting for continuous beep which is needed for this to work. The recording is kept alive as long as the tone is present. If someone with programing skills would make a continuous beep setting possible we could use the beep instead.
However it may be that the files stop almost simultaneously as it is now and then you could use the endpoints of the files to sync.
   
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: aaphotog on December 20, 2013, 01:30:57 AM
Quote from: AnotherDave on December 19, 2013, 11:09:49 PM
Perfect sync for start/stop probably isn't completely possible.  With MLV, you should be able to sync the audio and video via the SMPTE timecode you're pumping into that 4th channel... but I think development on the SMPTE module has stopped.  If it worked and you were using a recorder with TC in, you'd have perfectly synced audio and video all the time. 

I am on a mac so testing MLVs is a bit of a pain, and the SMPTE doesn't work on my HD-P2 like it should. 

If people want to test the SMPTE feed, you CAN do so on an iPhone with several free apps.
which apps on an iphone will allow it, AND record 48khz as thats what video would take
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: AnotherDave on December 20, 2013, 03:05:44 AM
Quote from: Markus on December 20, 2013, 12:24:04 AM
There is no setting for continuous beep which is needed for this to work. The recording is kept alive as long as the tone is present. If someone with programing skills would make a continuous beep setting possible we could use the beep instead.
However it may be that the files stop almost simultaneously as it is now and then you could use the endpoints of the files to sync.

but why not just record audio the whole time in between takes?  it doesn't eat up that much space... with a big enough card you could just run all day...

Quote from: aaphotog on December 20, 2013, 01:30:57 AM
which apps on an iphone will allow it, AND record 48khz as thats what video would take
I'm fairly sure the free iPhone app is called Timecode Buddy, but there are also a few paid apps that read timecode.  You may need an audio input cable.... I had an old iRig i was using before.
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: diegolamac on December 20, 2013, 05:15:36 AM
Quote from: AnotherDave on December 20, 2013, 03:05:44 AM
but why not just record audio the whole time in between takes?
You're completely missing the point AnotherDave. Since the raw function doesn't record audio, the idea is to simplify the editing process by having the exact portion of audio for each video file, and avoid the waste of time that implies syncing and cutting audio.
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: g3gg0 on December 20, 2013, 09:53:59 AM
@AnotherDave:

SMPTE development hasnt stopped, just noone really could test the current state.
the only test was possible using a PC app.

not tested:
- recording via external recorder
- syncing with apps that are SMPTE-aware
- feedback about desync errors or offsets etc

@Markus:
the frame count when set to zero should give you a continuous tone.
doesnt it?
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 20, 2013, 11:30:44 AM
g3gg0: Yes it does as long as you don't have the "beep tone" activated. 
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: AnotherDave on December 20, 2013, 01:32:21 PM
Quote from: g3gg0 on December 20, 2013, 09:53:59 AM
@AnotherDave:
Is it still just set to do PAL only?  I don't get a read out from it on my Tascam HD-P2.  Happy to test it.  Just tell me what'cha need me to do.
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Baarman on December 21, 2013, 04:23:44 PM
Hi,

g3gg0: could you please re-add last well known working SMPTE module back to ML nightly builds default, please? Today I was looking for it and tried 2-3 different versions before I found the one that really worked. The side effect that I'm still randomly getting is immediately hanged camera after pressing REC button. It was better with some builds but worse with some other. ML builds were 20.12.2013 and 21.12.2013. Camera was 5dmkIII.

Don't know exactly which one was the approved one from this topic so I tried a few: http://www.magiclantern.fm/forum/index.php?topic=7764.0

Maybe some other setting was incorrect, I don't know.

By the way, I don't suggest to choose SMPTE output volume 100, because no matter if you put specific channel (or all the channels beside the microphone) under monitor mixer on mute, the annoying "girrrrrrrrrrrrrrrrrr" sound will be recorded. That noise is in sync with the rapidly blinking red LED light on that channel. You can hear it with you headphones while you monitor and it will also be recorded. So that the audio will be ruined.
First I tried to SMPTE output volume 80, it got better and then picked 50 because even 50 triggers the auto recording perfectly and the noise disappears. It's not the same noise ("shhhhhhhhh") that you hear before muting the channel in monitor mixer, it's something else.

Thanks!
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: rob_6 on December 21, 2013, 09:56:42 PM
Would it be difficult to make the smpte sound module work with the raw_rec.mo? All I really need is the sound output to trigger my recorder. I was able to get it to work, but when I restart the camera it crashes when trying to record again. I know it is made for mlv_rec.mo, but would be great if I could use it for raw_rec.


I prefer working with raw_rec.mo over mlv_rec.mo because of the ease of use I have converting raw_rec.mo files with Raw Magic. Raw_rec development is a little further along as well. I haven't been able to convert mlv files with my Mac running 10.8.5 and Mavericks even after reading several threads and trying many different possible solutions.

Thanks!

Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Baarman on December 21, 2013, 10:16:12 PM
Wait...I was not aware that SMPTE.mo doesn't have to work with the "old" raw_rec and is meant to work only with mlv_rec. If you say that this is the case, then there's no surprise that it hangs randomly with raw_rec.

In that case, I'm a  Mac user too and regardless mlv_rec benefits the raw_rec is much more user friendly on Mac. Haven't got time nor knowledge to use mlv_rec yet, but if SMPTE doesn't work with the old raw_rec then Iguess I should learn how to do that.

Please share up to date comments/instructions/links, thanks!

(currently hanging with SMPTE.mo continues on 5DmkIII with latest ML version and latest SMPTE.mo right after pressing the REC button. Hanging stops once I disable SMPTE.mo from the menu. This happens with raw_rec and if anybody could fix this, I'd be extremely grateful).

Thank you very much! 
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: rob_6 on December 22, 2013, 12:15:34 AM
I found a way to trick the stmpe module to play the sound with raw_rec without freezing. When you start up the camera go to the Audio Tab and go to the SMPTE Output settings and hit set on the Test Output which will play the sound and then hit set again to stop. Now start recording with with raw_record and the sound will play and record without freezing. With this work around I am recording and monitoring sound with my H4n. There is a mixer function in the menu that will allow you to pan or turn off the volume of the smpte sound.

Not a good workflow, but I thought it might help g3gg0 or any other developer in finding a solution to enable smtpe to work with raw_rec. At least I hoping someone would like to help us! Thanks so much!
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 22, 2013, 12:52:41 AM
Quote from: Baarman on December 21, 2013, 04:23:44 PM
Hi,

g3gg0: could you please re-add last well known working SMPTE module back to ML nightly builds default, please? Today I was looking for it and tried 2-3 different versions before I found the one that really worked. The side effect that I'm still randomly getting is immediately hanged camera after pressing REC button. It was better with some builds but worse with some other. ML builds were 20.12.2013 and 21.12.2013. Camera was 5dmkIII.

Don't know exactly which one was the approved one from this topic so I tried a few: http://www.magiclantern.fm/forum/index.php?topic=7764.0

Maybe some other setting was incorrect, I don't know.

By the way, I don't suggest to choose SMPTE output volume 100, because no matter if you put specific channel (or all the channels beside the microphone) under monitor mixer on mute, the annoying "girrrrrrrrrrrrrrrrrr" sound will be recorded. That noise is in sync with the rapidly blinking red LED light on that channel. You can hear it with you headphones while you monitor and it will also be recorded. So that the audio will be ruined.
First I tried to SMPTE output volume 80, it got better and then picked 50 because even 50 triggers the auto recording perfectly and the noise disappears. It's not the same noise ("shhhhhhhhh") that you hear before muting the channel in monitor mixer, it's something else.

Thanks!

I plug in my signal cabel via a 3.5 mini jack to 6.3 audio jack that goes in to my H6. This makes my signal go in as a line signal bypassing the mic amplifiers. Are you using a mini-tele to xlr setup? The way i got it set up I can not replicate your problem and i don't hear anything from my signal-channel on my other tracks. I have also amplify carefully so that it just reaches 0db and that i don't amplify it more than I need to.
Also if you have a mini-tele to xlr setup you could try the -20db switch on the sinal channel on your H6 and then adjust the signal to get 0db signal. It might be that you send a to strong signal to your preams if you go in via xlr.   
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: g3gg0 on December 22, 2013, 01:06:53 AM
took notice about your feedback, thanks.
focusing on mlv_snd at the moment, but will not forget about you ;)
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Baarman on December 22, 2013, 01:15:32 PM
Hi,

Thank you, g3gg0!

Markus, I'm using 3,5mm audio jacks cable (http://pixels.uk.com/images/uploads/cables/3-5mm%20audio%20jack.png) with adapter to 6,3mm (http://www.amarutech.com/images/Adaptateur%20jack%206.5mm%203.5mm/6.5mm%20Male%20to%203.5mm%20Female%20Stereo%20Audio%20Adapter%20AV.jpg). No XLR so far, although I could test this.

Do I understand correctly that you use the same setup?
My noise problem was resolved with reducing SMPTE output volume in ML settings from 100 to 50 although H6 still keeps receiving the signal constantly 0db. In other words, nothing changed visually, just the annoying "girrrrrr" noise disappeared. Strange. Could be the cable, could be something else. What happens when you reduce the SMPTE output volume? It doesn't reach to 0db for Zoom anymore?

Is the cable length/thickness/standard in any way related to delay between picture and sound?

All best to you!
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 22, 2013, 09:27:29 PM
Then we have the same setup. How much do you amplify the signal on your H6? Cable length should not really matter.
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Baarman on December 22, 2013, 11:44:59 PM
Hi,

I accidentaly turned the channel wheel on H6 to the maximum (10) which is obviously too much like I discovered now. Once I turned it down to 5-6 the sound became clear. :)
Same effect as reducing SMPTE output volume from 100 to 50-60. Currently I put SMPTE to 60 and H6 channel amplifier 6 so that it barely but constantly gets SMPTE signal and there's no noise. Thanks for your help, everything clear now. Also, it seems that rob_6 suggested workaround really works and I happily use this until the bug related to it will be fixed.
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on December 23, 2013, 02:47:46 PM
Your welcome and Im glad you got it working =).
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: timelapsetoronto on December 28, 2013, 12:53:10 AM
Hello,
I greatly appreciate the work done to achieve this feature.  Will SMPTE.mo work on the canon mkii?  If so,could someone please kindly point me in the right direction as to what i need to do.  I have been running 5D alpha 2 successfully for months now.  I have a H6 now and need to get cooking!

THANK YOU ALL
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: meditant on June 20, 2014, 02:45:40 PM
Hello,

Where ca i find smpte.mo for 5D Mk III 1.2.3 ?

Best regards
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on June 20, 2014, 10:24:43 PM
Unfortunatley smtp.mo hasn't been updated for quite some time now and the old one does not work with current builds. 
Title: Re: [SOLVED] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: erek on August 11, 2014, 06:01:58 AM
I hope that someday soon they will implement a way for this to work with modern builds of ML ...  I have found the source code for generating beeps, but am investigating using Virtualbox setup to modify and compile ML and also QEMU to test my modifications...


https://bitbucket.org/hudson/magic-lantern/src/3efd69b63b955619246b4c0c7095e2c234522ffa/src/beep.c?at=unified

Title: Re: [BROKEN] Feature request: continuous rec tone for zoom H6 auto start stop
Post by: Markus on August 12, 2014, 03:03:56 AM
Cool  :). I use mlv with sound almost always as of now so this would not not work for me right now. Still would be nice to have it working again. If the camera could send start/stop signals trough the lanc cable directly to the zoom ML would have a really cool start stop feature for external audio recorders.