diff 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
line wrap: on
line diff
--- a/src/aci2/aci/hl_audio_drv.c	Mon Mar 18 17:56:04 2019 +0000
+++ b/src/aci2/aci/hl_audio_drv.c	Wed Mar 27 22:18:35 2019 +0000
@@ -29,6 +29,9 @@
 #include "aci.h"
 #include "psa.h"
 #include "hl_audio_drv.h"
+#include "rv/rv_general.h"
+#include "audio/audio_api.h"
+#include "fc-target.cfg"
 
 
 
@@ -36,6 +39,10 @@
 
 LOCAL T_HL_VOCODER_STATE currVocoderState;
 
+#ifdef CONFIG_TARGET_FCDEV3B
+GLOBAL UBYTE aci_digital_voice_autoswitch;
+#endif
+
 /* This flag helps enable the vocoder interface testing for
    specific tescases 
 */
@@ -88,6 +95,12 @@
 */
 GLOBAL T_HL_VOICE_DRV_RSLT hl_drv_enable_vocoder ( void )
 {
+#ifdef CONFIG_TARGET_FCDEV3B
+  T_AUDIO_VOICE_PATH_SETTING vpath = AUDIO_BLUETOOTH_HEADSET;
+  T_AUDIO_FULL_ACCESS_WRITE audio_param;
+  T_RV_RETURN return_path = { NULL, 0 };
+#endif
+
   TRACE_FUNCTION("hl_drv_enable_vocoder()");
   /* If the vocoder is already enabled, then ignore the request */
   switch(currVocoderState)
@@ -121,6 +134,14 @@
     enable_tch_vocoder(TRUE);
     vocoder_mute_dl (FALSE);      /* un-mute speaker    */
     vocoder_mute_ul (FALSE);      /* un-mute microphone */
+  #ifdef CONFIG_TARGET_FCDEV3B
+    if (aci_digital_voice_autoswitch)
+    {
+      audio_param.variable_indentifier = AUDIO_PATH_USED;
+      audio_param.data = &vpath;
+      audio_full_access_write(&audio_param, return_path);
+    }
+  #endif
     currVocoderState = HL_VOCODER_ENABLED;
 #endif /* _SIMULATION_ */
 #endif
@@ -139,6 +160,12 @@
 */
 GLOBAL void hl_drv_disable_vocoder ( void )
 {
+#ifdef CONFIG_TARGET_FCDEV3B
+  T_AUDIO_VOICE_PATH_SETTING vpath = AUDIO_GSM_VOICE_PATH;
+  T_AUDIO_FULL_ACCESS_WRITE audio_param;
+  T_RV_RETURN return_path = { NULL, 0 };
+#endif
+
   TRACE_FUNCTION("hl_drv_disable_vocoder()");
 
   currVocoderState = HL_VOCODER_DISABLED;
@@ -150,6 +177,14 @@
   vocoder_mute_dl (TRUE);       /* mute speaker    */
   vocoder_mute_ul (TRUE);       /* mute microphone */
   enable_tch_vocoder (FALSE);   /* disable vocoder */
+#ifdef CONFIG_TARGET_FCDEV3B
+  if (aci_digital_voice_autoswitch)
+  {
+    audio_param.variable_indentifier = AUDIO_PATH_USED;
+    audio_param.data = &vpath;
+    audio_full_access_write(&audio_param, return_path);
+  }
+#endif
 #endif
 #endif
 }
@@ -200,4 +235,4 @@
 {
   vocoder_tst_flag = TRUE;
 }
-#endif
\ No newline at end of file
+#endif