600D Audio Controls?

Started by testaevisual, June 17, 2012, 06:16:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

1%

Look through my source, my menus work but I did make some changes to menu.c when testing in play mode, I'm getting rid of that stuff today. Also check ifdefs around the individual parts of menu, there is more than just the main audio menu vs putting "meters" in display.

Ash McKenzie


johndb

I would be happy to test anything that you come with related to 600D audio. You have my support and thank you for your hard work :)
600D ML | 450D | EF-S 17-55mm f/2.8 IS USM, EF-S 60mm f/2.8 Macro USM, EF 70-300mm f/4-5.6 IS USM, Speedlite 580EX II, Azden SMX-10 Microphone; Sony Vegas HD Platinum, DxO Optics Pro, DxO Filmpack, Oloneo HDR Photoengine

1%


miyake

Quote from: 1% on July 25, 2012, 05:53:53 PM
I can confirm 0a is not default value for input power managment. Camera starts with no meter... I PTP

c 0xFF06A144 0x230a
and

c 0xFF06A144 0x1311 (or 13, hehehe)

Meter works

just setting rec mode does not. have to power the amp first (or after)


*** Maybe we just cut the function to those 2 settings, why set all the other stuff it just messes with things.

Also clone to stereo if you want afterwards for internal mic:

e1=02 - recording 1 channel
e1 = 01 recording 2 channels


I just facing same issue.
When I add audio menus and some related function enabled, Audio metar woking only L.
I'm not set any audio_ic_write at just launched.
Therefore,
1: Canons initialization is depend on some another configs.
2: Added overwrite IC setting when finish cannon initialization.(little tricky )


miyake

someone help

Current 600D audio wikia is little difficult to read
http://magiclantern.wikia.com/wiki/600D/Audio

So please help to solve like this.
600D (Oki ML26121A)                                550D (AK4646)
DisableAudioIC
2100 (ML_PW_REF_PW_MNG )                            2100
0d00 (ML_CLK_EN)                                              0d00


How to solve it.
ex:First line

2100                                                               2100


Then find 0x2100 in:
https://bitbucket.org/miyake_t/magic-lantern-miyake/src/464c27ee1aba/src/audio.h
line 161-261


#define ML_PW_REF_PW_MNG                0x2100 /* MICBIAS */ /* Reference Power Management */


Then edit wikia such as first example.

Is this a enough for explainning?

1%

QuoteAudio metar woking only L.

Set 0xe101 if you want. I have it under "clone to stereo"

mic input and input type can also move it around.. more so with external mic.

What changes audio.
*Bring up Audio Menu in canon menus
*Play mode
*Any button in play mode
*Rec start
*Rec stop
*Plug/Unplug mic (maybe)

Nothing else, I think.

miyake

I didn't touch 0xE1, but now my 600D is working stereo audio meter.
working is not clone.

1%

You did turn on :

audio_ic_write(ML_NODOC_E5 | 0x06);


I need to check out all 0xeX registers.

Clone works for me after the mic is powered and everything is on one channel.

miyake

1 % you are correct!
0xe506 is work for me.
I was  miss understanding.



Kromofone

Hello, I've read through all of this, and I hope that this function will be available to the 600D soon!

As for now, I will also start testing all of the work, you've put in for the 600D Audio ML Functions, on my 600D! I will have results, as soon as I'm done!

johndb

Quote from: 1% on July 26, 2012, 03:27:58 AM
If you feel like testing, here you go:

http://www.qfpost.com/file/d?g=FZOCi9eXH

Where will the up-to-date build be located?
600D ML | 450D | EF-S 17-55mm f/2.8 IS USM, EF-S 60mm f/2.8 Macro USM, EF 70-300mm f/4-5.6 IS USM, Speedlite 580EX II, Azden SMX-10 Microphone; Sony Vegas HD Platinum, DxO Optics Pro, DxO Filmpack, Oloneo HDR Photoengine

1%

I'll try to put one up whenever there is a major change.

Right now I don't think we really found anything new.
miyake wanted both channels on at start for the internal mic and so he fed it through the eq but it makes no difference either way, when recording starts it will do it automatically. If you hit clone stereo (in debug/7kor) you can enable both channels after everything is up.

Mic switching and all the volume controls activate when you turn on vol writes.

Without figuring out monitor, all its good for is audio remote shot.

I also found a sound_dev task

FF057774    sounddev_task

Does set some sort of gain, I think.

scrax

I'm following 1% and miyake works and so far I have a mixed up audio.c that has code from miyake and code from 1%. Audio remote shot is working (in stereo now) at startup and also after rec. It will stop to work if canon audio menu is opened and if a video is played after record it will work again.

I'm trying to cleanup the code to understan better how it works
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

1%

Its pretty simple:

1. Ifdef out all writes + junk from old audio.c so it compiles + keeps camera functionality.

