comparison src/g23m-aci/aci/hl_audio_drv.c @ 597:f18b29e27be5

First attempt at MCSI voice path automatic switching The function is implemented at the ACI level in both aci2 and aci3, successfully avoids triggering the DSP bug on the first call, but the shutdown of MCSI upon call completion is not working properly yet in either version.
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 27 Mar 2019 22:18:35 +0000
parents 53929b40109c
children 717ed17d82c6
comparison
equal deleted inserted replaced
596:e4d46979846f 597:f18b29e27be5
27 #include "aci_all.h" 27 #include "aci_all.h"
28 #include "aci_cmh.h" 28 #include "aci_cmh.h"
29 #include "aci.h" 29 #include "aci.h"
30 #include "psa.h" 30 #include "psa.h"
31 #include "hl_audio_drv.h" 31 #include "hl_audio_drv.h"
32 #include "rv/rv_general.h"
33 #include "audio/audio_api.h"
34 #include "fc-target.cfg"
32 35
33 #ifdef VOCODER_FUNC_INTERFACE 36 #ifdef VOCODER_FUNC_INTERFACE
34 #include "l4_tim.h" 37 #include "l4_tim.h"
35 #endif 38 #endif
36 39
39 /* ===============GLOBAL VARIABLES====================*/ 42 /* ===============GLOBAL VARIABLES====================*/
40 43
41 LOCAL T_HL_VOCODER_STATE currVocoderState; 44 LOCAL T_HL_VOCODER_STATE currVocoderState;
42 #ifdef VOCODER_FUNC_INTERFACE 45 #ifdef VOCODER_FUNC_INTERFACE
43 GLOBAL T_HL_VOCODER_ACTION currVocoderAction; 46 GLOBAL T_HL_VOCODER_ACTION currVocoderAction;
47 #endif
48
49 #ifdef CONFIG_TARGET_FCDEV3B
50 GLOBAL UBYTE aci_digital_voice_autoswitch;
44 #endif 51 #endif
45 52
46 /* This flag helps enable the vocoder interface testing for 53 /* This flag helps enable the vocoder interface testing for
47 specific tescases 54 specific tescases
48 */ 55 */
99 done to synchronize timing delay needed(appr 35ms) to actually 106 done to synchronize timing delay needed(appr 35ms) to actually
100 enable/disable of vocoder in DSP. 107 enable/disable of vocoder in DSP.
101 */ 108 */
102 GLOBAL void hl_drv_set_vocoder_state(BOOL user_attach) 109 GLOBAL void hl_drv_set_vocoder_state(BOOL user_attach)
103 { 110 {
111 #ifdef CONFIG_TARGET_FCDEV3B
112 T_AUDIO_VOICE_PATH_SETTING vpath;
113 T_AUDIO_FULL_ACCESS_WRITE audio_param;
114 T_RV_RETURN return_path = { NULL, 0 };
115 #endif
116
104 TRACE_FUNCTION("hl_drv_set_vocoder_state"); 117 TRACE_FUNCTION("hl_drv_set_vocoder_state");
105 118
106 #ifdef VOCODER_FUNC_INTERFACE 119 #ifdef VOCODER_FUNC_INTERFACE
107 if ( (user_attach EQ TRUE AND currVocoderState EQ HL_VOCODER_ENABLED) OR 120 if ( (user_attach EQ TRUE AND currVocoderState EQ HL_VOCODER_ENABLED) OR
108 (user_attach EQ FALSE AND currVocoderState EQ HL_VOCODER_DISABLED) ) 121 (user_attach EQ FALSE AND currVocoderState EQ HL_VOCODER_DISABLED) )
190 if (user_attach) 203 if (user_attach)
191 { 204 {
192 enable_tch_vocoder(TRUE); 205 enable_tch_vocoder(TRUE);
193 vocoder_mute_dl (FALSE); /* un-mute speaker */ 206 vocoder_mute_dl (FALSE); /* un-mute speaker */
194 vocoder_mute_ul (FALSE); /* un-mute microphone */ 207 vocoder_mute_ul (FALSE); /* un-mute microphone */
208 #ifdef CONFIG_TARGET_FCDEV3B
209 if (aci_digital_voice_autoswitch)
210 {
211 vpath = AUDIO_BLUETOOTH_HEADSET;
212 audio_param.variable_indentifier = AUDIO_PATH_USED;
213 audio_param.data = &vpath;
214 audio_full_access_write(&audio_param, return_path);
215 }
216 #endif
195 } 217 }
196 else 218 else
197 { 219 {
198 vocoder_mute_dl (TRUE); /* mute speaker */ 220 vocoder_mute_dl (TRUE); /* mute speaker */
199 vocoder_mute_ul (TRUE); /* mute microphone */ 221 vocoder_mute_ul (TRUE); /* mute microphone */
200 enable_tch_vocoder (FALSE); /* disable vocoder */ 222 enable_tch_vocoder (FALSE); /* disable vocoder */
223 #ifdef CONFIG_TARGET_FCDEV3B
224 if (aci_digital_voice_autoswitch)
225 {
226 vpath = AUDIO_GSM_VOICE_PATH;
227 audio_param.variable_indentifier = AUDIO_PATH_USED;
228 audio_param.data = &vpath;
229 audio_full_access_write(&audio_param, return_path);
230 }
231 #endif
201 } 232 }
202 #endif /* _SIMULATION_ */ 233 #endif /* _SIMULATION_ */
203 #endif /* VOCODER_FUNC_INTERFACE */ 234 #endif /* VOCODER_FUNC_INTERFACE */
204 } 235 }
205 236