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