2. Switch registers around
Miyake set it up so its constantly powering up audio when not recording and loading default-ish settings that turn the mic amp on and set an imput volume.

I set remote shot to power the audio if audio is disabled (it should work all the time) See if it still records the sound with audio disabled... I didn't test that.

scrax

I've understood what is working so far, your changes and miyake's ones.
But all the thing you put in audio.h are more difficult to understand so far for me, I'll make more specific question later if I find problems, diggin the code.

But also is this working on 1100D for example, because I used nanomad suggestion "define OKI_IC" instead of CONFIGURE_600D.

Just one question so far to be sure about what I suppose.

From original audio menu what is working?
from my tests nothing is doing anything, just when changing input source sometime it enables audio monitor if went off for some reason.

from you menu input is working? I'm compiling it now...

EDIT: I've made a new auodioki.c file for audio on 600D only it has only the ML code used so far plus code from 1% and miyake, I'm not compiling anymore audio.c for the 600D so it's less unified but this is just to have a more clear view of the specific 600D code. Until ML audio code don't change it will be easy to port back with ifdef when mature.
I'll commit it after some more cleaning of my fork.
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

1%

Input and volume works only if you enable "vol writes". Not all settings are valid.

QuoteBut also is this working on 1100D for example, because I used nanomad suggestion "define OKI_IC" instead of CONFIGURE_600D.

Not sure, I think he has some sort of 3rd IC or a slightly different AK one. Define OKI IC didn't go far enough and stuff was still being written to the registers, ironically powering meters. Somebody made a bug report and alex took the changes out.

QuoteFrom original audio menu what is working?

Nothing, the ICs operate differently. Have to make new menus. Headphone and meters work but headphone sound leaves much to be desired. Headphone doesn't work at startup, you have to toggle it. If you power the mic amp, feed a strong source like an MP3 player into the camera then power dac you can hear sound faintly, especially when messing with the volumes.

Remote shot works. You can isolate the external mic or only put it on one channel and then move that channel from L->R and back. Also can get external and internal going at the same time.

At least we're further along and actually making some constructive stuff.

scrax

1% edited my post while you where writing...

Thanks, now i've a more clear idea on what's going on. preparing audioki.c helped me understand more what we have so far.

EDIT: posted my audioki.c on the fork
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

miyake

go go scrax!
My English might be poor. So all of my understanding is in my code.

Also just write this
http://magiclantern.wikia.com/wiki/File:Audioicworking.png

nanomad

The 1100D has a fourth AudioIC. Registers do not match with 600D , 550D or 500D  >:(
I'm waiting for some photos of the IC to start hacking the code but this is a really low priority issue (We got audio meters and trigger but I need to disable AGC if i want trigger to work reliably)
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

scrax

FIxed my fork for audioki.c to work, all thing related to 600D audio is there, I've made some submenu for 1% test code because it was too long to be all visible on screen.
Are mic volume working' i see no differeces in the meters...
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

1%

Try changing while its playing/recording. Stop and Rec and Play reset things, sometimes it catches, sometimes not. I know input and boost work on analog. Digital volumes don't have as much lattitude. Also would be good to see what all real volume values are. I know the canon slider adds volume -> boost-> gain depending on how high you set it.

There is one volume I have to tweak when I try the monitor. I lose the meters but I hear the output better. Either way, volume is not practical/finished yet, that is why I put On/off for setting it.

miyake

patches with current my code

-audioki.c has no handling when vol change finished , added handler code in this patch
*also start recording.
-reset->override (fucntion name change)
-now reset audio had input select function


I think some configration task will need to add in override_audio_setting().  or audio_configure() directory.
If you add configration override code in audio_configure(), You need to change to call audio_configure() at startup/volchange/finish recording.



diff -r 4fdf51b053f0 src/audioki.c
--- a/src/audioki.c     Sat Jul 28 02:37:01 2012 +0200
+++ b/src/audioki.c     Sat Jul 28 10:59:12 2012 +0900
@@ -1169,45 +1169,34 @@
}

