[Feature][T106][task-view-97] add interface for voice call to rtp,
modification in cp and ap and pub
Only Configure: No
Affected branch: unknown
Affected module: voice call and at
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: yes
Doc Update: no
Change-Id: I5c7bc461e790ee24805a520077ca80b5eeb7bbf1
(cherry picked from commit 13ef23011ea4cd9fc919b82e82202f09c0b2ef3e)
diff --git a/ap/lib/libatext/ext_audio_func.c b/ap/lib/libatext/ext_audio_func.c
index d12ed7d..e95b017 100755
--- a/ap/lib/libatext/ext_audio_func.c
+++ b/ap/lib/libatext/ext_audio_func.c
@@ -66,6 +66,19 @@
MAX_CODEC_OUTPUT_PATH
}T_ZDrv_CodecOutputPath;
+
+
+#ifdef _VBUFF_IN_SINGLE_CORE
+extern int vbuffer_stream_start(void);
+extern int vbuffer_stream_stop(void);
+#endif
+
+#ifdef _USE_VOICE_AT
+
+extern int voice_SetVoiceBuffer(T_VoiceBuf_Para *vb);
+extern int voice_GetVoiceBuffer(T_VoiceBuf_Para *vb);
+#endif
+
#ifdef _CONFIG_USE_CODEC_EARPIECE_DETECT
extern SINT32 halEarp_Open(VOID);
extern SINT32 halEarp_Close(VOID);
@@ -525,6 +538,134 @@
}
#endif
+#ifdef _USE_VOICE_AT
+
+int extAt_Voice_Process_set (int at_fd, char * at_paras, void * *res_msg, int * res_msglen)
+{
+ char *at_str = NULL;
+ UINT32 ret = DRV_SUCCESS;
+
+ int mode = 0;
+ int vp = 0;
+
+ UINT16 onOff = 0;
+ at_str = at_paras;
+ printf("%s, at_paras:%s \n",__func__, at_paras);
+
+ ret = sscanf (at_str, "%d", &vp);
+ printf("%s: vp=%d,ret=%d\n",__func__,vp,ret);
+
+ if (ret == 1) {
+
+ ret = voice_SetVoiceProcess(&vp);
+ printf("%s: alsa_voice_open,ret=%d\n",__func__,ret);
+
+ if (ret == DRV_SUCCESS) {
+ *res_msg = at_ok_build();
+ *res_msglen = strlen (*res_msg);
+ return AT_END;
+ }
+ }
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ *res_msglen = strlen (*res_msg);
+
+ return AT_END;
+}
+
+
+
+int extAt_Voice_Process_get(int at_fd,char * at_paras,void **res_msg,int * res_msglen)
+{
+
+
+
+ char vp_str[32] = {0};
+ printf("%s: %s\n",__func__,at_paras);
+ int vp = voice_GetVoiceProcess();
+ if( vp < 0)
+ {
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ *res_msglen = strlen(*res_msg);
+ return AT_END;
+ }
+ printf("%s: vp=%d",__func__,vp);
+
+ snprintf(vp_str, 32,"%d\r\n",vp);
+
+ *res_msg = at_query_result_build("AT+VOICEPROCESS",vp_str);
+ *res_msglen = strlen(*res_msg);
+ return AT_END;
+
+}
+
+
+
+
+int extAt_VoiceBuffer_Set (int at_fd, char * at_paras, void * *res_msg, int * res_msglen)
+{
+ char *at_str = NULL;
+ UINT32 ret = DRV_SUCCESS;
+
+ int enable = 0;
+ int type = 0;
+ T_VoiceBuf_Para vb;
+ at_str = at_paras;
+ printf("%s, at_paras:%s \n",__func__, at_paras);
+
+ //ret = sscanf (at_str, "%d", &vp);
+
+ ret = sscanf (at_str, "%d,%d", &enable,&type);
+ printf("%s: enable=%d type=%d,ret=%d\n",__func__,enable,type,ret);
+
+ if (ret == 2) {
+ vb.enable = enable;
+ vb.type = type;
+
+ ret = voice_SetVoiceBuffer(&vb);
+ printf("%s: voice_SetVoiceBuffer,ret=%d\n",__func__,ret);
+
+ if (ret == DRV_SUCCESS) {
+ *res_msg = at_ok_build();
+ *res_msglen = strlen (*res_msg);
+ return AT_END;
+ }
+ }
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ *res_msglen = strlen (*res_msg);
+
+ return AT_END;
+}
+
+
+int extAt_VoiceBuffer_Get(int at_fd,char * at_paras,void **res_msg,int * res_msglen)
+{
+ UINT32 ret = DRV_SUCCESS;
+
+ T_VoiceBuf_Para vb;
+
+
+ char vp_str[32] = {0};
+ printf("%s: %s\n",__func__,at_paras);
+ ret = voice_GetVoiceBuffer(&vb);
+ if( ret < 0)
+ {
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ *res_msglen = strlen(*res_msg);
+ return AT_END;
+ }
+ printf("%s: fs=%d enable=%d type=%d",__func__,vb.fs,vb.enable,vb.type);
+
+ snprintf(vp_str, 32,"%d %d %d\r\n",vb.fs,vb.enable,vb.type);
+
+ *res_msg = at_query_result_build("AT+VOICE_BUFFER",vp_str);
+ *res_msglen = strlen(*res_msg);
+ return AT_END;
+
+}
+
+
+#endif
+
#ifdef _VBUFF_IN_SINGLE_CORE
int extAt_VBUFFER_act_func (int at_fd, char * at_paras, void * *res_msg, int * res_msglen)
{
@@ -587,13 +728,23 @@
register_serv_func2("VALSA=", 0, 0, 0, extAt_VALSA_act_func, NULL);
register_serv_func2("VPATH=", 0, 0, 0, extAt_VPATH_act_func, NULL);
register_serv_func2("CAP_VALSA=", 0, 0, 0, extAt_CAP_VALSA_act_func, NULL);
-
#endif
#ifdef _VBUFF_IN_SINGLE_CORE
register_serv_func2("VBUFFER=", 0, 0, 0, extAt_VBUFFER_act_func, NULL);
#endif
+#ifdef _USE_VOICE_AT
+register_serv_func2("VOICE_PROCESS=",0,0,0,extAt_Voice_Process_set, NULL);
+register_serv_func2("VOICE_PROCESS?",0,0,0,extAt_Voice_Process_get, NULL);
+
+register_serv_func2("VOICE_BUFFER=",0,0,0,extAt_VoiceBuffer_Set, NULL);
+register_serv_func2("VOICE_BUFFER?",0,0,0,extAt_VoiceBuffer_Get, NULL);
+#endif
+
+
+
+
}
#endif
diff --git a/ap/lib/libps/220A1_vehicle_dc/drv/amr.a b/ap/lib/libps/220A1_vehicle_dc/drv/amr.a
index 01399c1..2078afc 100755
--- a/ap/lib/libps/220A1_vehicle_dc/drv/amr.a
+++ b/ap/lib/libps/220A1_vehicle_dc/drv/amr.a
Binary files differ
diff --git a/ap/lib/libps/220A1_vehicle_dc/drv/audio_base.a b/ap/lib/libps/220A1_vehicle_dc/drv/audio_base.a
index 5147df5..820bf26 100755
--- a/ap/lib/libps/220A1_vehicle_dc/drv/audio_base.a
+++ b/ap/lib/libps/220A1_vehicle_dc/drv/audio_base.a
Binary files differ
diff --git a/ap/lib/libps/220A1_vehicle_dc/drv/chip.a b/ap/lib/libps/220A1_vehicle_dc/drv/chip.a
index b089432..a894c29 100755
--- a/ap/lib/libps/220A1_vehicle_dc/drv/chip.a
+++ b/ap/lib/libps/220A1_vehicle_dc/drv/chip.a
Binary files differ
diff --git a/ap/lib/libps/220A1_vehicle_dc/drv/drv_sdk.a b/ap/lib/libps/220A1_vehicle_dc/drv/drv_sdk.a
index b3ff588..b7a6a70 100755
--- a/ap/lib/libps/220A1_vehicle_dc/drv/drv_sdk.a
+++ b/ap/lib/libps/220A1_vehicle_dc/drv/drv_sdk.a
Binary files differ
diff --git a/ap/lib/libps/220A1_vehicle_dc/drv/public.a b/ap/lib/libps/220A1_vehicle_dc/drv/public.a
index c6e5c8c..73af441 100755
--- a/ap/lib/libps/220A1_vehicle_dc/drv/public.a
+++ b/ap/lib/libps/220A1_vehicle_dc/drv/public.a
Binary files differ
diff --git a/ap/lib/libps/220A1_vehicle_dc/drv/webrtc.a b/ap/lib/libps/220A1_vehicle_dc/drv/webrtc.a
index c86f9b5..123cbbb 100755
--- a/ap/lib/libps/220A1_vehicle_dc/drv/webrtc.a
+++ b/ap/lib/libps/220A1_vehicle_dc/drv/webrtc.a
Binary files differ
diff --git a/ap/lib/libvoice/Makefile b/ap/lib/libvoice/Makefile
index 7d677fb..48061f2 100755
--- a/ap/lib/libvoice/Makefile
+++ b/ap/lib/libvoice/Makefile
@@ -25,11 +25,14 @@
LIB_STATIC = libvoice.a
ifeq ($(USE_VOICE_ALSA),yes)
OBJS = voice.o alsa_call.o voice_api.o voiceipc.o
-else ifeq ($(USE_VOICE_BUFFER_IN_AP),yes)
-OBJS = voice.o voice_buffer.o
+
else
OBJS = voice.o
endif
+
+ifeq ($(USE_VOICE_BUFFER_IN_AP),yes)
+OBJS += voice_buffer.o
+endif
CFLAGS += -g
LDFLAGS += -lpthread
diff --git a/ap/lib/libvoice/include/voice_lib.h b/ap/lib/libvoice/include/voice_lib.h
index 4023dc3..2238b6b 100755
--- a/ap/lib/libvoice/include/voice_lib.h
+++ b/ap/lib/libvoice/include/voice_lib.h
@@ -55,6 +55,10 @@
int voice_Vploop(int *path);
int zDrvVolte_PreOpen(T_ZDrvVolte_Cfg *cfgParam);
void zDrvVolte_PreClose(void);
+ int voice_SetVoiceProcess(int *vp);
+ int voice_GetVoiceProcess(void);
+
+
#ifdef _VBUFF_IN_SINGLE_CORE
int vbuffer_stream_start(void);
diff --git a/ap/lib/libvoice/voice.c b/ap/lib/libvoice/voice.c
index 61b9c1e..6af0fa6 100755
--- a/ap/lib/libvoice/voice.c
+++ b/ap/lib/libvoice/voice.c
@@ -167,7 +167,7 @@
}
ret = ioctl(fd, VOICE_IOCTL_VPLOOP, path);
if (ret) {
- printf("voice_Vploop: ret=%d,path=%p.\n", ret, path);
+ printf("voice_Vploop: ret=%d,path=%d.\n", ret, *path);
close(fd);
return -1;
}
@@ -224,18 +224,20 @@
}
}
#if defined(_VBUFF_IN_SINGLE_CORE) || defined(_VBUFF_IN_MULTI_CORE)
- printf("%s: use voice buffer,return!\n",__func__);
+ printf("%s: ap use voice buffer,return!\n",__func__);
return 0;
#endif
#if defined(_ALSA_CODEC_IN_CAP) && defined(_USE_ALSA_AT_INTF)
+ printf("%s:_ALSA_CODEC_IN_CAP and at intf!\n",__func__);
- printf("%s: i2s and codec not need config,return!\n",__func__);
+ printf("%s:ap i2s and codec not need config,return!\n",__func__);
return 0;
#elif defined(_ALSA_CODEC_IN_CAP)
+ printf("%s:_ALSA_CODEC_IN_CAP!\n",__func__);
if(cfgParam->clock_rate == 8000){
@@ -261,6 +263,7 @@
#endif
+ printf("%s:ap do mixer and pcm opt!\n",__func__);
//open mixer dev for codec control
voice_mixer = mixer_open(0);
@@ -390,6 +393,93 @@
}
+int voice_SetVoiceProcess(int *vp)
+{
+ int ret = 0;
+ int fd = -1;
+ printf("%s: start vp=%d!\n",__func__,*vp);
+ fd = open(VOICE_DEV_NAME, O_RDONLY);
+ if (fd < 0) {
+ printf("%s: open voice device error.\n",__func__);
+ return -1;
+ }
+ ret = ioctl(fd, VOICE_IOCTL_SET_VP, vp);
+ if (ret) {
+ printf("%s: ret=%d,vp=%d.\n",__func__, ret, *vp);
+ close(fd);
+ return -1;
+ }
+ close(fd);
+ return 0;
+
+}
+int voice_GetVoiceProcess(void)
+{
+ int ret = 0;
+ int fd = -1;
+ int vp = 0;
+ fd = open(VOICE_DEV_NAME, O_RDONLY);
+ if (fd < 0) {
+ printf("%s: open voice device error.\n",__func__);
+ return -1;
+ }
+ ret = ioctl(fd, VOICE_IOCTL_GET_VP, &vp);
+ if (ret) {
+ printf("%s: ret=%d,vp=%d.\n",__func__, ret, vp);
+ close(fd);
+ return -1;
+ }
+ close(fd);
+ printf("%s: vp=%d!\n",__func__,vp);
+
+ return vp;
+
+}
+
+int voice_SetVoiceBuffer(T_VoiceBuf_Para *vb)
+{
+ int ret = 0;
+ int fd = -1;
+ printf("%s: start enable=%d,type=%d!\n",__func__,vb->enable,vb->type);
+ fd = open(VOICE_DEV_NAME, O_RDONLY);
+ if (fd < 0) {
+ printf("%s: open voice device error.\n",__func__);
+ return -1;
+ }
+ ret = ioctl(fd, VOICE_IOCTL_SET_VBUF, vb);
+ if (ret) {
+ printf("%s: ret=%d.\n",__func__, ret);
+ close(fd);
+ return -1;
+ }
+ close(fd);
+ return 0;
+
+}
+
+int voice_GetVoiceBuffer(T_VoiceBuf_Para *vb)
+{
+ int ret = 0;
+ int fd = -1;
+ fd = open(VOICE_DEV_NAME, O_RDONLY);
+ if (fd < 0) {
+ printf("%s: open voice device error.\n",__func__);
+ return -1;
+ }
+ ret = ioctl(fd, VOICE_IOCTL_GET_VBUF, vb);
+ if (ret) {
+ printf("%s: ret=%d.\n",__func__, ret);
+ close(fd);
+ return -1;
+ }
+ close(fd);
+ printf("%s: start fs=%d enable=%d,type=%d!\n",__func__,vb->fs,vb->enable,vb->type);
+
+
+ return ret;
+
+}
+
diff --git a/ap/os/linux/linux-3.4.x/drivers/cpko/cpko_main.c b/ap/os/linux/linux-3.4.x/drivers/cpko/cpko_main.c
index e77e5fe..78abbea 100755
--- a/ap/os/linux/linux-3.4.x/drivers/cpko/cpko_main.c
+++ b/ap/os/linux/linux-3.4.x/drivers/cpko/cpko_main.c
@@ -80,36 +80,39 @@
zDrvVp_AudioDataOpen(UINT32 audioType,UINT32 sampleRate);extern SINT32
zDrvVp_AudioDataClose(void);extern SINT32 zDrvVp_GetVpLoop_Wrap(VOID);extern
VOID zDrvVp_Status(UINT32*sample_rate,UINT32*voice_status);extern VOID
-zDrvVp_UpdateVoiceNv(UINT8*voice_nv_update);typedef struct cpko_section{unsigned
+zDrvVp_UpdateVoiceNv(UINT8*voice_nv_update);extern int zDrvVp_SetVoiceProc_Wrap(
+int val);extern int zDrvVp_GetVoiceProc_Wrap(void);extern int
+zDrvVp_SetVoiceBuffer_Wrap(int en,int type);extern void
+zDrvVp_GetVoiceBuffer_Wrap(int*en,int*type);typedef struct cpko_section{unsigned
int cpko_text_start;unsigned int cpko_rodata_start;unsigned int
__utran_modem_text_start;unsigned int __lte_modem_text_start;unsigned int
__comm_modem_text_start;unsigned int modem_text_end;unsigned int cpko_data_start
;unsigned int cpko_bss_start;unsigned int cpko_text_offset;}cpko_section_layout;
cpko_section_layout cpko_ps_section;int raise(int signo){return
-(0x9e6+3955-0x1959);}extern unsigned int SysEntry(void);static int
+(0x1293+3341-0x1fa0);}extern unsigned int SysEntry(void);static int
ko_Main_Thread(void*data){struct sched_param param={.sched_priority=
-MAX_USER_RT_PRIO/(0x19ec+1080-0x1e22)-(0x1448+357-0x15aa)};int ret=
-(0x20f+6386-0x1b01);sched_setscheduler(current,SCHED_FIFO,¶m);ret=SysEntry()
-;if(ret!=(0x381+2774-0xe57))panic("Main_Thread\n");param.sched_priority=
-MAX_USER_RT_PRIO-(0x839+7013-0x2370);sched_setscheduler(kthreadd_task,SCHED_FIFO
-,¶m);return(0xef+5068-0x14bb);}int zte_modem_ko_start(void){kthread_run(
+MAX_USER_RT_PRIO/(0x212a+283-0x2243)-(0xf96+4078-0x1f81)};int ret=
+(0x556+3365-0x127b);sched_setscheduler(current,SCHED_FIFO,¶m);ret=SysEntry()
+;if(ret!=(0x762+3053-0x134f))panic("Main_Thread\n");param.sched_priority=
+MAX_USER_RT_PRIO-(0x20f+9342-0x265f);sched_setscheduler(kthreadd_task,SCHED_FIFO
+,¶m);return(0xb1d+2770-0x15ef);}int zte_modem_ko_start(void){kthread_run(
ko_Main_Thread,NULL,"\x5a\x54\x45\x4d\x61\x69\x6e\x54\x68\x72\x65\x61\x64");
-return(0x12ac+2426-0x1c26);}static void cpko_sectioninfo_set(void){int ret;
-struct file*fp;mm_segment_t old_fs;loff_t cpko_pos=(0x8bd+6473-0x2206);struct
+return(0xda9+1225-0x1272);}static void cpko_sectioninfo_set(void){int ret;struct
+ file*fp;mm_segment_t old_fs;loff_t cpko_pos=(0xd79+4186-0x1dd3);struct
cpps_globalModem globalVar;fp=filp_open(
"\x2f\x6c\x69\x62\x2f\x63\x70\x6b\x6f\x2f\x63\x70\x6b\x6f\x5f\x73\x65\x63\x69\x6e\x66\x6f\x2e\x62\x69\x6e"
-,(0x81a+3218-0x14ac),(0x1263+2589-0x1c80));if(IS_ERR(fp)||fp==NULL)panic(
+,(0xd6f+4364-0x1e7b),(0x1e3a+1192-0x22e2));if(IS_ERR(fp)||fp==NULL)panic(
"\x6f\x70\x65\x6e\x20\x66\x69\x6c\x65\x20\x65\x72\x72\x6f\x72" "\n");old_fs=
get_fs();set_fs(KERNEL_DS);ret=vfs_read(fp,(char*)&cpko_ps_section,sizeof(
-cpko_section_layout),&cpko_pos);if(ret<=(0xa02+7211-0x262d))panic(
+cpko_section_layout),&cpko_pos);if(ret<=(0x1438+2416-0x1da8))panic(
"\x72\x65\x61\x64\x20\x66\x69\x6c\x65\x20\x65\x72\x72\x6f\x72" "\n");filp_close(
fp,NULL);
#ifdef CONFIG_MODEM_CODE_IS_MAPPING
fp=filp_open(
"\x2f\x6c\x69\x62\x2f\x63\x70\x6b\x6f\x2f\x63\x70\x6b\x6f\x2e\x6b\x6f",
-(0xaf4+502-0xcea),(0xe41+3977-0x1dca));if(IS_ERR(fp)||fp==NULL)panic(
+(0xaf7+4826-0x1dd1),(0x16a0+1762-0x1d82));if(IS_ERR(fp)||fp==NULL)panic(
"\x6f\x70\x65\x6e\x20\x66\x69\x6c\x65\x20\x65\x72\x72\x6f\x72" "\n");fp->f_ra.
-ra_pages=(0x370+4606-0x156e);
+ra_pages=(0x16f1+3892-0x2625);
#endif
if(cpko_ps_section.cpko_text_start){globalVar.cpko_text_start=(unsigned long)
cpko_ps_section.cpko_text_start;globalVar.cpko_rodata_start=(unsigned long)
@@ -129,7 +132,7 @@
vfree_modem_section(globalVar.cpko_text_start,globalVar.modem_text_end);
#endif
}else panic("\x66\x69\x6c\x65\x20\x65\x72\x72\x6f\x72" "\n");}static int
-cpko_start(void){struct cpps_callbacks callback={(0xef6+2228-0x17aa)};callback.
+cpko_start(void){struct cpps_callbacks callback={(0x386+531-0x599)};callback.
zOss_ResetNVFactory=zOss_ResetNVFactory;callback.zOss_NvramFlush=zOss_NvramFlush
;callback.zOss_NvItemWrite=zOss_NvItemWrite;callback.zOss_NvItemWriteFactory=
zOss_NvItemWriteFactory;callback.zOss_NvItemRead=zOss_NvItemRead;callback.
@@ -184,7 +187,11 @@
zDrvVp_SetPath_Wrap=zDrvVp_SetPath_Wrap;callback.zDrvVp_GetPath_Wrap=
zDrvVp_GetPath_Wrap;callback.halVoice_Open3G=halVoice_Open3G;callback.
halVoice_Close3G=halVoice_Close3G;callback.zDrvVp_GetSlicFlag=zDrvVp_GetSlicFlag
-;callback.zDrvVp_SetEchoDelay_Wrap=zDrvVp_SetEchoDelay_Wrap;callback.
+;callback.zDrvVp_SetVoiceProc_Wrap=zDrvVp_SetVoiceProc_Wrap;callback.
+zDrvVp_GetVoiceProc_Wrap=zDrvVp_GetVoiceProc_Wrap;callback.
+zDrvVp_SetVoiceBuffer_Wrap=zDrvVp_SetVoiceBuffer_Wrap;callback.
+zDrvVp_GetVoiceBuffer_Wrap=zDrvVp_GetVoiceBuffer_Wrap;callback.
+zDrvVp_SetEchoDelay_Wrap=zDrvVp_SetEchoDelay_Wrap;callback.
zDrvVp_GetEchoDelay_Wrap=zDrvVp_GetEchoDelay_Wrap;callback.
zDrvVp_SetTxNsMode_Wrap=zDrvVp_SetTxNsMode_Wrap;callback.zDrvVp_GetTxNsMode_Wrap
=zDrvVp_GetTxNsMode_Wrap;callback.zDrvVp_SetRxNsMode_Wrap=
@@ -205,5 +212,5 @@
psm_GetModemSleepFlagStatus=psm_GetModemSleepFlagStatus;
#endif
cpps_callbacks_register(&callback);cpko_sectioninfo_set();zte_modem_ko_start();
-return(0x562+5820-0x1c1e);}static int cpko_stop(void){return(0x4bc+6970-0x1ff6);
-}module_init(cpko_start);module_exit(cpko_stop);
+return(0xa8b+6811-0x2526);}static int cpko_stop(void){return(0x6d2+1995-0xe9d);}
+module_init(cpko_start);module_exit(cpko_stop);
diff --git a/ap/os/linux/linux-3.4.x/drivers/staging/Makefile b/ap/os/linux/linux-3.4.x/drivers/staging/Makefile
index a935c69..a02bedb 100755
--- a/ap/os/linux/linux-3.4.x/drivers/staging/Makefile
+++ b/ap/os/linux/linux-3.4.x/drivers/staging/Makefile
@@ -62,6 +62,6 @@
obj-$(CONFIG_CAMERA_DRV) += camera/
obj-$(CONFIG_AMR_DRV) += amrdrv/
obj-$(CONFIG_VOICE_DRV) += voicedrv/
-obj-$(CONFIG_VOICE_BUFFER_DRV) += voicebufferdrv/
+obj-y += voicebufferdrv/
obj-$(CONFIG_AUDIOMIX_DRV) += audiomixdrv/
obj-$(CONFIG_PLAT_TEST) += plat_test/
diff --git a/ap/os/linux/linux-3.4.x/drivers/staging/voicebufferdrv/Makefile b/ap/os/linux/linux-3.4.x/drivers/staging/voicebufferdrv/Makefile
index 7c8c2fd..597480a 100755
--- a/ap/os/linux/linux-3.4.x/drivers/staging/voicebufferdrv/Makefile
+++ b/ap/os/linux/linux-3.4.x/drivers/staging/voicebufferdrv/Makefile
@@ -1,5 +1,5 @@
#
# voice buffer driver.
#
-obj-$(CONFIG_VOICE_BUFFER_DRV) += voice_buffer_drv.o
-voice_buffer_drv-$(CONFIG_VOICE_BUFFER_DRV) := voice_buffer_dev.o
+obj-y += voice_buffer_drv.o
+voice_buffer_drv-y := voice_buffer_dev.o
diff --git a/ap/os/linux/linux-3.4.x/drivers/staging/voicedrv/voice.c b/ap/os/linux/linux-3.4.x/drivers/staging/voicedrv/voice.c
index a47acf0..ef8d187 100755
--- a/ap/os/linux/linux-3.4.x/drivers/staging/voicedrv/voice.c
+++ b/ap/os/linux/linux-3.4.x/drivers/staging/voicedrv/voice.c
@@ -30,6 +30,7 @@
extern int halVoice_SetVolOut(T_HalVoice_Block* pVoiceBlock);
extern int halVoice_Enable(void);
extern int halVoice_Disable(void);
+extern int zDrvVp_Loop(int);
#ifdef _USE_VEHICLE_DC
extern int zDrvVp_GetVol_Wrap(void);
@@ -39,6 +40,9 @@
extern int zDrvVp_SetMute_Wrap(bool enable);
extern bool zDrvVp_GetMute_Wrap(void);
#endif
+extern void zDrvVp_UpdateVoiceNv(unsigned char *voice_nv_update);
+extern unsigned int zOss_NvItemWrite(unsigned int NvItemID, unsigned char *NvItemData, unsigned int NvItemLen);
+
static int voice_open(struct inode *ip, struct file *fp);
static int voice_release(struct inode *ip, struct file *fp);
static long voice_ioctl(struct file *fp, unsigned int cmd, unsigned long arg);
@@ -163,6 +167,29 @@
#endif
+
+
+static int voice_SetVp(int vp)
+{
+ int ret = 0;
+ ret = CPPS_FUNC(cpps_callbacks, zDrvVp_SetVoiceProc_Wrap)(vp);
+ if(ret < 0)
+ {
+ printk(KERN_ERR "vp_SetVp fail = %d\n",vp);
+ return ret;
+ }
+ return 0;
+}
+
+static int voice_GetVp(void)
+{
+ int vp;
+ vp = CPPS_FUNC(cpps_callbacks, zDrvVp_GetVoiceProc_Wrap)();
+ return vp;
+}
+
+
+
/* file operations for volte device /dev/volte_device */
static const struct file_operations voice_fops = {
.owner = THIS_MODULE,
@@ -406,7 +433,7 @@
bool para;
if (copy_from_user(¶, argp, sizeof(para))) {
- print_audio("voice_ioctl set vol copy_to_user err!\n");
+ print_audio("voice_ioctl set mute copy_to_user err!\n");
return -EFAULT;
}
ret = voice_SetMute(para);
@@ -501,6 +528,69 @@
break;
}
+ case VOICE_IOCTL_SET_VP: {
+ pr_info("voice set voice process! \n");
+ int para;
+
+ if (copy_from_user(¶, argp, sizeof(para))) {
+ print_audio("voice_ioctl set vp copy_to_user err!\n");
+ return -EFAULT;
+ }
+ ret = voice_SetVp(para);
+ break;
+ }
+
+ case VOICE_IOCTL_GET_VP: {
+ pr_info("voice get voice process! \n");
+ int vp;
+
+ vp = voice_GetVp();
+
+ if (copy_to_user(argp, &vp, sizeof(vp))) {
+ pr_err("voice_ioctl get vp copy_to_user err!\n");
+ return -EFAULT;
+ }
+ break;
+ }
+
+ case VOICE_IOCTL_GET_VBUF: {
+ int fs = 0;
+ int en = 0;
+ int type = 0;
+ T_VoiceBuf_Para vb;
+ CPPS_FUNC(cpps_callbacks, zDrvVp_Status)(&fs, NULL);
+ pr_info("voice_ioctl zDrvVp_Status fs=%d!\n", fs);
+ CPPS_FUNC(cpps_callbacks, zDrvVp_GetVoiceBuffer_Wrap)(&en,&type);
+ vb.fs = fs;
+ vb.enable = en;
+ vb.type = type;
+ pr_info("voice_ioctl GET_VBUF,enable=%d type=%d!\n",vb.enable,vb.type);
+
+ if (copy_to_user(argp, &vb, sizeof(vb))) {
+ pr_err("voice_ioctl GET_VBUF copy_to_user err!\n");
+ return -EFAULT;
+ }
+
+ break;
+ }
+
+ case VOICE_IOCTL_SET_VBUF: {
+ T_VoiceBuf_Para vb;
+
+ if (copy_from_user(&vb, argp, sizeof(vb))) {
+ print_audio("voice_ioctl SET_VBUF copy_to_user err!\n");
+ return -EFAULT;
+ }
+
+ CPPS_FUNC(cpps_callbacks, zDrvVp_SetVoiceBuffer_Wrap)(vb.enable,vb.type);
+ pr_info("voice_ioctl SET_VBUF,enable=%d type=%d!\n",vb.enable,vb.type);
+
+
+
+ break;
+ }
+
+
default: {
pr_info("voice_ioctl invalid cmd!\n");
break;
diff --git a/ap/os/linux/linux-3.4.x/drivers/staging/voltedrv/volte.c b/ap/os/linux/linux-3.4.x/drivers/staging/voltedrv/volte.c
index 2341465..262868f 100644
--- a/ap/os/linux/linux-3.4.x/drivers/staging/voltedrv/volte.c
+++ b/ap/os/linux/linux-3.4.x/drivers/staging/voltedrv/volte.c
@@ -39,6 +39,7 @@
extern int32_t zDrvVoice_WriteStop(void);
extern int32_t zDrvVoice_ReadOneFrame(uint8_t *pBuf);
extern int32_t zDrvVoice_WriteOneFrame(uint8_t *pBuf);
+ extern int zDrvVp_GetSlicFlag(void);
diff --git a/ap/os/linux/linux-3.4.x/include/linux/module.h b/ap/os/linux/linux-3.4.x/include/linux/module.h
index 2c82c91..4424555 100755
--- a/ap/os/linux/linux-3.4.x/include/linux/module.h
+++ b/ap/os/linux/linux-3.4.x/include/linux/module.h
@@ -21,6 +21,9 @@
#include <linux/percpu.h>
#include <asm/module.h>
#include <linux/amr_drv.h>
+
+#include <linux/volte_drv.h>
+
/* Not Yet Implemented */
#define MODULE_SUPPORTED_DEVICE(name)
@@ -743,6 +746,11 @@
void (*zDrvDtmf_Detect_RegCallbacks)(T_DrvDtmf_Detect_Opt);
int (*zDrvVp_SetPath_Wrap)(int);
int (*zDrvVp_GetSlicFlag)(void);
+ int (*zDrvVp_SetVoiceProc_Wrap)(int);
+ int (*zDrvVp_GetVoiceProc_Wrap)(void);
+ int (*zDrvVp_SetVoiceBuffer_Wrap)(int ,int );
+ void (*zDrvVp_GetVoiceBuffer_Wrap)(int *,int *);
+
int (*zDrvVp_SetEchoDelay_Wrap)(int);
int (*zDrvVp_GetEchoDelay_Wrap)(void);
int (*zDrvVp_SetTxNsMode_Wrap)(int);
diff --git a/ap/os/linux/linux-3.4.x/include/linux/volte_drv.h b/ap/os/linux/linux-3.4.x/include/linux/volte_drv.h
index 47a6c01..d281d7d 100755
--- a/ap/os/linux/linux-3.4.x/include/linux/volte_drv.h
+++ b/ap/os/linux/linux-3.4.x/include/linux/volte_drv.h
@@ -73,6 +73,15 @@
} T_Voice_Para;
+typedef struct {
+ uint32_t fs; //8000;16000
+ uint32_t enable; //// 0 disable;1 enable
+ uint32_t type;//0 single core;1 mult core
+
+
+} T_VoiceBuf_Para;
+
+
#ifdef __KERNEL__
struct voice_dev {
T_Voice_Para param;
@@ -97,6 +106,14 @@
#define VOICE_IOCTL_GET_FS _IOR('v', 20, int)
#define VOICE_IOCTL_SET_VOICE_NVRW _IOW('v', 21, int)
+#define VOICE_IOCTL_SET_VP _IOW('v', 22, int)
+#define VOICE_IOCTL_GET_VP _IOR('v', 23, int)
+
+#define VOICE_IOCTL_SET_VBUF _IOW('v', 24, T_VoiceBuf_Para)
+#define VOICE_IOCTL_GET_VBUF _IOR('v', 25, T_VoiceBuf_Para)
+
+
+
#ifdef __KERNEL__
#define print_audio(fmt, ...) \
printk(fmt, ##__VA_ARGS__)
diff --git a/ap/project/zx297520v3/prj_vehicle_dc_ref/build/config.mk b/ap/project/zx297520v3/prj_vehicle_dc_ref/build/config.mk
index 4f38694..24f8ce3 100755
--- a/ap/project/zx297520v3/prj_vehicle_dc_ref/build/config.mk
+++ b/ap/project/zx297520v3/prj_vehicle_dc_ref/build/config.mk
@@ -62,6 +62,9 @@
#else
#CUSTOM_MACRO += -D_CPE_AUDIO_PRJ
endif
+ifeq ($(USE_VOICE_AT),yes)
+CUSTOM_MACRO += -D_USE_VOICE_AT
+endif
ifeq ($(USE_VOICE_ALSA),yes)
CUSTOM_MACRO += -D_USE_VOICE_ALSA
endif