From 0aab871095ba77bd2e1978a71eaecb2ba7e6ff19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=83=A1=E4=BC=A0=E5=86=9B?= <1224667075@qq.com> Date: Mon, 1 Dec 2025 07:45:02 +0000 Subject: [PATCH] Merge #2835 into sdk650pathc0423 from refs/changes/2835/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 胡传军 * refs/changes/2835/head: (12 commits squashed) - 屏蔽VAD认证 - Merge branch 'sdk650pathc0423' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423 - 增加文件保存测试开关 - Merge branch 'sdk650pathc0423' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423 - Merge branch 'sdk650pathc0423' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423 - 修改ai宏开关不生效的问题 - Merge branch 'sdk650pathc0423' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423 - cat1升级启动换位置 - Merge branch 'sdk650pathc0423' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423 - Merge branch 'sdk650pathc0423' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423 - Merge branch 'sdk650pathc0423' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423 - vad参数调整 Signed-off-by: aliyun8003852482 <1224667075@qq.com> Merged-by: 薛文强 CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/2835 --- .../4g/cat1Service/Service/cat1_server.c | 30 ++++++++++--------- .../4g/cat1Service/include/cat1_tcpServer.h | 2 ++ code/sdk/zhihui/imsl/src/vad_server.c | 2 +- .../zhihui/leiniao/imsl_ln/ln_api_websocket.c | 2 +- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/code/sdk/zhihui/4g/cat1Service/Service/cat1_server.c b/code/sdk/zhihui/4g/cat1Service/Service/cat1_server.c index c1b819260..2b6d21fe8 100644 --- a/code/sdk/zhihui/4g/cat1Service/Service/cat1_server.c +++ b/code/sdk/zhihui/4g/cat1Service/Service/cat1_server.c @@ -1109,6 +1109,21 @@ int cat1_handle_version_msg(char *msg) // OHOS::ConfigModel::GetInstance()->SetpyVer(cat1_api_runtime_get_cat1_pyver()); // OHOS::ConfigModel::GetInstance()->SetmoderVer(cat1_api_runtime_get_cat1_modemver()); // cat1_msg_event_sendmsg_toUI("verupdate"); + + uint8_t need_ota=0; + FILE *fp= fopen(CAT1_PY_IS_NEED_UPDATA_PATH,"rb+"); + if(fp) + { + fread(&need_ota,sizeof(uint8_t),1,fp); + fclose(fp); + remove(CAT1_PY_IS_NEED_UPDATA_PATH); + if(need_ota>g_py_ver) + { + cat1_start_tcp_ota_init(); + cat1_tcp_server_init(); + } + + } } @@ -1763,20 +1778,7 @@ errcode_t cat1_server_init(void) //第一次启动,要确保去除已经添加过的cat1 Vote restart_sleep_cat1_timer(); #endif - uint8_t need_ota=0; - FILE *fp= fopen(CAT1_PY_IS_NEED_UDP_PATH,"rb+"); - if(fp) - { - fread(&need_ota,sizeof(uint8_t),1,fp); - fclose(fp); - remove(CAT1_PY_IS_NEED_UDP_PATH); - if(need_ota>g_py_ver) - { - cat1_start_tcp_ota_init(); - cat1_tcp_server_init(); - } - - } + return ERRCODE_SUCC; diff --git a/code/sdk/zhihui/4g/cat1Service/include/cat1_tcpServer.h b/code/sdk/zhihui/4g/cat1Service/include/cat1_tcpServer.h index ef0e7e9fa..ceb53f046 100644 --- a/code/sdk/zhihui/4g/cat1Service/include/cat1_tcpServer.h +++ b/code/sdk/zhihui/4g/cat1Service/include/cat1_tcpServer.h @@ -84,6 +84,8 @@ uint8_t Get_Cat1_OTA_Flag(void); #define CAT1_PY_IS_NEED_UDP_PATH "/system/cat1otaudp/is_need_updata.txt" //存放需要升级的py文件路径 #endif +#define CAT1_PY_IS_NEED_UPDATA_PATH "/user/system/is_need_updata.txt" //存放需要升级的py文件路径 + #ifdef __cplusplus #if __cplusplus diff --git a/code/sdk/zhihui/imsl/src/vad_server.c b/code/sdk/zhihui/imsl/src/vad_server.c index 6b1f9f72b..f684714be 100644 --- a/code/sdk/zhihui/imsl/src/vad_server.c +++ b/code/sdk/zhihui/imsl/src/vad_server.c @@ -424,7 +424,7 @@ errcode_t vad_server_init(vad_status_callback_t callback) struct VadConfig vad_config = { .vad_log_level = 1, /* INFO 日志 */ .sil_threshold = 63, /* 静音阈值 */ - .energy_threshold = 50000, /* 能量阈值 */ + .energy_threshold = 40000, /* 能量阈值 */ .min_speech_length = 240, /* 最短语音长度 (ms) */ .silence_detect_length = 300, /* 静音检测长度 (ms) */ .rule1_min_tailing_silence = 480, /* 规则1静音时间 (ms) */ diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api_websocket.c b/code/sdk/zhihui/leiniao/imsl_ln/ln_api_websocket.c index a17e9a2b4..41a168054 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api_websocket.c +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api_websocket.c @@ -197,7 +197,7 @@ static uint32_t g_audio_timeout_ticks = 1500; // 音频超时tick数(默认1.5 static uint32_t g_last_binary_data_tick = 0; // 最后一次接收二进制数据的tick // 音频数据最近缓存(环形缓冲区,仅保留最近数据) -#define AUDIO_CACHE_BUFFER_SIZE (1024+512) // 8KB缓存 +#define AUDIO_CACHE_BUFFER_SIZE (1024*3) // 8KB缓存 static uint8_t g_audio_cache_buffer[AUDIO_CACHE_BUFFER_SIZE]; static uint32_t g_audio_cache_pos = 0; // 当前写入位置 static uint32_t g_audio_cache_total = 0; // 总写入数据量 -- 2.17.1