comparison src/aci2/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 93999a60b835
children 8f50b202e81f
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 36
34 37
35 /* ===============GLOBAL VARIABLES====================*/ 38 /* ===============GLOBAL VARIABLES====================*/
36 39
37 LOCAL T_HL_VOCODER_STATE currVocoderState; 40 LOCAL T_HL_VOCODER_STATE currVocoderState;
41
42 #ifdef CONFIG_TARGET_FCDEV3B
43 GLOBAL UBYTE aci_digital_voice_autoswitch;
44 #endif
38 45
39 /* This flag helps enable the vocoder interface testing for 46 /* This flag helps enable the vocoder interface testing for
40 specific tescases 47 specific tescases
41 */ 48 */
42 #ifdef _SIMULATION_ 49 #ifdef _SIMULATION_
86 PURPOSE : This function is called to initialise the variables in 93 PURPOSE : This function is called to initialise the variables in
87 the High Level Audio driver 94 the High Level Audio driver
88 */ 95 */
89 GLOBAL T_HL_VOICE_DRV_RSLT hl_drv_enable_vocoder ( void ) 96 GLOBAL T_HL_VOICE_DRV_RSLT hl_drv_enable_vocoder ( void )
90 { 97 {
98 #ifdef CONFIG_TARGET_FCDEV3B
99 T_AUDIO_VOICE_PATH_SETTING vpath = AUDIO_BLUETOOTH_HEADSET;
100 T_AUDIO_FULL_ACCESS_WRITE audio_param;
101 T_RV_RETURN return_path = { NULL, 0 };
102 #endif
103
91 TRACE_FUNCTION("hl_drv_enable_vocoder()"); 104 TRACE_FUNCTION("hl_drv_enable_vocoder()");
92 /* If the vocoder is already enabled, then ignore the request */ 105 /* If the vocoder is already enabled, then ignore the request */
93 switch(currVocoderState) 106 switch(currVocoderState)
94 { 107 {
95 case HL_VOCODER_ENABLED: 108 case HL_VOCODER_ENABLED:
119 #ifndef _SIMULATION_ 132 #ifndef _SIMULATION_
120 TRACE_EVENT("Function interface for Vocoder"); 133 TRACE_EVENT("Function interface for Vocoder");
121 enable_tch_vocoder(TRUE); 134 enable_tch_vocoder(TRUE);
122 vocoder_mute_dl (FALSE); /* un-mute speaker */ 135 vocoder_mute_dl (FALSE); /* un-mute speaker */
123 vocoder_mute_ul (FALSE); /* un-mute microphone */ 136 vocoder_mute_ul (FALSE); /* un-mute microphone */
137 #ifdef CONFIG_TARGET_FCDEV3B
138 if (aci_digital_voice_autoswitch)
139 {
140 audio_param.variable_indentifier = AUDIO_PATH_USED;
141 audio_param.data = &vpath;
142 audio_full_access_write(&audio_param, return_path);
143 }
144 #endif
124 currVocoderState = HL_VOCODER_ENABLED; 145 currVocoderState = HL_VOCODER_ENABLED;
125 #endif /* _SIMULATION_ */ 146 #endif /* _SIMULATION_ */
126 #endif 147 #endif
127 } 148 }
128 return HL_VOICE_DRV_SUCC; 149 return HL_VOICE_DRV_SUCC;
137 PURPOSE : This function is called to initialise the variables in 158 PURPOSE : This function is called to initialise the variables in
138 the High Level Audio driver 159 the High Level Audio driver
139 */ 160 */
140 GLOBAL void hl_drv_disable_vocoder ( void ) 161 GLOBAL void hl_drv_disable_vocoder ( void )
141 { 162 {
163 #ifdef CONFIG_TARGET_FCDEV3B
164 T_AUDIO_VOICE_PATH_SETTING vpath = AUDIO_GSM_VOICE_PATH;
165 T_AUDIO_FULL_ACCESS_WRITE audio_param;
166 T_RV_RETURN return_path = { NULL, 0 };
167 #endif
168
142 TRACE_FUNCTION("hl_drv_disable_vocoder()"); 169 TRACE_FUNCTION("hl_drv_disable_vocoder()");
143 170
144 currVocoderState = HL_VOCODER_DISABLED; 171 currVocoderState = HL_VOCODER_DISABLED;
145 #ifndef VOCODER_FUNC_INTERFACE 172 #ifndef VOCODER_FUNC_INTERFACE
146 /* Do nothing in this case */ 173 /* Do nothing in this case */
148 #ifndef _SIMULATION_ 175 #ifndef _SIMULATION_
149 TRACE_EVENT("Function interface for Vocoder"); 176 TRACE_EVENT("Function interface for Vocoder");
150 vocoder_mute_dl (TRUE); /* mute speaker */ 177 vocoder_mute_dl (TRUE); /* mute speaker */
151 vocoder_mute_ul (TRUE); /* mute microphone */ 178 vocoder_mute_ul (TRUE); /* mute microphone */
152 enable_tch_vocoder (FALSE); /* disable vocoder */ 179 enable_tch_vocoder (FALSE); /* disable vocoder */
180 #ifdef CONFIG_TARGET_FCDEV3B
181 if (aci_digital_voice_autoswitch)
182 {
183 audio_param.variable_indentifier = AUDIO_PATH_USED;
184 audio_param.data = &vpath;
185 audio_full_access_write(&audio_param, return_path);
186 }
187 #endif
153 #endif 188 #endif
154 #endif 189 #endif
155 } 190 }
156 191
157 192