void
-reset_audio_setting(int phase){
+override_audio_setting(int phase){

        //These audio_ic_write are setting back to startup time.
        //Because, the canon firmware will switching off the audio switchs I guess,it's for power save
     switch(phase){
-               case 0:
-                       //for startup
-                       audio_ic_write(ML_PW_ZCCMP_PW_MNG | 0x02);
-                       audio_ic_write(ML_MIC_TIM | 0x12);
-                       audio_ic_write(ML_EQ_GAIN_BRAND0 | 0xdd);
-                       audio_ic_write(ML_EQ_GAIN_BRAND1 | 0xdd);
-                       audio_ic_write(ML_HPF2_CUTOFF | 0x04);
-                       audio_ic_write(ML_EQBRAND0_F0L | 0x0d);
-                       audio_ic_write(ML_EQBRAND0_F0H | 0xdb);
-                       audio_ic_write(ML_EQBRAND0_F1L | 0x0c);
-                       audio_ic_write(ML_EQBRAND0_F1H | 0x1b);
-                       audio_ic_write(ML_EQBRAND1_F0L | 0x6d);
-                       audio_ic_write(ML_EQBRAND1_F0H | 0x08);
-                       audio_ic_write(ML_EQBRAND1_F1L | 0x41);
-                       audio_ic_write(ML_EQBRAND1_F1H | 0xed);
-                       audio_ic_write(ML_NODOC_E5 | 0x06);
-
-               case 1:
-
-                       audio_ic_write(ML_REC_PLYBAK_RUN | 0x11); //
-                       audio_ic_write(ML_PW_IN_PW_MNG | 0x0a);   //DAC(0010) and PGA(1000) power on
-
-                       audio_ic_write(ML_DVOL_CTL | 0x2E);        //All(Play,Capture,DigitalVolFade,DigitalVol) switched on
-                       audio_ic_write(ML_PW_MIC_IN_VOL | 0x3f);
-                       audio_ic_write(ML_PW_MIC_BOST_VOL | 0x10);
-                       audio_ic_write(ML_PW_AMP_VOL_FUNC | 0x01);
-                       audio_ic_write(ML_FILTER_EN | 0x0f);       //All filter on
-                       audio_ic_write(ML_MIXER_VOL_CTL | 0x10);
-                       break;
+    case 0:   //Phase 0 for camera powerON->standby
+        audio_ic_write(ML_NODOC_E5 | 0x02); //Duplicate L to R
+
+    case 1: //Phase 1 for finish recording->standy & change vol setting->standby
+        audio_ic_write(ML_REC_PLYBAK_RUN | 0x11); //
+        audio_ic_write(ML_PW_IN_PW_MNG | 0x0a);   //DAC(0010) and PGA(1000) power on
+        audio_ic_write(ML_DVOL_CTL | 0x2E);        //All(Play,Capture,DigitalVolFade,DigitalVol) switched on
+        audio_ic_write(ML_PW_MIC_IN_VOL | 0x3f);
+        audio_ic_write(ML_FILTER_EN | 0x0f);       //All filter on
+
+        int inputsource = get_input_source();
+        if(inputsource == 0){ //int/int
+            audio_ic_write(ML_MIC_SELECT | 0x01);
+            audio_ic_write(ML_NODOC_E5 | 0x02); //Duplicate L to R
+        }else if(inputsource == 2){
+            audio_ic_write(ML_MIC_SELECT | 0x02);
+            audio_ic_write(ML_NODOC_E5 | 0x00);
+        }
     }
}


-struct msg_queue * reset_audio_q = NULL;
+struct msg_queue * override_audio_q = NULL;
short gIs_UnInitialized = 0;
//#endif

@@ -1229,15 +1218,14 @@
         #else*/
//miyake code #ifdef CONFIG_600D
        int msg;
-       int err = msg_queue_receive(reset_audio_q, (struct event**)&msg, 500);
+       int err = msg_queue_receive(override_audio_q, (struct event**)&msg, 500);
        if (!err){
-               reset_audio_setting(1);
+               override_audio_setting(1);
        }

        if(gIs_UnInitialized < 3){
                msleep(500);
-               reset_audio_setting(0);
-               //              disp_logoutput("reset audio");
+               override_audio_setting(0);
                gIs_UnInitialized++;
        }

@@ -2283,11 +2271,14 @@
         case 0:
             // Movie recording stopped;  (fallthrough)
#ifdef CONFIG_600D
-                       reset_audio_setting(1);
+                       override_audio_setting(1);
#endif
                case 2:
             // Movie recording started
             give_semaphore( gain.sem );
+#ifdef CONFIG_600D
+            override_audio_setting(1);
+#endif
             break;
         case 1:
             // Movie recording about to start?
@@ -2815,10 +2806,14 @@

PROP_HANDLER( PROP_AUDIO_VOL_CHANGE_600D )
{
-    /* Cannot overwrite audio config here!
-        Cannon firmware is overwrite after finishing here.
-
+    /* Cannot override audio config here!
+        Cannon firmware is override after finishing here.
         */
+    if(!override_audio_q)
+    override_audio_q = (struct msg_queue *) msg_queue_create("override_audio_q", 1);
+
+    msg_queue_post(override_audio_q, 1);
+
}

PROP_HANDLER( PROP_PLAYMODE_LAUNCH_600D )
@@ -2831,4 +2826,4 @@



-#endif
\ No newline at end of file
+#endif

miyake

In our changing, it will be perfectly override current Canon settings.
So I think we need to add "Audio setting override ON/OFF" menu item.

If so, we can vol/Eq/input/etc. settings at camera startup.


How do you think?

1%

I think its a good solution.